From 6f3d5db7b7b3da73e03217ee7c615cc7a6f78bce Mon Sep 17 00:00:00 2001 From: Rashed Abdel-Tawab Date: Tue, 14 May 2019 00:36:02 -0700 Subject: [PATCH] taimen: Import and tailor {extract-files,setup-makefiles}.sh This is a squash of the following: Author: Bruno Martins Date: Tue Jun 19 23:55:25 2018 +0100 taimen: Fix typo from CodeAurora in blob_fixup * Let com.qualcomm.qcrilmsgtunnel break free Change-Id: Ide5759eef7e3100ac5b50f5dc95a3f90119e592f Author: Michael Bestas Date: Sat Dec 19 02:53:35 2020 +0200 taimen: Switch to standalone extract utils Align with templates while we are at it Change-Id: Ife50623a3d1b8733f5cc76995c982d8950d39ad4 Author: Rashed Abdel-Tawab Date: Tue May 14 00:36:02 2019 -0700 taimen: Import and tailor {extract-files,setup-makefiles}.sh * Partial pick of Id399faa404207ce018f0f0187c9576b61f5d4dc9. Change-Id: I866e015e3ba717ae7fc585dc56f118f3e251154c Change-Id: I231d822f364f57314009be4d08af993b97bf5705 --- extract-files.sh | 71 ++++++++++++++++++++++++++++++++++++++++++++++ setup-makefiles.sh | 37 ++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 extract-files.sh create mode 100644 setup-makefiles.sh diff --git a/extract-files.sh b/extract-files.sh new file mode 100644 index 0000000..a954df3 --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=taimen +VENDOR=google + +# 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}" + +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true + +KANG= +SECTION= + +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 + +function blob_fixup() { + case "${1}" in + # Fix typo in qcrilmsgtunnel whitelist + product/etc/sysconfig/nexus.xml) + sed -i 's/qulacomm/qualcomm/' "${2}" + ;; + esac +} + +# Initialize the helper +setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" + +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" +extract "${MY_DIR}/proprietary-files-vendor.txt" "${SRC}" "${KANG}" --section "${SECTION}" + +"${MY_DIR}/setup-makefiles.sh" diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100644 index 0000000..5965268 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=taimen +VENDOR=google + +# 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}" + +# Initialize the helper +setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" + +# Warning headers and guards +write_headers + +write_makefiles "${MY_DIR}/proprietary-files.txt" true +write_makefiles "${MY_DIR}/proprietary-files-vendor.txt" true + +# Finish +write_footers