From: Nolen Johnson Date: Wed, 3 Jan 2024 04:11:25 +0000 (-0500) Subject: kane: Sync extractors with templates X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eebe7a6d63418a51834c4671c12450c74eea667a;p=GitHub%2FLineageOS%2Fandroid_device_motorola_kane.git kane: Sync extractors with templates Change-Id: I0b2ca01796db7187f0a4bfce952548aea7a83c7e --- diff --git a/extract-files.sh b/extract-files.sh index 41657a4..86b3ec1 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -6,72 +6,31 @@ # SPDX-License-Identifier: Apache-2.0 # -set -e - -DEVICE=kane -VENDOR=motorola - -# Load extract_utils and do some sanity checks -MY_DIR="${BASH_SOURCE%/*}" -if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi - -ANDROID_ROOT="${MY_DIR}/../../.." - -HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" -if [ ! -f "${HELPER}" ]; then - echo "Unable to find helper script at ${HELPER}" - exit 1 -fi -source "${HELPER}" - -# Default to sanitizing the vendor folder before extraction -CLEAN_VENDOR=true - -KANG= -SECTION= - -while [ "${#}" -gt 0 ]; do +function blob_fixup() { case "${1}" in - -n | --no-cleanup ) - CLEAN_VENDOR=false - ;; - -k | --kang ) - KANG="--kang" - ;; - -s | --section ) - SECTION="${2}"; shift - CLEAN_VENDOR=false - ;; - * ) - SRC="${1}" - ;; + # Missing libutils symbols + vendor/lib*/sensors.chub.so|vendor/lib*/hw/sensors.kane_sprout.so) + "${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${2}" + ;; + # Remove libhidltransport/libhwbinder dependencies + vendor/lib*/libril_sitril.so) + "${PATCHELF}" --remove-needed "libhidltransport.so" "${2}" + "${PATCHELF}" --remove-needed "libhwbinder.so" "${2}" + ;; esac - shift -done +} -if [ -z "${SRC}" ]; then - SRC="adb" +# If we're being sourced by the common script that we called, +# stop right here. No need to go down the rabbit hole. +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then + return fi -# Initialize the helper -setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" - -extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" - -# Fix proprietary blobs -BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE"/proprietary - -"${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${BLOB_ROOT}"/vendor/lib/sensors.chub.so -"${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${BLOB_ROOT}"/vendor/lib64/sensors.chub.so -"${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${BLOB_ROOT}"/vendor/lib/hw/sensors.kane_sprout.so -"${PATCHELF}" --replace-needed "libutils.so" "libutils-v32.so" "${BLOB_ROOT}"/vendor/lib64/hw/sensors.kane_sprout.so - -# Remove libhidltransport dependency -"${PATCHELF}" --remove-needed "libhidltransport.so" "${BLOB_ROOT}"/vendor/lib/libril_sitril.so -"${PATCHELF}" --remove-needed "libhidltransport.so" "${BLOB_ROOT}"/vendor/lib64/libril_sitril.so +set -e -# Remove libhwbinder dependency -"${PATCHELF}" --remove-needed "libhwbinder.so" "${BLOB_ROOT}"/vendor/lib/libril_sitril.so -"${PATCHELF}" --remove-needed "libhwbinder.so" "${BLOB_ROOT}"/vendor/lib64/libril_sitril.so +export DEVICE=kane +export DEVICE_COMMON=exynos9610-common +export VENDOR=motorola +export VENDOR_COMMON=${VENDOR} -"${MY_DIR}/setup-makefiles.sh" +"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@" diff --git a/setup-makefiles.sh b/setup-makefiles.sh index d0ffb2a..1aa8cc0 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -8,29 +8,9 @@ set -e -DEVICE=kane -VENDOR=motorola +export DEVICE=kane +export DEVICE_COMMON=exynos9610-common +export VENDOR=motorola +export VENDOR_COMMON=${VENDOR} -# Load extract_utils and do some sanity checks -MY_DIR="${BASH_SOURCE%/*}" -if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi - -ANDROID_ROOT="${MY_DIR}/../../.." - -HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" -if [ ! -f "${HELPER}" ]; then - echo "Unable to find helper script at ${HELPER}" - exit 1 -fi -source "${HELPER}" - -# Initialize the helper -setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" - -# Warning headers and guards -write_headers - -write_makefiles "${MY_DIR}/proprietary-files.txt" true - -# Finish -write_footers +"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"