kunlun2: Switch to standalone extract utils

This commit is contained in:
mikeNG 2021-01-23 15:29:17 +01:00 committed by Giammarco Senatore
parent 0e92220187
commit 25f2ae1553
2 changed files with 22 additions and 19 deletions

View file

@ -1,9 +1,13 @@
#!/bin/bash #!/bin/bash
# #
# Copyright (C) 2018-2019 The LineageOS Project # Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
#
if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
return
fi
set -e set -e
@ -14,11 +18,11 @@ VENDOR=lenovo
MY_DIR="${BASH_SOURCE%/*}" MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
LINEAGE_ROOT="${MY_DIR}"/../../.. ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="${LINEAGE_ROOT}/vendor/aosp/build/tools/extract_utils.sh" HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then if [ ! -f "$HELPER" ]; then
echo "Unable to find helper script at ${HELPER}" echo "Unable to find helper script at $HELPER"
exit 1 exit 1
fi fi
source "${HELPER}" source "${HELPER}"
@ -26,8 +30,8 @@ source "${HELPER}"
# Default to sanitizing the vendor folder before extraction # Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true CLEAN_VENDOR=true
SECTION=
KANG= KANG=
SECTION=
while [ "${#}" -gt 0 ]; do while [ "${#}" -gt 0 ]; do
case "${1}" in case "${1}" in
@ -53,11 +57,11 @@ if [ -z "${SRC}" ]; then
fi fi
# Initialize the helper # Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" true "${CLEAN_VENDOR}" setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \ extract "${MY_DIR}"/proprietary-files.txt "${SRC}" \
"${KANG}" --section "${SECTION}" "${KANG}" --section "${SECTION}"
BLOB_ROOT="${LINEAGE_ROOT}/vendor/${VENDOR}/${DEVICE}/proprietary" DEVICE_BLOB_ROOT="${ANDROID_ROOT}"/vendor/"${VENDOR}"/"${DEVICE}"/proprietary
"${MY_DIR}/setup-makefiles.sh" "${MY_DIR}/setup-makefiles.sh"

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Copyright (C) 2018-2019 The LineageOS Project # Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@ -10,25 +11,23 @@ set -e
DEVICE=kunlun2 DEVICE=kunlun2
VENDOR=lenovo VENDOR=lenovo
INITIAL_COPYRIGHT_YEAR=2019
# Load extract_utils and do some sanity checks # Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}" MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
LINEAGE_ROOT="${MY_DIR}/../../.." ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="${LINEAGE_ROOT}/vendor/aosp/build/tools/extract_utils.sh" HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then if [ ! -f "$HELPER" ]; then
echo "Unable to find helper script at ${HELPER}" echo "Unable to find helper script at $HELPER"
exit 1 exit 1
fi fi
source "${HELPER}" source "${HELPER}"
# Initialize the helper # Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Copyright headers and guards # Warning headers and guards
write_headers write_headers
write_makefiles "${MY_DIR}/proprietary-files.txt" true write_makefiles "${MY_DIR}/proprietary-files.txt" true