summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2020-12-28 20:43:12 +0200
committerTimi <timi.rautamaki@gmail.com>2021-01-03 10:27:29 +0100
commit9a52c68af5c65f5d656ffbef102611e5732c9aea (patch)
tree772b82afb6b093a81402b13c436a6dbd17e7c0a4
parent32d7b1413b7cc719f9490457f5f9a8ee6d3e833e (diff)
dumpling: Switch to standalone extract utils
Align with templates while we are at it Change-Id: I3cd279191c7bd3582f1c1f80c588eb26cf9da933
-rwxr-xr-xextract-files.sh47
-rwxr-xr-xsetup-makefiles.sh19
2 files changed, 21 insertions, 45 deletions
diff --git a/extract-files.sh b/extract-files.sh
index bbce205..0056379 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -1,42 +1,29 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
-# Copyright (C) 2017 The LineageOS 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/fingerprint.goodix.so | vendor/lib64/hw/fingerprint.goodix.so)
+ sed -i "s|\x00goodix.fingerprint\x00|\x00fingerprint\x00\x00\x00\x00\x00\x00\x00\x00|" "${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=dumpling
export DEVICE_COMMON=msm8998-common
export VENDOR=oneplus
-export DEVICE_BRINGUP_YEAR=2017
-
-./../../$VENDOR/$DEVICE_COMMON/extract-files.sh $@
-
-# Load extract_utils and do some sanity checks
-MY_DIR="${BASH_SOURCE%/*}"
-if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
-
-LINEAGE_ROOT="$MY_DIR"/../../..
-
-function fix_goodix () {
- sed -i \
- 's|\x00goodix.fingerprint\x00|\x00fingerprint\x00\x00\x00\x00\x00\x00\x00\x00|' \
- "$LINEAGE_ROOT"/vendor/"$VENDOR"/"$DEVICE"/proprietary/"$1"
-}
-
-fix_goodix vendor/lib/hw/fingerprint.goodix.so
-fix_goodix vendor/lib64/hw/fingerprint.goodix.so
+"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"
diff --git a/setup-makefiles.sh b/setup-makefiles.sh
index 6b7a6ae..57ba5fd 100755
--- a/setup-makefiles.sh
+++ b/setup-makefiles.sh
@@ -1,18 +1,9 @@
#!/bin/bash
#
-# Copyright (C) 2017 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
@@ -21,6 +12,4 @@ export DEVICE=dumpling
export DEVICE_COMMON=msm8998-common
export VENDOR=oneplus
-export DEVICE_BRINGUP_YEAR=2017
-
-./../../$VENDOR/$DEVICE_COMMON/setup-makefiles.sh $@
+"./../../${VENDOR}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"