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
#
# 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");
# 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.
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=gts3llte
VENDOR=samsung
SRC=~/system
# Load extract_utils and do some sanity checks
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
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
. "$HELPER"
source "${HELPER}"
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
while [ "$1" != "" ]; do
case $1 in
-n | --no-cleanup ) CLEAN_VENDOR=false
;;
-s | --section ) shift
SECTION=$1
KANG=
SECTION=
while [ "${#}" -gt 0 ]; do
case "${1}" in
-n | --no-cleanup )
CLEAN_VENDOR=false
;;
* ) SRC=$1
-k | --kang )
KANG="--kang"
;;
-s | --section )
SECTION="${2}"; shift
CLEAN_VENDOR=false
;;
* )
SRC="${1}"
;;
esac
shift
done
if [ -z "$SRC" ]; then
SRC=adb
if [ -z "${SRC}" ]; then
SRC="adb"
fi
function blob_fixup() {
case "${1}" in
esac
}
# 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
#
# 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");
# 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.
# SPDX-License-Identifier: Apache-2.0
#
set -e
@ -21,28 +11,26 @@ set -e
DEVICE=gts3llte
VENDOR=samsung
INITIAL_COPYRIGHT_YEAR=2018
# Load extract_utils and do some sanity checks
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
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
. "$HELPER"
source "${HELPER}"
# Initialize the helper
setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Copyright headers and guards
write_headers "gts3llte"
# Warning headers and guards
write_headers
write_makefiles "$MY_DIR"/proprietary-files.txt
write_makefiles "${MY_DIR}/proprietary-files.txt" true
# Finish
write_footers