From 6283d16982cdad6c50697a75fbafb4d44edaacbd Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Mon, 28 Dec 2020 01:19:41 +0200 Subject: [PATCH] whyred: Switch to standalone extract utils Align with templates while we are at it Change-Id: I3cd279191c7bd3582f1c1f80c588eb26cf9da933 --- extract-files.sh | 48 +++++++++++++++++++++------------------------- setup-makefiles.sh | 20 +++++-------------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 9dbeb86..684526a 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,36 +1,32 @@ #!/bin/bash # -# Copyright (C) 2018-2019 The LineageOS Project +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 # +function blob_fixup() { + case "${1}" in + vendor/lib/hw/camera.sdm660.so) + "${PATCHELF}" --add-needed "libcamera_sdm660_shim.so" "${2}" + ;; + vendor/lib64/libgf_ca.so) + sed -i 's|/system/etc/firmware|/vendor/firmware\x0\x0\x0\x0|g' "${2}" + ;; + esac +} + +# 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 export DEVICE=whyred -export VENDOR=xiaomi -export DEVICE_BRINGUP_YEAR=2019 export DEVICE_COMMON=sdm660-common +export VENDOR=xiaomi -./../../$VENDOR/$DEVICE_COMMON/extract-files.sh "$@" - -MY_DIR="${BASH_SOURCE%/*}" -if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi - -LINEAGE_ROOT="$MY_DIR"/../../.. -DEVICE_BLOB_ROOT="$LINEAGE_ROOT"/vendor/"$VENDOR"/"$DEVICE"/proprietary - -patchelf --add-needed libcamera_sdm660_shim.so "$DEVICE_BLOB_ROOT"/vendor/lib/hw/camera.sdm660.so - -sed -i 's|/system/etc/firmware|/vendor/firmware\x0\x0\x0\x0|g' "$DEVICE_BLOB_ROOT"/vendor/lib64/libgf_ca.so - +"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@" diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 13b8cbf..6128ed6 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -1,25 +1,15 @@ #!/bin/bash # -# Copyright (C) 2018-2019 The LineageOS Project +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 # set -e export DEVICE=whyred -export VENDOR=xiaomi -export DEVICE_BRINGUP_YEAR=2020 export DEVICE_COMMON=sdm660-common +export VENDOR=xiaomi -./../../$VENDOR/$DEVICE_COMMON/setup-makefiles.sh $@ +"./../../${VENDOR}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"