Skip to content
Snippets Groups Projects
Commit 8cca7123 authored by Michael Bestas's avatar Michael Bestas Committed by Nolen Johnson
Browse files

beckham: Sync extract scripts with templates

Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc
parent af0bd4a1
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
# #
# Copyright (C) 2016 The CyanogenMod Project # SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
...@@ -10,44 +10,63 @@ function blob_fixup() { ...@@ -10,44 +10,63 @@ function blob_fixup() {
case "${1}" in case "${1}" in
# Correct mods gid # Correct mods gid
system/etc/permissions/com.motorola.mod.xml) system/etc/permissions/com.motorola.mod.xml)
[ "$2" = "" ] && return 0
sed -i "s|mot_mod|oem_5020|g" "${2}" sed -i "s|mot_mod|oem_5020|g" "${2}"
;; ;;
# Add uhid group for fingerprint service # Add uhid group for fingerprint service
vendor/etc/init/android.hardware.biometrics.fingerprint@2.1-service.rc) vendor/etc/init/android.hardware.biometrics.fingerprint@2.1-service.rc)
[ "$2" = "" ] && return 0
sed -i "s/system input/system uhid input/" "${2}" sed -i "s/system input/system uhid input/" "${2}"
;; ;;
# Replace libcutils with libprocessgroup # Replace libcutils with libprocessgroup
vendor/lib/hw/audio.primary.sdm660.so) vendor/lib/hw/audio.primary.sdm660.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --replace-needed "libcutils.so" "libprocessgroup.so" "${2}" "${PATCHELF}" --replace-needed "libcutils.so" "libprocessgroup.so" "${2}"
"${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}"
;; ;;
# Fix camera recording # Fix camera recording
vendor/lib/libmmcamera2_pproc_modules.so) vendor/lib/libmmcamera2_pproc_modules.so)
[ "$2" = "" ] && return 0
sed -i "s/ro.product.manufacturer/ro.product.nopefacturer/" "${2}" sed -i "s/ro.product.manufacturer/ro.product.nopefacturer/" "${2}"
;; ;;
# Load ZAF configs from vendor # Load ZAF configs from vendor
vendor/lib/libzaf_core.so) vendor/lib/libzaf_core.so)
[ "$2" = "" ] && return 0
sed -i "s|/system/etc/zaf|/vendor/etc/zaf|g" "${2}" sed -i "s|/system/etc/zaf|/vendor/etc/zaf|g" "${2}"
;; ;;
# Use VNDK 32 libutils # Use VNDK 32 libutils
vendor/lib/libaudioroute.so | vendor/lib/libmotaudioutils.so | vendor/lib/libsensorndkbridge.so | vendor/lib/libtinycompress.so | vendor/lib/libtinycompress_vendor.so) vendor/lib/libaudioroute.so | vendor/lib/libmotaudioutils.so | vendor/lib/libsensorndkbridge.so | vendor/lib/libtinycompress.so | vendor/lib/libtinycompress_vendor.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}"
;; ;;
vendor/lib/soundfx/libspeakerbundle.so | vendor/lib/soundfx/libmmieffectswrapper.so | vendor/lib/libeqservicebridge.so | vendor/lib/motorola.hardware.audio.eqservice@1.0_vendor.so) vendor/lib/soundfx/libspeakerbundle.so | vendor/lib/soundfx/libmmieffectswrapper.so | vendor/lib/libeqservicebridge.so | vendor/lib/motorola.hardware.audio.eqservice@1.0_vendor.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}"
;; ;;
# Fix missing symbol _ZN7android8hardware7details17gBnConstructorMapE # Fix missing symbol _ZN7android8hardware7details17gBnConstructorMapE
system/lib64/motorola.hardware.vibrator@1.0.so) system/lib64/motorola.hardware.vibrator@1.0.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --replace-needed "libhidlbase.so" "libhidlbase-v32.so" "${2}" "${PATCHELF}" --replace-needed "libhidlbase.so" "libhidlbase-v32.so" "${2}"
;; ;;
vendor/lib64/com.fingerprints.extension@1.0.so) vendor/lib64/com.fingerprints.extension@1.0.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --replace-needed "libhidlbase.so" "libhidlbase-v32.so" "${2}" "${PATCHELF}" --replace-needed "libhidlbase.so" "libhidlbase-v32.so" "${2}"
;; ;;
# New naming for libstdc++ # New naming for libstdc++
vendor/lib*/libdualcameraddm.so|vendor/lib*/libvideobokeh.so|vendor/lib/libmmcamera_hdr_gb_lib.so) vendor/lib*/libdualcameraddm.so|vendor/lib*/libvideobokeh.so|vendor/lib/libmmcamera_hdr_gb_lib.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --replace-needed "libstdc++.so" "libstdc++_vendor.so" "${2}" "${PATCHELF}" --replace-needed "libstdc++.so" "libstdc++_vendor.so" "${2}"
;; ;;
*)
return 1
;;
esac esac
return 0
}
function blob_fixup_dry() {
blob_fixup "$1" ""
} }
# If we're being sourced by the common script that we called, # If we're being sourced by the common script that we called,
...@@ -61,5 +80,6 @@ set -e ...@@ -61,5 +80,6 @@ set -e
export DEVICE=beckham export DEVICE=beckham
export DEVICE_COMMON=msm8998-common export DEVICE_COMMON=msm8998-common
export VENDOR=motorola export VENDOR=motorola
export VENDOR_COMMON=${VENDOR}
"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@" "./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment