From 25f2ae155371abae230108e58959e922d948cd71 Mon Sep 17 00:00:00 2001 From: mikeNG Date: Sat, 23 Jan 2021 15:29:17 +0100 Subject: [PATCH] kunlun2: Switch to standalone extract utils --- extract-files.sh | 24 ++++++++++++++---------- setup-makefiles.sh | 17 ++++++++--------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 81fdd61..4745279 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -1,9 +1,13 @@ #!/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 -# + +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then + return +fi set -e @@ -14,11 +18,11 @@ VENDOR=lenovo MY_DIR="${BASH_SOURCE%/*}" 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" -if [ ! -f "${HELPER}" ]; then - echo "Unable to find helper script at ${HELPER}" +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}" @@ -26,8 +30,8 @@ source "${HELPER}" # Default to sanitizing the vendor folder before extraction CLEAN_VENDOR=true -SECTION= KANG= +SECTION= while [ "${#}" -gt 0 ]; do case "${1}" in @@ -53,11 +57,11 @@ if [ -z "${SRC}" ]; then fi # 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}" -BLOB_ROOT="${LINEAGE_ROOT}/vendor/${VENDOR}/${DEVICE}/proprietary" +DEVICE_BLOB_ROOT="${ANDROID_ROOT}"/vendor/"${VENDOR}"/"${DEVICE}"/proprietary "${MY_DIR}/setup-makefiles.sh" diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 5a98469..f55717f 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -1,6 +1,7 @@ #!/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 # @@ -10,25 +11,23 @@ set -e DEVICE=kunlun2 VENDOR=lenovo -INITIAL_COPYRIGHT_YEAR=2019 - # 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}/../../.." +ANDROID_ROOT="${MY_DIR}/../../.." -HELPER="${LINEAGE_ROOT}/vendor/aosp/build/tools/extract_utils.sh" -if [ ! -f "${HELPER}" ]; then - echo "Unable to find helper script at ${HELPER}" +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}" # 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_makefiles "${MY_DIR}/proprietary-files.txt" true