diff options
Diffstat (limited to 'extract-files.sh')
-rwxr-xr-x | extract-files.sh | 59 |
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 |