2020-07-05 20:46:04 -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-07-05 20:46:04 -04:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Load extract_utils and do some sanity checks
|
|
|
|
MY_DIR="${BASH_SOURCE%/*}"
|
|
|
|
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
|
|
|
|
|
2022-02-17 13:38:26 -05:00
|
|
|
ANDROID_ROOT="${MY_DIR}/../../.."
|
2020-07-05 20:46:04 -04:00
|
|
|
|
2024-08-14 02:44:45 -04:00
|
|
|
export TARGET_ENABLE_CHECKELF=true
|
|
|
|
|
2022-02-17 13:38:26 -05:00
|
|
|
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
|
2020-07-05 20:46:04 -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/sm8350-common",
|
|
|
|
"hardware/qcom-caf/sm8350",
|
|
|
|
"hardware/qcom-caf/wlan",
|
|
|
|
"hardware/xiaomi",
|
|
|
|
"vendor/qcom/opensource/commonsys/display",
|
|
|
|
"vendor/qcom/opensource/commonsys-intf/display",
|
|
|
|
"vendor/qcom/opensource/dataservices",
|
|
|
|
"vendor/qcom/opensource/display",
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2024-08-16 19:23:32 -04:00
|
|
|
function lib_to_package_fixup_vendor_variants() {
|
|
|
|
if [ "$2" != "vendor" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$1" in
|
2024-08-16 19:03:24 -04:00
|
|
|
com.qualcomm.qti.dpm.api@1.0 | \
|
2024-08-25 06:45:39 -04:00
|
|
|
libmmosal | \
|
2024-09-14 07:03:58 -04:00
|
|
|
vendor.qti.diaghal@1.0 | \
|
2024-08-25 06:45:39 -04:00
|
|
|
vendor.qti.hardware.wifidisplaysession@1.0 | \
|
2024-08-16 19:03:24 -04:00
|
|
|
vendor.qti.imsrtpservice@3.0)
|
2024-08-16 19:23:32 -04:00
|
|
|
echo "$1-vendor"
|
|
|
|
;;
|
2024-08-18 02:52:31 -04:00
|
|
|
libOmxCore | \
|
|
|
|
libwpa_client) ;;
|
2024-08-16 19:23:32 -04:00
|
|
|
*)
|
|
|
|
return 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
function lib_to_package_fixup() {
|
|
|
|
lib_to_package_fixup_clang_rt_ubsan_standalone "$1" ||
|
|
|
|
lib_to_package_fixup_proto_3_9_1 "$1" ||
|
|
|
|
lib_to_package_fixup_vendor_variants "$@"
|
|
|
|
}
|
|
|
|
|
2020-07-05 20:46:04 -04: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-07-05 20:46:04 -04:00
|
|
|
|
2022-02-17 13:38:26 -05:00
|
|
|
# Warning headers and guards
|
2023-11-20 14:52:28 -05:00
|
|
|
write_headers "haydn lisa mars odin redwood renoir star venus"
|
2020-07-05 20:46:04 -04:00
|
|
|
|
|
|
|
# The standard common blobs
|
2024-09-09 19:07:58 -04:00
|
|
|
write_makefiles "${MY_DIR}/proprietary-files.txt"
|
2020-07-05 20:46:04 -04:00
|
|
|
|
|
|
|
# Finish
|
|
|
|
write_footers
|
|
|
|
|
2024-08-27 15:05:28 -04:00
|
|
|
if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
|
2020-07-05 20:46:04 -04:00
|
|
|
# Reinitialize the helper for device
|
2024-08-27 15:05:28 -04:00
|
|
|
source "${MY_DIR}/../../${VENDOR}/${DEVICE}/setup-makefiles.sh"
|
2022-02-17 13:38:26 -05:00
|
|
|
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
|
2020-07-05 20:46:04 -04:00
|
|
|
|
2022-02-17 13:38:26 -05:00
|
|
|
# Warning headers and guards
|
2020-07-05 20:46:04 -04:00
|
|
|
write_headers
|
|
|
|
|
|
|
|
# The standard device blobs
|
2024-09-09 19:07:58 -04:00
|
|
|
write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt"
|
2020-07-05 20:46:04 -04:00
|
|
|
|
2024-08-27 15:05:28 -04:00
|
|
|
if [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then
|
|
|
|
append_firmware_calls_to_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt"
|
2023-11-30 13:44:20 -05:00
|
|
|
fi
|
|
|
|
|
2020-07-05 20:46:04 -04:00
|
|
|
# Finish
|
|
|
|
write_footers
|
|
|
|
fi
|