Specify DEFCONFIG for bluecross or bonito in build.config.*

1. Use BUILD_CONFIG to build for bluecross or bonito
2. Also add friendly build_*.sh to indicate build command for bluecross and bonito

Bug: 119540871
Change-Id: Ia2fd5c08d2b95dad57a26a34cc0bb4a266f969a4
Signed-off-by: Robin Peng <robinpeng@google.com>
This commit is contained in:
Robin Peng
2019-04-01 17:22:10 +08:00
parent a1145e4535
commit e088cc1913
22 changed files with 241 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common
KCFLAGS='-fno-tree-vrp'

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_kasan_config"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
PRE_DEFCONFIG_CMDS="pre_defconfig"

View File

@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_nocfi_config"

7
build.config.bonito Normal file
View File

@@ -0,0 +1,7 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig"
UNSTRIPPED_MODULES="
wlan.ko
"

View File

@@ -0,0 +1,25 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"
function update_debug_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e CONFIG_DMA_API_DEBUG \
-e CONFIG_DEBUG_SHIRQ \
-e CONFIG_DEBUG_KOBJECT \
-e CONFIG_DEBUG_KOBJECT_RELEASE \
-e CONFIG_DEBUG_LIST \
-e CONFIG_DEBUG_PI_LIST \
-e CONFIG_DEBUG_NOTIFIERS \
-e CONFIG_DEBUG_CREDENTIALS \
-e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG \
-d SHADOW_CALL_STACK
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

View File

@@ -0,0 +1,26 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"
function update_debug_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e CONFIG_LOCKUP_DETECTOR \
-e CONFIG_HARDLOCKUP_DETECTOR \
-e CONFIG_HARDLOCKUP_DETECTOR_OTHER_CPU \
-e CONFIG_BOOTPARAM_HARDLOCKUP_PANIC \
-e CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC \
-e CONFIG_BOOTPARAM_HUNG_TASK_PANIC \
-e CONFIG_WQ_WATCHDOG \
-e CONFIG_PANIC_ON_RT_THROTTLING \
-e CONFIG_RCU_EQS_DEBUG \
-e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG \
-d SHADOW_CALL_STACK
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

View File

@@ -0,0 +1,17 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"
function update_debug_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
--set-val DEBUG_KMEMLEAK_EARLY_LOG_SIZE 4500 \
-e CONFIG_DEBUG_KMEMLEAK \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

View File

@@ -0,0 +1,23 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"
function update_debug_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e CONFIG_DEBUG_RT_MUTEXES \
-e CONFIG_DEBUG_SPINLOCK \
-e CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG \
-e CONFIG_DEBUG_MUTEXES \
-e CONFIG_DEBUG_PREEMPT \
-e CONFIG_DEBUG_ATOMIC_SLEEP \
-e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG \
-d SHADOW_CALL_STACK
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

View File

@@ -0,0 +1,48 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_debug_config"
function update_debug_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e CONFIG_DEVMEM \
-e CONFIG_DEBUG_OBJECTS \
-e CONFIG_DEBUG_OBJECTS_FREE \
-e CONFIG_DEBUG_OBJECTS_TIMERS \
-e CONFIG_DEBUG_OBJECTS_WORK \
-e CONFIG_DEBUG_OBJECTS_RCU_HEAD \
-e CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER \
-e CONFIG_DEBUG_VM \
-e CONFIG_DEBUG_VM_VMACACHE \
-e CONFIG_DEBUG_VM_RB \
-e CONFIG_DEBUG_MEMORY_INIT \
-e CONFIG_DEBUG_STACK_USAGE \
-e CONFIG_DEBUG_PAGEALLOC \
-e CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT \
-e CONFIG_SCHED_STACK_END_CHECK \
-e CONFIG_SLUB_DEBUG \
-e CONFIG_SLUB_DEBUG_PANIC_ON \
-e CONFIG_PAGE_OWNER \
-e CONFIG_PAGE_OWNER_ENABLE_DEFAULT \
-e CONFIG_PAGE_POISONING \
-e CONFIG_PAGE_POISONING_ENABLE_DEFAULT \
-e CONFIG_DEBUG_SPINLOCK \
-e CONFIG_DEBUG_SPINLOCK_PANIC_ON_BUG \
-e CONFIG_DEBUG_MUTEXES \
-e CONFIG_DEBUG_ATOMIC_SLEEP \
-e CONFIG_DEBUG_LIST \
-e CONFIG_QCOM_RTB \
-e CONFIG_QCOM_RTB_SEPARATE_CPUS \
-e CONFIG_PANIC_ON_DATA_CORRUPTION \
-e CONFIG_QCOM_RTB \
-e CONFIG_QCOM_RTB_SEPARATE_CPUS \
-e CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS \
-e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

18
build.config.bonito_gcc Normal file
View File

@@ -0,0 +1,18 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common
KCFLAGS='-fno-tree-vrp'
POST_DEFCONFIG_CMDS="check_defconfig && update_gcc_config"
function update_gcc_config() {
# Disable clang-specific options
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG \
-d SHADOW_CALL_STACK
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

26
build.config.bonito_kasan Normal file
View File

@@ -0,0 +1,26 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_kasan_config"
function update_kasan_config() {
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-e CONFIG_KASAN \
-e CONFIG_KASAN_INLINE \
-e CONFIG_TEST_KASAN \
-e CONFIG_KCOV \
-e CONFIG_SLUB \
-e CONFIG_PANIC_ON_WARN_DEFAULT_ENABLE \
-d CONFIG_KASAN_OUTLINE \
-d CONFIG_RANDOMIZE_BASE \
-d CONFIG_CC_WERROR \
--set-val CONFIG_FRAME_WARN 0 \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG \
-d SHADOW_CALL_STACK
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

23
build.config.bonito_lts Normal file
View File

@@ -0,0 +1,23 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
PRE_DEFCONFIG_CMDS="pre_defconfig"
POST_DEFCONFIG_CMDS="check_defconfig"
POST_KERNEL_BUILD_CMDS="post_kernel_build"
function pre_defconfig() {
# Watch KERNEL_DIR recursively, record all files opened during the build
rm -f ${OUT_DIR}/kernel-files.tmp1
inotifywait -m -r -e open --format '%w%f' ${KERNEL_DIR} -o ${OUT_DIR}/kernel-files.tmp1 &
PID_INOTIFYWAIT=$!
sleep 5
}
function post_kernel_build() {
# Stop watching KERNEL_DIR
kill ${PID_INOTIFYWAIT}
# Generate list of touched files and merge commit message
cat ${OUT_DIR}/kernel-files.tmp1 | sed "s,${KERNEL_DIR}/,,g" | sort -u > ${OUT_DIR}/kernel-files.tmp2
(set +x; for f in $(cat ${OUT_DIR}/kernel-files.tmp2); do [ -f "${KERNEL_DIR}/${f}" ] && echo "${f}"; done > ${OUT_DIR}/kernel-files.txt)
(cd ${KERNEL_DIR} && ${ROOT_DIR}/build/buildinfo/generate-merge-commit-msg.py HEAD~1..HEAD ${OUT_DIR}/kernel-files.txt > ${OUT_DIR}/merge-commit-msg.txt)
}

View File

@@ -0,0 +1,16 @@
DEFCONFIG=bonito_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common.clang
POST_DEFCONFIG_CMDS="check_defconfig && update_nocfi_config"
function update_nocfi_config() {
# Disable clang-specific options
${KERNEL_DIR}/scripts/config --file ${OUT_DIR}/.config \
-d LTO \
-d LTO_CLANG \
-d CFI \
-d CFI_PERMISSIVE \
-d CFI_CLANG
(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} olddefconfig)
}

1
build_bluecross.sh Executable file
View File

@@ -0,0 +1 @@
BUILD_CONFIG=private/msm-google/build.config.bluecross_no-cfi build/build.sh

1
build_bonito.sh Executable file
View File

@@ -0,0 +1 @@
BUILD_CONFIG=private/msm-google/build.config.bonito_no-cfi build/build.sh