Skip to content

Commit

Permalink
Specify DEFCONFIG for bluecross or bonito in build.config.*
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robin Peng committed Apr 1, 2019
1 parent a1145e4 commit e088cc1
Show file tree
Hide file tree
Showing 22 changed files with 241 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.config → build.config.bluecross
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions build.config.gcc → build.config.bluecross_gcc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DEFCONFIG=b1c1_defconfig
KERNEL_DIR=private/msm-google
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common
KCFLAGS='-fno-tree-vrp'
Expand Down
1 change: 1 addition & 0 deletions build.config.kasan → build.config.bluecross_kasan
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions build.config.lts → build.config.bluecross_lts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions build.config.no-cfi → build.config.bluecross_no-cfi
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 7 additions & 0 deletions build.config.bonito
Original file line number Diff line number Diff line change
@@ -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
"
25 changes: 25 additions & 0 deletions build.config.bonito_debug_api
Original file line number Diff line number Diff line change
@@ -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)
}
26 changes: 26 additions & 0 deletions build.config.bonito_debug_hang
Original file line number Diff line number Diff line change
@@ -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)
}
17 changes: 17 additions & 0 deletions build.config.bonito_debug_kmemleak
Original file line number Diff line number Diff line change
@@ -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)
}
23 changes: 23 additions & 0 deletions build.config.bonito_debug_locking
Original file line number Diff line number Diff line change
@@ -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)
}
48 changes: 48 additions & 0 deletions build.config.bonito_debug_memory
Original file line number Diff line number Diff line change
@@ -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 changes: 18 additions & 0 deletions build.config.bonito_gcc
Original file line number Diff line number Diff line change
@@ -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 changes: 26 additions & 0 deletions build.config.bonito_kasan
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions build.config.bonito_lts
Original file line number Diff line number Diff line change
@@ -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)
}
16 changes: 16 additions & 0 deletions build.config.bonito_no-cfi
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions build_bluecross.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_CONFIG=private/msm-google/build.config.bluecross_no-cfi build/build.sh
1 change: 1 addition & 0 deletions build_bonito.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_CONFIG=private/msm-google/build.config.bonito_no-cfi build/build.sh

0 comments on commit e088cc1

Please sign in to comment.