android_kernel_samsung_sm8650/build.config.gki.aarch64.16k
Yifan Hong fb62426994 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 <elsk@google.com>
2022-10-03 11:24:35 -07:00

6 lines
342 B
Plaintext

. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki.aarch64
DEFCONFIG=16k_gki_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=""