build.config.msm.gki: Add sanity check for ABI

To help ensure that the GKI kernel and device kernel are kept in sync,
test whether abi_gki_aarch64.xml matches between the GKI kernel and
msm-5.10.

This check is not fail-safe however. If an ABI impacting change is
committed to either msm-5.10 or GKI tree without the corresponding ABI
update, then this check will incorrectly proceed. The correct way is to
do a full ABI comparison between msm-5.10 and the GKI tree with every
build, however that is time-intensive. Thus, prefer to do the simple
check for now.

Change-Id: Id801eeda347ce821fc6a29ae0e987c185a856bce
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
This commit is contained in:
Elliot Berman 2021-05-12 17:12:21 -07:00
parent dc92568766
commit b62a79f013

View File

@ -18,10 +18,23 @@ KMI_SYMBOL_LIST_ADD_ONLY=1
KMI_ENFORCED=1
MAKE_GOALS="modules dtbs"
GKI_BUILD_CONFIG=common/build.config.gki.aarch64
GKI_KERNEL_DIR=common
GKI_BUILD_CONFIG=${GKI_KERNEL_DIR}/build.config.gki.aarch64
GKI_SKIP_IF_VERSION_MATCHES=1
GKI_SKIP_CP_KERNEL_HDR=1
function sanity_check_abi() {
[ -z "${GKI_BUILD_CONFIG}" ] && return
if ! diff -q "${ROOT_DIR}/${KERNEL_DIR}/android/abi_gki_aarch64.xml" \
"${ROOT_DIR}/${GKI_KERNEL_DIR}/android/abi_gki_aarch64.xml" ; then
echo "Suspected ABI differences between ${BRANCH} and GKI kernel tree."
echo "Are trees in sync?"
exit 1
fi
}
append_cmd POST_DEFCONFIG_CMDS 'sanity_check_abi'
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