From f3176dc624b1042df646270c3c9782447799e40b Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 3 Oct 2022 11:17:20 -0700 Subject: [PATCH] ANDROID: 16k target: don't write defconfig to source tree Instead of writing to the source tree $ROOT_DIR/$KERNEL_DIR, write to $OUT_DIR instead. Note that $OUT_DIR isn't defined at this point, so it is left as a variable in the PRE_DEFCONFIG_CMDS. The change as two benefits to Kleaf: - This is one prerequesite to make --config=local possible for slider_config and others. Otherwise, multiple kernel_config targets with the same $DEFCONFIG will collide, and they cannot be executed in parallel with --config=local. OUT_DIR does not collide because OUT_DIR_SUFFIX is determined by the label of the target. - This ensures that both build.sh and Kleaf not write to the source tree (e.g. common/arch/arm64/configs/16k_gki_defconfig in this case). Otherwise, an interrupted build.sh build or an interrupted --config=local Bazel build will leave the source tree dirty, causing slider_gki_defconfig to be a readonly input file in the next Bazel execution. Because it no longer writes to the source tree, the POST_DEFCONFIG_CMDS that cleans up the file is no longer necessary. Test: builds Test: TH Bug: 234045848 Change-Id: I6ac3770cca160c025549cb336c9d2d05ad98ad1b Signed-off-by: Yifan Hong --- build.config.gki.aarch64.16k | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.config.gki.aarch64.16k b/build.config.gki.aarch64.16k index feda2c7b20fc..20be95d54647 100644 --- a/build.config.gki.aarch64.16k +++ b/build.config.gki.aarch64.16k @@ -1,5 +1,5 @@ . ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki.aarch64 DEFCONFIG=16k_gki_defconfig -PRE_DEFCONFIG_CMDS="cat ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/16k_gki.fragment > ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG};" -POST_DEFCONFIG_CMDS="rm ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG}" +PRE_DEFCONFIG_CMDS="mkdir -p \${OUT_DIR}/arch/arm64/configs/ && cat ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/16k_gki.fragment > \${OUT_DIR}/arch/arm64/configs/${DEFCONFIG};" +POST_DEFCONFIG_CMDS=""