g12-common: Sync extract scripts with templates
authorMichael Bestas <mkbestas@lineageos.org>
Tue, 27 Aug 2024 19:51:30 +0000 (22:51 +0300)
committerNolen Johnson <johnsonnolen@gmail.com>
Thu, 5 Sep 2024 05:14:57 +0000 (01:14 -0400)
Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc

extract-files.sh
setup-makefiles.sh

index 0b07db0a45502d5b87d5ca9828b693a5edc7e893..4793fb313e1836aabaaef0ed7b1df4c83480d029 100755 (executable)
@@ -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
index 7dd4d5da16dbf427e77ce66c5e3dfd1226d7407b..ae0e2ab6eb3aa33e4ff274e54538425308e6e918 100755 (executable)
@@ -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
 #