2020-03-20 11:11:24 -04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2024-08-27 15:05:28 -04:00
|
|
|
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
|
|
|
|
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
|
2020-12-27 18:17:48 -05:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2020-03-20 11:11:24 -04:00
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Load extract_utils and do some sanity checks
|
|
|
|
MY_DIR="${BASH_SOURCE%/*}"
|
|
|
|
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
|
|
|
|
|
2020-12-27 18:17:48 -05:00
|
|
|
ANDROID_ROOT="${MY_DIR}/../../.."
|
2020-03-20 11:11:24 -04:00
|
|
|
|
2024-08-14 02:44:45 -04:00
|
|
|
export TARGET_ENABLE_CHECKELF=true
|
|
|
|
|
2020-12-27 18:17:48 -05:00
|
|
|
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
|
2020-03-20 11:11:24 -04:00
|
|
|
if [ ! -f "${HELPER}" ]; then
|
|
|
|
echo "Unable to find helper script at ${HELPER}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
source "${HELPER}"
|
|
|
|
|
2023-08-29 16:58:31 -04:00
|
|
|
function vendor_imports() {
|
|
|
|
cat <<EOF >>"$1"
|
|
|
|
"device/xiaomi/sm6150-common",
|
|
|
|
"hardware/qcom-caf/sm8150",
|
|
|
|
"hardware/qcom-caf/wlan",
|
|
|
|
"hardware/xiaomi",
|
|
|
|
"vendor/qcom/opensource/dataservices",
|
|
|
|
"vendor/qcom/opensource/display",
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2021-01-12 12:52:43 -05:00
|
|
|
# Initialize the helper for common
|
2024-08-27 15:05:28 -04:00
|
|
|
setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true
|
2020-03-20 11:11:24 -04:00
|
|
|
|
2020-12-27 18:17:48 -05:00
|
|
|
# Warning headers and guards
|
2023-01-13 00:32:42 -05:00
|
|
|
write_headers "courbet davinci phoenix surya sweet toco violet"
|
2020-03-20 11:11:24 -04:00
|
|
|
|
2021-01-12 12:52:43 -05:00
|
|
|
# The standard common blobs
|
2024-08-27 15:05:28 -04:00
|
|
|
write_makefiles "${MY_DIR}/proprietary-files.txt"
|
2020-03-20 11:11:24 -04:00
|
|
|
|
|
|
|
# Finish
|
|
|
|
write_footers
|
2021-01-12 12:52:43 -05:00
|
|
|
|
2024-08-27 15:05:28 -04:00
|
|
|
if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
|
2021-01-12 12:52:43 -05:00
|
|
|
# Reinitialize the helper for device
|
2024-08-27 15:05:28 -04:00
|
|
|
source "${MY_DIR}/../../${VENDOR}/${DEVICE}/setup-makefiles.sh"
|
2021-01-12 12:52:43 -05:00
|
|
|
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
|
|
|
|
|
|
|
|
# Warning headers and guards
|
|
|
|
write_headers
|
|
|
|
|
|
|
|
# The standard device blobs
|
2024-08-27 15:05:28 -04:00
|
|
|
write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt"
|
|
|
|
|
|
|
|
if [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then
|
|
|
|
append_firmware_calls_to_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt"
|
|
|
|
fi
|
2021-01-12 12:52:43 -05:00
|
|
|
|
|
|
|
# Finish
|
|
|
|
write_footers
|
|
|
|
fi
|