Skip to content

Commit

Permalink
whyred: Switch to standalone extract utils
Browse files Browse the repository at this point in the history
Align with templates while we are at it

Change-Id: I3cd279191c7bd3582f1c1f80c588eb26cf9da933
  • Loading branch information
mikeNG authored and SebaUbuntu committed Dec 28, 2020
1 parent 9d73660 commit 6283d16
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 41 deletions.
48 changes: 22 additions & 26 deletions extract-files.sh
Original file line number Diff line number Diff line change
@@ -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" "$@"
20 changes: 5 additions & 15 deletions setup-makefiles.sh
Original file line number Diff line number Diff line change
@@ -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" "$@"

0 comments on commit 6283d16

Please sign in to comment.