2022-02-11 06:43:01 +09:00
|
|
|
################################################################################
|
|
|
|
# Common MSM configuration for building GKI-based kernels
|
|
|
|
DEFCONFIG="gki_defconfig"
|
|
|
|
|
|
|
|
# Configuration options to build images for MSM targets
|
|
|
|
# Must be included AFTER build.config.msm.<target>
|
|
|
|
|
|
|
|
# boot image macros
|
|
|
|
BUILD_BOOT_IMG=1
|
|
|
|
BUILD_INITRAMFS=1
|
|
|
|
|
|
|
|
KMI_SYMBOL_LIST_MODULE_GROUPING=0
|
|
|
|
KMI_SYMBOL_LIST_ADD_ONLY=1
|
|
|
|
KMI_ENFORCED=1
|
|
|
|
|
|
|
|
MAKE_GOALS="modules dtbs"
|
|
|
|
GKI_BUILD_CONFIG=common/build.config.gki.aarch64
|
|
|
|
GKI_SKIP_CP_KERNEL_HDR=1
|
|
|
|
|
2022-07-01 07:12:43 +09:00
|
|
|
# "Hacks" to enable symbol trimming on the common kernel from here (msm-kernel). To be removed once
|
|
|
|
# we get a common kernel with symbol trimming.
|
2022-04-06 02:27:59 +09:00
|
|
|
GKI_KMI_SYMBOL_LIST=../msm-kernel/android/abi_gki_aarch64_qcom
|
|
|
|
KMI_SYMBOL_LIST=android/abi_gki_aarch64_qcom
|
2022-07-01 07:12:43 +09:00
|
|
|
if [ "${VARIANT}" = gki ]; then
|
|
|
|
GKI_TRIM_NONLISTED_KMI=${TRIM_NONLISTED_KMI:-1}
|
|
|
|
fi
|
2022-07-27 02:04:53 +09:00
|
|
|
GKI_KMI_SYMBOL_LIST_STRICT_MODE=1
|
2022-04-06 02:27:59 +09:00
|
|
|
GKI_KMI_ENFORCED=1
|
|
|
|
KMI_ENFORCED=1
|
|
|
|
|
2022-04-29 10:25:03 +09:00
|
|
|
function sanity_check_abi() {
|
|
|
|
if [ -z "${GKI_BUILD_CONFIG}" ]; then
|
|
|
|
# When running build_abi.sh, mixed build is explicitly disabled
|
|
|
|
# In that case, turn on some options for trimming and strict mode
|
|
|
|
# which would normally be disabled because they conflict with
|
|
|
|
# mixed build
|
|
|
|
if [ "${VARIANT}" = gki ]; then
|
|
|
|
TRIM_NONLISTED_KMI=1
|
|
|
|
KMI_SYMBOL_LIST_STRICT_MODE=1
|
|
|
|
fi
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
append_cmd POST_DEFCONFIG_CMDS 'sanity_check_abi'
|
|
|
|
|
2022-02-11 06:43:01 +09:00
|
|
|
function build_defconfig_fragments() {
|
|
|
|
if [[ "${VARIANT}" =~ ^(gki|consolidate)$ ]]; then
|
|
|
|
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/${MSM_ARCH}_GKI.config vendor/${MSM_ARCH}-gki_defconfig
|
|
|
|
if [ "${VARIANT}" = gki ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
GKI_BUILD_CONFIG=common/build.config.gki-debug.aarch64
|
|
|
|
GKI_GKI_BUILD_CONFIG_FRAGMENT=msm-kernel/build.config.gki_consolidate.aarch64
|
|
|
|
# ABI comparison isn't applicable on consolidate variant
|
|
|
|
unset ABI_DEFINITION
|
|
|
|
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/consolidate.fragment consolidate_defconfig
|
|
|
|
apply_defconfig_fragment ${KERNEL_DIR}/arch/${ARCH}/configs/vendor/${MSM_ARCH}_consolidate.config vendor/${MSM_ARCH}-consolidate_defconfig
|
|
|
|
elif [ "${VARIANT}" = gki-ack ]; then
|
|
|
|
# In gki-only, then using ACK's GKI config directly
|
|
|
|
. ${KERNEL_DIR}/build.config.gki
|
|
|
|
else
|
|
|
|
echo "Variant '${VARIANT}' unsupported by gki"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
build_defconfig_fragments
|