aboutsummaryrefslogtreecommitdiff
path: root/extract-files.sh
diff options
context:
space:
mode:
authorkleidione Freitas <kleidione@gmail.com>2022-03-24 09:16:43 -0300
committerkleidione <kleidione@gmail.com>2022-11-09 17:29:16 -0300
commit44d5c9e2cf9f1ce0670be5bedd1e415cd5c3e739 (patch)
tree4516fedba0c65fda9e795d8737d08a7746d41e40 /extract-files.sh
parent15eeafbf239f393fcb6ed1a719398e5b7bbd6a19 (diff)
veux: Merge common tree to veux
- Ref: https://github.com/xiaomi-sm6375-devs/android_device_xiaomi_sm6375-common Signed-off-by: kleidione <kleidione@gmail.com>
Diffstat (limited to 'extract-files.sh')
-rwxr-xr-xextract-files.sh59
1 files changed, 48 insertions, 11 deletions
diff --git a/extract-files.sh b/extract-files.sh
index 7d85c26..ababc8f 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -1,21 +1,58 @@
#!/bin/bash
#
-# Copyright (C) 2016 The CyanogenMod Project
-# Copyright (C) 2017-2020 The LineageOS Project
+# Copyright (C) 2022 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
+set -e
+
+DEVICE=veux
+VENDOR=xiaomi
+
+# Load extract_utils and do some sanity checks
+MY_DIR="${BASH_SOURCE%/*}"
+if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
+
+ANDROID_ROOT="${MY_DIR}"/../../..
+
+HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
+if [ ! -f "${HELPER}" ]; then
+ echo "Unable to find helper script at ${HELPER}"
+ exit 1
fi
+source "${HELPER}"
-set -e
+# Default to sanitizing the vendor folder before extraction
+CLEAN_VENDOR=true
+
+while [ "${#}" -gt 0 ]; do
+ case "${1}" in
+ -n | --no-cleanup )
+ CLEAN_VENDOR=false
+ ;;
+ -k | --kang )
+ KANG="--kang"
+ ;;
+ -s | --section )
+ SECTION="${2}"; shift
+ CLEAN_VENDOR=false
+ ;;
+ * )
+ SRC="${1}"
+ ;;
+ esac
+ shift
+done
+
+if [ -z "${SRC}" ]; then
+ SRC="adb"
+fi
+
+# Initialize the helper for common device
+setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
-export DEVICE=veux
-export DEVICE_COMMON=sm6375-common
-export VENDOR=xiaomi
+extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \
+ "${KANG}" --section "${SECTION}"
-"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"
+"${MY_DIR}/setup-makefiles.sh" \ No newline at end of file