2022-02-16 15:08:01 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2024-10-01 10:46:00 -04:00
|
|
|
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
|
|
|
|
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
|
2022-02-16 15:08:01 -05: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
|
|
|
|
|
|
|
|
ANDROID_ROOT="${MY_DIR}/../../.."
|
|
|
|
|
2024-08-14 02:44:45 -04:00
|
|
|
export TARGET_ENABLE_CHECKELF=true
|
2024-09-29 04:24:29 -04:00
|
|
|
|
2022-02-16 15:08:01 -05:00
|
|
|
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}"
|
|
|
|
|
2025-01-17 05:01:23 -05:00
|
|
|
function vendor_imports() {
|
|
|
|
cat <<EOF >>"$1"
|
|
|
|
"device/motorola/sm6375-common",
|
|
|
|
"hardware/qcom-caf/common/libqti-perfd-client",
|
|
|
|
"hardware/qcom-caf/sm8350",
|
|
|
|
"hardware/qcom-caf/wlan",
|
|
|
|
"hardware/motorola",
|
|
|
|
"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
|
|
|
|
com.qualcomm.qti.dpm.api@1.0)
|
|
|
|
echo "$1-vendor"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
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 "$@"
|
|
|
|
}
|
|
|
|
|
2022-02-16 15:08:01 -05:00
|
|
|
# Initialize the helper for common
|
2023-03-06 07:35:47 -05:00
|
|
|
setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true
|
2022-02-16 15:08:01 -05:00
|
|
|
|
|
|
|
# Warning headers and guards
|
2024-07-03 03:26:42 -04:00
|
|
|
write_headers "bangkk fogos"
|
2022-02-16 15:08:01 -05:00
|
|
|
|
|
|
|
# The standard common blobs
|
2024-10-01 10:46:00 -04:00
|
|
|
write_makefiles "${MY_DIR}/proprietary-files.txt"
|
2022-02-16 15:08:01 -05:00
|
|
|
|
|
|
|
# Finish
|
|
|
|
write_footers
|
|
|
|
|
2023-03-06 07:35:47 -05:00
|
|
|
if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
|
2022-02-16 15:08:01 -05:00
|
|
|
# Reinitialize the helper for device
|
|
|
|
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
|
|
|
|
|
|
|
|
# Warning headers and guards
|
|
|
|
write_headers
|
|
|
|
|
|
|
|
# The standard device blobs
|
2024-10-01 10:46:00 -04:00
|
|
|
write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt"
|
2022-02-16 15:08:01 -05:00
|
|
|
|
2023-08-24 00:31:19 -04:00
|
|
|
if [ -f "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt" ]; then
|
|
|
|
append_firmware_calls_to_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-firmware.txt"
|
|
|
|
fi
|
|
|
|
|
2022-02-16 15:08:01 -05:00
|
|
|
# Finish
|
|
|
|
write_footers
|
|
|
|
fi
|