From 9bdba43b72bf2e44e94548a0adaa224c3476b77e Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Tue, 27 Aug 2024 22:51:30 +0300 Subject: [PATCH] g12-common: Sync extract scripts with templates Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc --- extract-files.sh | 19 ++++++++++++++++--- setup-makefiles.sh | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 0b07db0..4793fb3 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# Copyright (C) 2016 The CyanogenMod Project -# Copyright (C) 2017-2023 The LineageOS Project +# SPDX-FileCopyrightText: 2016 The CyanogenMod Project +# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project # # SPDX-License-Identifier: Apache-2.0 # @@ -48,7 +48,8 @@ while [ "${#}" -gt 0 ]; do KANG="--kang" ;; -s | --section ) - SECTION="${2}"; shift + SECTION="${2}" + shift CLEAN_VENDOR=false ;; * ) @@ -65,16 +66,28 @@ fi function blob_fixup() { case "${1}" in vendor/etc/init/fs.rc) + [ "$2" = "" ] && return 0 sed -i '/media 0770 media_rw media_rw/d' "${2}" sed -i '/setprop ro.crypto.fuse_sdcard true/d' "${2}" ;; vendor/etc/init/tee-supplicant.rc) + [ "$2" = "" ] && return 0 sed -i 's#/vendor/lib/#/vendor/lib/modules/#g' "${2}" ;; vendor/lib/hw/camera.amlogic.so|vendor/lib/hw/hwcomposer.amlogic.so|vendor/lib/libOmxCore.so) + [ "$2" = "" ] && return 0 grep -q "libui_shim.so" "${2}" || "${PATCHELF}" --add-needed "libui_shim.so" "${2}" ;; + *) + return 1 + ;; esac + + return 0 +} + +function blob_fixup_dry() { + blob_fixup "$1" "" } if [ -z "${ONLY_FIRMWARE}" ] && [ -z "${ONLY_TARGET}" ]; then diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 7dd4d5d..ae0e2ab 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# Copyright (C) 2016 The CyanogenMod Project -# Copyright (C) 2017-2023 The LineageOS Project +# SPDX-FileCopyrightText: 2016 The CyanogenMod Project +# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project # # SPDX-License-Identifier: Apache-2.0 # -- 2.20.1