whyred: Switch to standalone extract utils

Align with templates while we are at it

Change-Id: I3cd279191c7bd3582f1c1f80c588eb26cf9da933
This commit is contained in:
Michael Bestas 2020-12-28 01:19:41 +02:00 committed by Sebastiano Barezzi
parent 9d736606d5
commit 6283d16982
2 changed files with 27 additions and 41 deletions

View file

@ -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" "$@"

View file

@ -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" "$@"