From 0e3807a51bfcb53c2961e6b78ffadcd21561cbc7 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Tue, 27 Aug 2024 22:05:28 +0300 Subject: [PATCH] sm7325-common: Sync extract scripts with templates Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc --- extract-files.sh | 52 ++++++++++++++++++++++++---------------------- setup-makefiles.sh | 6 +----- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index c2634a5..69d6832 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -2,7 +2,6 @@ # # SPDX-FileCopyrightText: 2016 The CyanogenMod Project # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project -# # SPDX-License-Identifier: Apache-2.0 # @@ -14,7 +13,9 @@ if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi ANDROID_ROOT="${MY_DIR}/../../.." -export TARGET_ENABLE_CHECKELF=true +# If XML files don't have comments before the XML header, use this flag +# Can still be used with broken XML files by using blob_fixup +export TARGET_DISABLE_XML_FIXING=true HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" if [ ! -f "${HELPER}" ]; then @@ -34,29 +35,29 @@ SECTION= while [ "${#}" -gt 0 ]; do case "${1}" in - --only-common ) - ONLY_COMMON=true - ;; - --only-firmware ) - ONLY_FIRMWARE=true - ;; - --only-target ) - ONLY_TARGET=true - ;; - -n | --no-cleanup ) - CLEAN_VENDOR=false - ;; - -k | --kang ) - KANG="--kang" - ;; - -s | --section ) - SECTION="${2}" - shift - CLEAN_VENDOR=false - ;; - * ) - SRC="${1}" - ;; + --only-common) + ONLY_COMMON=true + ;; + --only-firmware) + ONLY_FIRMWARE=true + ;; + --only-target) + ONLY_TARGET=true + ;; + -n | --no-cleanup) + CLEAN_VENDOR=false + ;; + -k | --kang) + KANG="--kang" + ;; + -s | --section) + SECTION="${2}" + shift + CLEAN_VENDOR=false + ;; + *) + SRC="${1}" + ;; esac shift done @@ -81,6 +82,7 @@ function blob_fixup() { sed -i "s#/system/#/system_ext/#" "${2}" ;; system_ext/priv-app/ims/ims.apk) + [ "$2" = "" ] && return 0 apktool_patch "${2}" "$MY_DIR/ims-patches" ;; vendor/etc/vintf/manifest/vendor.dolby.media.c2@1.0-service.xml) diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 36b2f3c..56e9208 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -2,7 +2,6 @@ # # SPDX-FileCopyrightText: 2016 The CyanogenMod Project # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project -# # SPDX-License-Identifier: Apache-2.0 # @@ -14,8 +13,6 @@ if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi ANDROID_ROOT="${MY_DIR}/../../.." -export TARGET_ENABLE_CHECKELF=true - HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" if [ ! -f "${HELPER}" ]; then echo "Unable to find helper script at ${HELPER}" @@ -75,14 +72,13 @@ write_footers if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then # Reinitialize the helper for device - source "${MY_DIR}/../../${VENDOR}/${DEVICE}/setup-makefiles.sh" setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false # Warning headers and guards write_headers # The standard device blobs - write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" + write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" true if [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then append_firmware_calls_to_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt"