From e2a92b60205ca0cf60a72eca9263e9d215d15977 Mon Sep 17 00:00:00 2001 From: Will McVicker Date: Mon, 3 Aug 2020 16:18:08 -0700 Subject: [PATCH] ANDROID: drop KERNEL_DIR setting in build.config.common And replace many references of ${ROOT_DIR}/common with ${ROOT_DIR}/${KERNEL_DIR}, which makes it a lot easier to branch off of ACK and update the KERNEL_DIR. The variable of KERNEL_DIR will be set in build/_setup_env.sh to the directory of the build config file by default if it's not set explicitly in the build config file or in environment. Test: build test with following configs common/build.config.gki.aarch64 common-modules/virtual-device/build.config.cuttlefish.aarch64 common-modules/virtual-device/build.config.goldfish.aarch64 Bug: 162785964 Change-Id: I790ac0ded10bd790484f14c6f93d53e06c38b830 Signed-off-by: Will McVicker Signed-off-by: Yongqin Liu (cherry picked from commit 931718fa65fe5e34d143250c048f591a7d74e5f8) --- build.config.allmodconfig.aarch64 | 6 +++--- build.config.allmodconfig.arm | 6 +++--- build.config.allmodconfig.x86_64 | 6 +++--- build.config.common | 1 - build.config.gki-debug.aarch64 | 2 +- build.config.gki-debug.x86_64 | 2 +- build.config.gki.aarch64 | 6 +++--- build.config.gki.x86_64 | 6 +++--- build.config.gki_kasan | 1 - build.config.gki_kasan.aarch64 | 7 +++---- build.config.gki_kasan.x86_64 | 6 +++--- 11 files changed, 23 insertions(+), 26 deletions(-) diff --git a/build.config.allmodconfig.aarch64 b/build.config.allmodconfig.aarch64 index 863ab1caddab..2fbe380e030a 100644 --- a/build.config.allmodconfig.aarch64 +++ b/build.config.allmodconfig.aarch64 @@ -1,4 +1,4 @@ -. ${ROOT_DIR}/common/build.config.common -. ${ROOT_DIR}/common/build.config.aarch64 -. ${ROOT_DIR}/common/build.config.allmodconfig +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.aarch64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.allmodconfig diff --git a/build.config.allmodconfig.arm b/build.config.allmodconfig.arm index 5dd94819c871..e92744a9b518 100644 --- a/build.config.allmodconfig.arm +++ b/build.config.allmodconfig.arm @@ -1,4 +1,4 @@ -. ${ROOT_DIR}/common/build.config.common -. ${ROOT_DIR}/common/build.config.arm -. ${ROOT_DIR}/common/build.config.allmodconfig +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.arm +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.allmodconfig diff --git a/build.config.allmodconfig.x86_64 b/build.config.allmodconfig.x86_64 index bedb3869d99b..f06b30c8426f 100644 --- a/build.config.allmodconfig.x86_64 +++ b/build.config.allmodconfig.x86_64 @@ -1,4 +1,4 @@ -. ${ROOT_DIR}/common/build.config.common -. ${ROOT_DIR}/common/build.config.x86_64 -. ${ROOT_DIR}/common/build.config.allmodconfig +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.x86_64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.allmodconfig diff --git a/build.config.common b/build.config.common index 0c20768c2301..1454d4c3c7c7 100644 --- a/build.config.common +++ b/build.config.common @@ -1,6 +1,5 @@ BRANCH=android-4.19-stable KMI_GENERATION=0 -KERNEL_DIR=common CC=clang LD=ld.lld diff --git a/build.config.gki-debug.aarch64 b/build.config.gki-debug.aarch64 index 58cee7a6362b..c1fe2f03a279 100644 --- a/build.config.gki-debug.aarch64 +++ b/build.config.gki-debug.aarch64 @@ -1,3 +1,3 @@ -. ${ROOT_DIR}/common/build.config.gki.aarch64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki.aarch64 TRIM_NONLISTED_KMI="" KMI_SYMBOL_LIST_STRICT_MODE="" diff --git a/build.config.gki-debug.x86_64 b/build.config.gki-debug.x86_64 index 9ee51e7de18c..d89b7ad4e804 100644 --- a/build.config.gki-debug.x86_64 +++ b/build.config.gki-debug.x86_64 @@ -1,3 +1,3 @@ -. ${ROOT_DIR}/common/build.config.gki.x86_64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki.x86_64 TRIM_NONLISTED_KMI="" KMI_SYMBOL_LIST_STRICT_MODE="" diff --git a/build.config.gki.aarch64 b/build.config.gki.aarch64 index 7353591fade5..b540900d0940 100644 --- a/build.config.gki.aarch64 +++ b/build.config.gki.aarch64 @@ -1,6 +1,6 @@ -. ${ROOT_DIR}/common/build.config.common -. ${ROOT_DIR}/common/build.config.aarch64 -. ${ROOT_DIR}/common/build.config.gki +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.aarch64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki ABI_DEFINITION=android/abi_gki_aarch64.xml KMI_SYMBOL_LIST=android/abi_gki_aarch64 diff --git a/build.config.gki.x86_64 b/build.config.gki.x86_64 index 627d1e1c27ab..0e04fc692df2 100644 --- a/build.config.gki.x86_64 +++ b/build.config.gki.x86_64 @@ -1,4 +1,4 @@ -. ${ROOT_DIR}/common/build.config.common -. ${ROOT_DIR}/common/build.config.x86_64 -. ${ROOT_DIR}/common/build.config.gki +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.x86_64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki diff --git a/build.config.gki_kasan b/build.config.gki_kasan index e682b0d490bd..b3273b10a01c 100644 --- a/build.config.gki_kasan +++ b/build.config.gki_kasan @@ -1,6 +1,5 @@ DEFCONFIG=gki_defconfig POST_DEFCONFIG_CMDS="check_defconfig && update_kasan_config" -KERNEL_DIR=common function update_kasan_config() { ${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \ -e CONFIG_KASAN \ diff --git a/build.config.gki_kasan.aarch64 b/build.config.gki_kasan.aarch64 index 6277fd662863..9fd2560c45e8 100644 --- a/build.config.gki_kasan.aarch64 +++ b/build.config.gki_kasan.aarch64 @@ -1,4 +1,3 @@ -. ${ROOT_DIR}/common/build.config.common -. ${ROOT_DIR}/common/build.config.aarch64 -. ${ROOT_DIR}/common/build.config.gki_kasan - +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.aarch64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki_kasan diff --git a/build.config.gki_kasan.x86_64 b/build.config.gki_kasan.x86_64 index 6a379eceeb31..eec645805f39 100644 --- a/build.config.gki_kasan.x86_64 +++ b/build.config.gki_kasan.x86_64 @@ -1,4 +1,4 @@ -. ${ROOT_DIR}/common/build.config.common -. ${ROOT_DIR}/common/build.config.x86_64 -. ${ROOT_DIR}/common/build.config.gki_kasan +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.x86_64 +. ${ROOT_DIR}/${KERNEL_DIR}/build.config.gki_kasan