Copy the latest extract tools from LineageOS tools

Signed-off-by: Deokgyu Yang <secugyu@gmail.com>
Change-Id: Ic22365be8d41ca658d571f75489220f71a8e0343
This commit is contained in:
Deokgyu Yang 2021-05-10 23:01:39 +09:00
parent 6f756b0c4a
commit 9a49972b19
2 changed files with 50 additions and 58 deletions

View file

@ -1,63 +1,67 @@
#!/bin/bash #!/bin/bash
# #
# Copyright (C) 2016 The CyanogenMod Project # 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"); # SPDX-License-Identifier: Apache-2.0
# 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.
# #
set -e set -e
DEVICE=gts3llte DEVICE=gts3llte
VENDOR=samsung VENDOR=samsung
SRC=~/system
# 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
CM_ROOT="$MY_DIR"/../../.. ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="$CM_ROOT"/vendor/lineage/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
. "$HELPER" source "${HELPER}"
# Default to sanitizing the vendor folder before extraction # Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true CLEAN_VENDOR=true
while [ "$1" != "" ]; do KANG=
case $1 in SECTION=
-n | --no-cleanup ) CLEAN_VENDOR=false
;; while [ "${#}" -gt 0 ]; do
-s | --section ) shift case "${1}" in
SECTION=$1 -n | --no-cleanup )
CLEAN_VENDOR=false CLEAN_VENDOR=false
;; ;;
* ) SRC=$1 -k | --kang )
;; KANG="--kang"
;;
-s | --section )
SECTION="${2}"; shift
CLEAN_VENDOR=false
;;
* )
SRC="${1}"
;;
esac esac
shift shift
done done
if [ -z "$SRC" ]; then if [ -z "${SRC}" ]; then
SRC=adb SRC="adb"
fi fi
function blob_fixup() {
case "${1}" in
esac
}
# Initialize the helper # Initialize the helper
setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false "$CLEAN_VENDOR" setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION" extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
"$MY_DIR"/setup-makefiles.sh "${MY_DIR}/setup-makefiles.sh"

36
setup-makefiles.sh Normal file → Executable file
View file

@ -1,19 +1,9 @@
#!/bin/bash #!/bin/bash
# #
# Copyright (C) 2016 The CyanogenMod Project # 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"); # SPDX-License-Identifier: Apache-2.0
# 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.
# #
set -e set -e
@ -21,28 +11,26 @@ set -e
DEVICE=gts3llte DEVICE=gts3llte
VENDOR=samsung VENDOR=samsung
INITIAL_COPYRIGHT_YEAR=2018
# 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
CM_ROOT="$MY_DIR"/../../.. ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="$CM_ROOT"/vendor/lineage/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
. "$HELPER" source "${HELPER}"
# Initialize the helper # Initialize the helper
setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Copyright headers and guards # Warning headers and guards
write_headers "gts3llte" write_headers
write_makefiles "$MY_DIR"/proprietary-files.txt write_makefiles "${MY_DIR}/proprietary-files.txt" true
# Finish # Finish
write_footers write_footers