From 2535deae80699b4f5eec69ebcd4f1b531c83e074 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Fri, 16 Dec 2022 16:30:10 -0800 Subject: [PATCH] ANDROID: GKI: Source GKI_BUILD_CONFIG_FRAGMENT after setting all variables build.config.gki sources a GKI_BUILD_CONFIG_FRAGMENT before all of the variables that are considered as part of a GKI kernel build are declared. This reduces the effectiveness of a GKI_BUILD_CONFIG_FRAGMENT, as it is only able to modify a subset of the build variables. Thus, move the logic to source GKI_BUILD_CONFIG_FRAGMENT to the end of the GKI build config files to provide more flexibility for a GKI_BUILD_CONFIG_FRAGMENT. Bug: 262930113 Change-Id: I74abb45f9043acce04cb0052f54fded4340a9366 [isaacmanjarres: Modified build.config.gki.aarch64.fips140, which did not exist on android13-5.15.] Signed-off-by: Isaac J. Manjarres (cherry picked from commit 69fefbb3db711e543ff0676526b7d285a4d10a14) --- build.config.gki | 4 ---- build.config.gki.aarch64 | 4 ++++ build.config.gki.aarch64.fips140 | 4 ++++ build.config.gki.x86_64 | 4 ++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build.config.gki b/build.config.gki index 8a13ddd696ab..4b931d9eb333 100644 --- a/build.config.gki +++ b/build.config.gki @@ -1,6 +1,2 @@ DEFCONFIG=gki_defconfig POST_DEFCONFIG_CMDS="check_defconfig" - -if [ -n "${GKI_BUILD_CONFIG_FRAGMENT}" ]; then -source ${GKI_BUILD_CONFIG_FRAGMENT} -fi diff --git a/build.config.gki.aarch64 b/build.config.gki.aarch64 index 94754bde8238..574c9ebf2fca 100644 --- a/build.config.gki.aarch64 +++ b/build.config.gki.aarch64 @@ -37,3 +37,7 @@ BUILD_GKI_ARTIFACTS=1 BUILD_GKI_BOOT_IMG_SIZE=67108864 BUILD_GKI_BOOT_IMG_GZ_SIZE=47185920 BUILD_GKI_BOOT_IMG_LZ4_SIZE=53477376 + +if [ -n "${GKI_BUILD_CONFIG_FRAGMENT}" ]; then +source ${GKI_BUILD_CONFIG_FRAGMENT} +fi diff --git a/build.config.gki.aarch64.fips140 b/build.config.gki.aarch64.fips140 index 522a0f3e2d41..ec493efc20cf 100644 --- a/build.config.gki.aarch64.fips140 +++ b/build.config.gki.aarch64.fips140 @@ -21,3 +21,7 @@ KERNEL_DIR=common DEFCONFIG=fips140_gki_defconfig PRE_DEFCONFIG_CMDS="mkdir -p \${OUT_DIR}/arch/arm64/configs/ && KCONFIG_CONFIG=\${OUT_DIR}/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/fips140_gki.fragment" POST_DEFCONFIG_CMDS="" + +if [ -n "${GKI_BUILD_CONFIG_FRAGMENT}" ]; then +source ${GKI_BUILD_CONFIG_FRAGMENT} +fi diff --git a/build.config.gki.x86_64 b/build.config.gki.x86_64 index 3d81fea6aacb..93f492cabec8 100644 --- a/build.config.gki.x86_64 +++ b/build.config.gki.x86_64 @@ -9,3 +9,7 @@ BUILD_GKI_CERTIFICATION_TOOLS=1 BUILD_GKI_ARTIFACTS=1 BUILD_GKI_BOOT_IMG_SIZE=67108864 + +if [ -n "${GKI_BUILD_CONFIG_FRAGMENT}" ]; then +source ${GKI_BUILD_CONFIG_FRAGMENT} +fi