2019-06-19 00:21:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2020-12-19 00:53:35 +00:00
|
|
|
# Copyright (C) 2016 The CyanogenMod Project
|
|
|
|
# Copyright (C) 2017-2020 The LineageOS Project
|
2019-06-19 00:21:39 +00:00
|
|
|
#
|
2020-12-19 00:53:35 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2019-06-19 00:21:39 +00: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-19 00:53:35 +00:00
|
|
|
ANDROID_ROOT="${MY_DIR}/../../.."
|
2019-06-19 00:21:39 +00:00
|
|
|
|
2020-12-19 00:53:35 +00:00
|
|
|
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
|
2019-06-19 00:21:39 +00:00
|
|
|
if [ ! -f "${HELPER}" ]; then
|
|
|
|
echo "Unable to find helper script at ${HELPER}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
source "${HELPER}"
|
|
|
|
|
2024-10-15 13:35:08 +00:00
|
|
|
function vendor_imports() {
|
|
|
|
cat <<EOF >>"$1"
|
|
|
|
"device/oneplus/sm8150-common",
|
|
|
|
"hardware/qcom/display",
|
|
|
|
"hardware/qcom/display/gralloc",
|
|
|
|
"hardware/qcom/display/libdebug",
|
|
|
|
"vendor/oneplus/sm8150-common",
|
|
|
|
"vendor/qcom/common/vendor/adreno-r",
|
|
|
|
"vendor/qcom/common/vendor/display/4.14",
|
|
|
|
"vendor/qcom/common/vendor/media-legacy",
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
function lib_to_package_fixup_vendor_variants() {
|
|
|
|
if [ "$2" != "vendor" ]; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
com.qualcomm.qti.dpm.api@1.0 | \
|
|
|
|
com.qualcomm.qti.imscmservice* | \
|
|
|
|
com.qualcomm.qti.uceservice* | \
|
|
|
|
libmmosal | \
|
|
|
|
libfastcrc | \
|
|
|
|
libOmxVideoDSMode | \
|
|
|
|
vendor.qti.data.* | \
|
|
|
|
vendor.qti.diaghal@1.0 | \
|
|
|
|
vendor.qti.hardware.data.* | \
|
|
|
|
vendor.qti.hardware.embmssl* | \
|
|
|
|
vendor.qti.hardware.mwqemadapter@1.0 | \
|
|
|
|
vendor.qti.hardware.radio.* | \
|
|
|
|
vendor.qti.hardware.slmadapter@1.0 | \
|
|
|
|
vendor.qti.hardware.qccsyshal@1.0 | \
|
|
|
|
vendor.qti.hardware.qccvndhal@1.0 | \
|
|
|
|
vendor.qti.hardware.wifidisplaysession@1.0 | \
|
|
|
|
vendor.qti.imsrtpservice@3.0 | \
|
|
|
|
vendor.qti.ims.* | \
|
|
|
|
vendor.qti.latency*)
|
|
|
|
echo "$1_vendor"
|
|
|
|
;;
|
|
|
|
libOmxCore | \
|
|
|
|
libwpa_client)
|
|
|
|
# Android.mk only packages
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
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 "$@"
|
|
|
|
}
|
|
|
|
|
2019-06-19 00:21:39 +00:00
|
|
|
# Initialize the helper for common
|
2024-08-27 19:05:28 +00:00
|
|
|
setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true
|
2019-06-19 00:21:39 +00:00
|
|
|
|
2020-12-19 00:53:35 +00:00
|
|
|
# Warning headers and guards
|
2023-07-25 10:52:24 +00:00
|
|
|
write_headers "oneplus7pro oneplus7 oneplus7tpronr oneplus7tpro oneplus7t"
|
2019-06-19 00:21:39 +00:00
|
|
|
|
|
|
|
# The standard common blobs
|
2024-09-29 08:24:29 +00:00
|
|
|
write_makefiles "${MY_DIR}/proprietary-files.txt"
|
2019-06-19 00:21:39 +00:00
|
|
|
|
|
|
|
# Finish
|
|
|
|
write_footers
|
|
|
|
|
2024-08-27 19:05:28 +00:00
|
|
|
if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
|
2019-11-22 00:48:16 +00:00
|
|
|
# Reinitialize the helper for device
|
2024-08-27 19:05:28 +00:00
|
|
|
source "${MY_DIR}/../../${VENDOR}/${DEVICE}/setup-makefiles.sh"
|
2020-12-19 00:53:35 +00:00
|
|
|
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
|
2019-11-22 00:48:16 +00:00
|
|
|
|
2020-12-19 00:53:35 +00:00
|
|
|
# Warning headers and guards
|
2019-11-22 00:48:16 +00:00
|
|
|
write_headers
|
|
|
|
|
|
|
|
# The standard device blobs
|
2024-08-27 19:05:28 +00:00
|
|
|
write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt"
|
2019-11-22 00:48:16 +00:00
|
|
|
|
|
|
|
# Finish
|
|
|
|
write_footers
|
|
|
|
fi
|