sm7125-common: Fully redo extract-files and setup-makesfiles scripts

So that they actually extract the common blobs too...

Change-Id: I73bd0e51b95f9dbb402b585d22cdc17c734d24cb
fourteen-wip
Simon1511 2 years ago
parent fd171990bc
commit fb6b87d9e0
  1. 41
      extract-files.sh
  2. 36
      setup-makefiles.sh

@ -1,18 +1,16 @@
#!/bin/bash #!/bin/bash
# #
# Copyright (C) 2018-2020 The LineageOS Project # Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
set -e set -e
DEVICE_COMMON=sm7125-common # Load extract_utils and do some sanity checks
VENDOR=samsung
# Load extractutils 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
ANDROID_ROOT="${MY_DIR}/../../.." ANDROID_ROOT="${MY_DIR}/../../.."
@ -26,11 +24,19 @@ source "${HELPER}"
# Default to sanitizing the vendor folder before extraction # Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true CLEAN_VENDOR=true
ONLY_COMMON=
ONLY_TARGET=
KANG= KANG=
SECTION= SECTION=
while [ "${#}" -gt 0 ]; do while [ "${#}" -gt 0 ]; do
case "${1}" in case "${1}" in
--only-common )
ONLY_COMMON=true
;;
--only-target )
ONLY_TARGET=true
;;
-n | --no-cleanup ) -n | --no-cleanup )
CLEAN_VENDOR=false CLEAN_VENDOR=false
;; ;;
@ -52,14 +58,6 @@ if [ -z "${SRC}" ]; then
SRC="adb" SRC="adb"
fi fi
# Initialize the helper
setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
# Fix proprietary blobs
BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary
function blob_fixup() { function blob_fixup() {
case "${1}" in case "${1}" in
vendor/lib64/libsec-ril.so) vendor/lib64/libsec-ril.so)
@ -75,4 +73,19 @@ function blob_fixup() {
esac esac
} }
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}"
fi
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}"
extract "${MY_DIR}/../${DEVICE}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
fi
"${MY_DIR}/setup-makefiles.sh" "${MY_DIR}/setup-makefiles.sh"

@ -1,18 +1,16 @@
#!/bin/bash #!/bin/bash
# #
# Copyright (C) 2017-2021 The LineageOS Project # Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2023 The LineageOS Project
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
set -e set -e
DEVICE_COMMON=sm7125-common # Load extract_utils and do some sanity checks
VENDOR=samsung
# Load extractutils 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
ANDROID_ROOT="${MY_DIR}/../../.." ANDROID_ROOT="${MY_DIR}/../../.."
@ -23,22 +21,28 @@ if [ ! -f "${HELPER}" ]; then
fi fi
source "${HELPER}" source "${HELPER}"
# Initialize the helper # Initialize the helper for common
setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true
# Warning headers and guards # Warning headers and guards
write_headers "a52q a72q" write_headers "a52q a72q"
# The standard common blobs
write_makefiles "${MY_DIR}/proprietary-files.txt" true write_makefiles "${MY_DIR}/proprietary-files.txt" true
################################################################################################### # Finish
# CUSTOM PART START # write_footers
###################################################################################################
OUTDIR=vendor/$VENDOR/$DEVICE_COMMON if [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then
# Reinitialize the helper for device
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
################################################################################################### # Warning headers and guards
# CUSTOM PART END # write_headers
###################################################################################################
# Done # The standard device blobs
write_footers write_makefiles "${MY_DIR}/../${DEVICE}/proprietary-files.txt" true
# Finish
write_footers
fi

Loading…
Cancel
Save