From 15a07cd7a4c67b3215c3a2f1b31c96d01114894d Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Tue, 27 Aug 2024 22:04:35 +0300 Subject: [PATCH] sapphire: Sync extract scripts with templates Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc --- extract-files.sh | 16 ++++++++++++---- setup-makefiles.sh | 13 +++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 3094e4e..cf5026f 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,8 +1,7 @@ #!/bin/bash # -# Copyright (C) 2016 The CyanogenMod Project -# Copyright (C) 2017-2020 The LineageOS Project -# +# SPDX-FileCopyrightText: 2016 The CyanogenMod Project +# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project # SPDX-License-Identifier: Apache-2.0 # @@ -56,15 +55,24 @@ fi function blob_fixup() { case "${1}" in vendor/bin/hw/android.hardware.security.keymint-service-qti|vendor/lib64/libqtikeymint.so) + [ "$2" = "" ] && return 0 grep -q "android.hardware.security.rkp-V3-ndk.so" "${2}" || ${PATCHELF} --add-needed "android.hardware.security.rkp-V3-ndk.so" "${2}" ;; vendor/lib*/soundfx/libdlbvol.so|vendor/lib*/soundfx/libhwdap.so|vendor/lib64/libdlbdsservice.so | vendor/lib64/libcodec2_soft_ac4dec.so | vendor/lib64/libcodec2_soft_ddpdec.so) + [ "$2" = "" ] && return 0 "${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}" ;; vendor/lib64/hw/displayfeature.default.so) + [ "$2" = "" ] && return 0 "${PATCHELF}" --replace-needed "libstagefright_foundation.so" "libstagefright_foundation-v33.so" "${2}" - ;; + ;; esac + + return 0 +} + +function blob_fixup_dry() { + blob_fixup "$1" "" } extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 127b5f8..f22023b 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -1,11 +1,16 @@ #!/bin/bash # -# Copyright (C) 2016 The CyanogenMod Project -# Copyright (C) 2017-2020 The LineageOS Project -# +# SPDX-FileCopyrightText: 2016 The CyanogenMod Project +# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project # SPDX-License-Identifier: Apache-2.0 # +# 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 + set -e DEVICE=sapphire @@ -33,4 +38,4 @@ write_headers write_makefiles "${MY_DIR}/proprietary-files.txt" true # Finish -write_footers \ No newline at end of file +write_footers