diff options
author | Bruno Martins <bgcngm@gmail.com> | 2020-12-28 09:58:06 +0000 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-12-29 03:47:32 +0200 |
commit | 55ec88693338bb47f95368ee870e972be7cde0ff (patch) | |
tree | 149f12927d6374d04474ddabb78dc14998d8c613 | |
parent | 805a68421a9e58040fec31f61e391c7a5abdc48a (diff) |
templates: Support extracting only either common or target device blobs
Change-Id: I33e8c4b79985912199b9776529a32a8a5d7a5aef
-rwxr-xr-x | templates/multi-device/common/extract-files.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/templates/multi-device/common/extract-files.sh b/templates/multi-device/common/extract-files.sh index 22d3afe..890436f 100755 --- a/templates/multi-device/common/extract-files.sh +++ b/templates/multi-device/common/extract-files.sh @@ -24,11 +24,19 @@ source "${HELPER}" # Default to sanitizing the vendor folder before extraction CLEAN_VENDOR=true +ONLY_COMMON= +ONLY_TARGET= KANG= SECTION= while [ "${#}" -gt 0 ]; do case "${1}" in + --only-common ) + ONLY_COMMON=true + ;; + --only-target ) + ONLY_TARGET=true + ;; -n | --no-cleanup ) CLEAN_VENDOR=false ;; @@ -61,12 +69,14 @@ function blob_fixup() { esac } -# Initialize the helper for common device -setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}" +if [ -z "${ONLY_TARGET}" ]; then + # Initialize the helper for common device + setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}" -extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" + extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" +fi -if [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then +if [ -z "${ONLY_COMMON}" ] && [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then # Reinitialize the helper for device source "${MY_DIR}/../${DEVICE}/extract-files.sh" setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" |