From dee1ae4006136f3a2a55a128f642e99b19c58ce2 Mon Sep 17 00:00:00 2001 From: weimh1 Date: Thu, 8 Oct 2020 20:21:23 +0800 Subject: [PATCH] kernel/config: merge moto fragment configs Kernel configs compose of several parts.These parts will be merged into one final file such as "holi-qgki-debug_defconfig". The rule of Moto-product-config files from high order is: product debug config platform debug config, product config platform config Here is an example of product "denver" based on 4350 platform (holi): 1. factory build config list with order: factory-holi-denver.config factory-holi.config moto-holi-denver.config moto-holi.config 2. userdebug build config list with order: debug-holi-denver.config debug-holi.config moto-holi-denver.config moto-holi.config 3. user version config list with order: moto-holi-denver.config moto-holi.config Change-Id: Ie7512300581337ae6768bdfa618613a797f3c10f Signed-off-by: weimh1 Reviewed-on: https://gerrit.mot.com/1769363 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- .../ext_config/debug-holi-denver.config | 2 +- .../vendor/ext_config/debug-holi.config | 17 ++++ .../vendor/ext_config/factory-holi.config | 16 ++++ .../vendor/ext_config/holi_consolidate.config | 1 + .../vendor/ext_config/holi_debug.config | 1 + .../vendor/ext_config/moto-holi.config | 17 ++++ .../configs/vendor/holi_consolidate.config | 51 ++++++++++++ scripts/gki/fragment_motoconfig.sh | 78 +++++++++++++++++++ scripts/gki/generate_defconfig.sh | 3 + 9 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/configs/vendor/ext_config/debug-holi.config create mode 100644 arch/arm64/configs/vendor/ext_config/factory-holi.config create mode 120000 arch/arm64/configs/vendor/ext_config/holi_consolidate.config create mode 120000 arch/arm64/configs/vendor/ext_config/holi_debug.config create mode 100644 arch/arm64/configs/vendor/ext_config/moto-holi.config create mode 100644 arch/arm64/configs/vendor/holi_consolidate.config create mode 100755 scripts/gki/fragment_motoconfig.sh diff --git a/arch/arm64/configs/vendor/ext_config/debug-holi-denver.config b/arch/arm64/configs/vendor/ext_config/debug-holi-denver.config index b987b9fd5c64..830e8a22f610 100644 --- a/arch/arm64/configs/vendor/ext_config/debug-holi-denver.config +++ b/arch/arm64/configs/vendor/ext_config/debug-holi-denver.config @@ -13,4 +13,4 @@ # You can check the .config file to verify that your configuration option is # being set as expected. # -CONFIG_SUSPEND_DEBUG=y + diff --git a/arch/arm64/configs/vendor/ext_config/debug-holi.config b/arch/arm64/configs/vendor/ext_config/debug-holi.config new file mode 100644 index 000000000000..79d06d0a6e8e --- /dev/null +++ b/arch/arm64/configs/vendor/ext_config/debug-holi.config @@ -0,0 +1,17 @@ +# +# Please avoid changing the Qualcomm defconfig files and use this file to +# add any Motorola-specific configuration changes that are applicable to +# userdebug, eng, and user builds. +# +# After building, a list of all of the config files that are used can be found +# at the top of: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig +# +# The actual output of the kernel configuration system can be found at: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config +# +# You can check the .config file to verify that your configuration option is +# being set as expected. +# +CONFIG_DEBUG_FS=y +CONFIG_CFI_PERMISSIVE=y diff --git a/arch/arm64/configs/vendor/ext_config/factory-holi.config b/arch/arm64/configs/vendor/ext_config/factory-holi.config new file mode 100644 index 000000000000..2f770fff3573 --- /dev/null +++ b/arch/arm64/configs/vendor/ext_config/factory-holi.config @@ -0,0 +1,16 @@ +# +# Please avoid changing the Qualcomm defconfig files and use this file to +# add any Motorola-specific configuration changes that are applicable to +# userdebug, eng, and user builds. +# +# After building, a list of all of the config files that are used can be found +# at the top of: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig +# +# The actual output of the kernel configuration system can be found at: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config +# +# You can check the .config file to verify that your configuration option is +# being set as expected. +# +CONFIG_CFI_PERMISSIVE=y diff --git a/arch/arm64/configs/vendor/ext_config/holi_consolidate.config b/arch/arm64/configs/vendor/ext_config/holi_consolidate.config new file mode 120000 index 000000000000..e6f8e868a91d --- /dev/null +++ b/arch/arm64/configs/vendor/ext_config/holi_consolidate.config @@ -0,0 +1 @@ +../holi_consolidate.config \ No newline at end of file diff --git a/arch/arm64/configs/vendor/ext_config/holi_debug.config b/arch/arm64/configs/vendor/ext_config/holi_debug.config new file mode 120000 index 000000000000..c17d67945c2c --- /dev/null +++ b/arch/arm64/configs/vendor/ext_config/holi_debug.config @@ -0,0 +1 @@ +../holi_debug.config \ No newline at end of file diff --git a/arch/arm64/configs/vendor/ext_config/moto-holi.config b/arch/arm64/configs/vendor/ext_config/moto-holi.config new file mode 100644 index 000000000000..16240795456e --- /dev/null +++ b/arch/arm64/configs/vendor/ext_config/moto-holi.config @@ -0,0 +1,17 @@ +# +# Please avoid changing the Qualcomm defconfig files and use this file to +# add any Motorola-specific configuration changes that are applicable to +# userdebug, eng, and user builds. +# +# After building, a list of all of the config files that are used can be found +# at the top of: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig +# +# The actual output of the kernel configuration system can be found at: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config +# +# You can check the .config file to verify that your configuration option is +# being set as expected. +# +CONFIG_LOCALVERSION="-moto" +CONFIG_MMI_DEVICE_DTBS=y diff --git a/arch/arm64/configs/vendor/holi_consolidate.config b/arch/arm64/configs/vendor/holi_consolidate.config new file mode 100644 index 000000000000..2e6b0caad2af --- /dev/null +++ b/arch/arm64/configs/vendor/holi_consolidate.config @@ -0,0 +1,51 @@ +CONFIG_LOCALVERSION="-qgki-consolidate" +CONFIG_IOMMU_TLBSYNC_DEBUG=y +CONFIG_IOMMU_DEBUG=y +CONFIG_IOMMU_TESTS=y +CONFIG_IO_PGTABLE_PAGE_ACCOUNTING=y +CONFIG_CMA_DEBUGFS=y +CONFIG_CMA_DEBUG=y +CONFIG_DEBUG_PAGEALLOC=y +CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT=y +CONFIG_PAGE_OWNER=y +CONFIG_PAGE_OWNER_ENABLE_DEFAULT=y +CONFIG_PAGE_EXTENSION_PAGE_FREE=y +CONFIG_PSI_FTRACE=y +# CONFIG_DEBUG_DMA_BUF_REF is not set +CONFIG_EDAC_KRYO_ARM64_PANIC_ON_CE=y +CONFIG_QMP_DEBUGFS_CLIENT=y +CONFIG_ATOMIC64_SELFTEST=m +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DEBUG_SPINLOCK=y +CONFIG_TEST_USER_COPY=m +CONFIG_OF_RESERVED_MEM_CHECK=y +CONFIG_BUG_ON_HW_MEM_ONLINE_FAIL=y +CONFIG_PANIC_ON_SCHED_BUG=y +CONFIG_PANIC_ON_RT_THROTTLING=y +CONFIG_LKDTM=m +CONFIG_RUNTIME_TESTING_MENU=y +CONFIG_PREEMPTIRQ_EVENTS=y +CONFIG_SERIAL_MSM_GENI_CONSOLE=y +CONFIG_QCOM_RTB=y +CONFIG_QCOM_RTB_SEPARATE_CPUS=y +CONFIG_QCOM_RTB_QGKI=y +CONFIG_DEBUG_CONSOLE_UNHASHED_POINTERS=y +CONFIG_COMMON_CLK_QCOM_DEBUG=y +CONFIG_CNSS2_DEBUG=y +CONFIG_NL80211_TESTMODE=y +CONFIG_EDAC_QCOM_LLCC_PANIC_ON_CE=y +CONFIG_LOCK_TORTURE_TEST=m +CONFIG_RCU_TORTURE_TEST=m +# CONFIG_CDNS_I3C_MASTER is not set +# CONFIG_DW_I3C_MASTER is not set +CONFIG_CORESIGHT_SOURCE_ETM4X=y +# CONFIG_CORESIGHT_CTI_SAVE_DISABLE is not set +CONFIG_MEM_SHARE_QMI_SERVICE=y +CONFIG_MHI_DEBUG=y +CONFIG_SM_DEBUGCC_HOLI=y +CONFIG_DEBUG_PANIC_ON_OOM=y +CONFIG_USB_F_FS_IPC_LOGGING=y +CONFIG_DYNAMIC_DEBUG=y +CONFIG_QTI_PMIC_GLINK_CLIENT_DEBUG=y +# CONFIG_HH_DISABLE_UART is not set +CONFIG_DEBUG_MODULE_LOAD_INFO=y diff --git a/scripts/gki/fragment_motoconfig.sh b/scripts/gki/fragment_motoconfig.sh new file mode 100755 index 000000000000..3143fce77372 --- /dev/null +++ b/scripts/gki/fragment_motoconfig.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# Copyright (c) 2020, Motorola. All rights reserved. + +# Script to merge all Moto kernel config + +usage() { + echo "Usage: $0 $1" + echo "For example: $0 holi $1 qgki_defconfig" + echo "Note: The output is all valid moto kernel config files" + exit 1 +} + +if [ "$#" -ne 2 ]; then + echo "Error: Invalid number of arguments" + usage +fi + +#echo "framgement_moto: TARGET_PRODUCT=${TARGET_PRODUCT} TARGET_BUILD_VARIANT=${TARGET_BUILD_VARIANT}" + +TARGET_PRODUCT_NAME=${TARGET_PRODUCT%%_*} +TARGET_PRODUCT_TYPE=${TARGET_PRODUCT#*_} +LOCAL_PLATFORM_NAME=${1} +REQUIRED_DEFCONFIG=${2} +echo "moto framgement config: LOCAL_PLATFORM_NAME=${LOCAL_PLATFORM_NAME} TARGET_PRODUCT_NAME=$TARGET_PRODUCT_NAME TARGET_PRODUCT_TYPE=$TARGET_PRODUCT_TYPE" + +#skip msi products +if [ $TARGET_PRODUCT_NAME == "msi" ]; then + echo "This is msi, skip moto config fragements" + exit 0 +fi + +MOTO_CONFIG_DIR=$CONFIGS_DIR/ext_config +export MOTO_REQUIRED_CONFIG="" + +# merge factory config or userdebug config +if [ $TARGET_PRODUCT_TYPE == "factory" ]; then + if [ -e $MOTO_CONFIG_DIR/factory-${LOCAL_PLATFORM_NAME}-${TARGET_PRODUCT_NAME}.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/factory-${LOCAL_PLATFORM_NAME}-${TARGET_PRODUCT_NAME}.config" + fi + + if [ -e $MOTO_CONFIG_DIR/factory-${LOCAL_PLATFORM_NAME}.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/factory-${LOCAL_PLATFORM_NAME}.config" + fi +elif [ $TARGET_BUILD_VARIANT == "userdebug" ] && [ $REQUIRED_DEFCONFIG != ${LOCAL_PLATFORM_NAME}-gki_defconfig ]; then + if [ -e $MOTO_CONFIG_DIR/debug-${LOCAL_PLATFORM_NAME}-${TARGET_PRODUCT_NAME}.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/debug-${LOCAL_PLATFORM_NAME}-${TARGET_PRODUCT_NAME}.config" + fi + + if [ -e $MOTO_CONFIG_DIR/debug-${LOCAL_PLATFORM_NAME}.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/debug-${LOCAL_PLATFORM_NAME}.config" + fi + + if [ -e $MOTO_CONFIG_DIR/${LOCAL_PLATFORM_NAME}_debug.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/${LOCAL_PLATFORM_NAME}_debug.config" + if [ -e $MOTO_CONFIG_DIR/${LOCAL_PLATFORM_NAME}_consolidate.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/${LOCAL_PLATFORM_NAME}_consolidate.config" + fi + fi +fi + +#merge moto product config +if [ -e $MOTO_CONFIG_DIR/moto-${LOCAL_PLATFORM_NAME}-${TARGET_PRODUCT_NAME}.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/moto-${LOCAL_PLATFORM_NAME}-${TARGET_PRODUCT_NAME}.config" +fi + +#merge moto platform config +if [ -e $MOTO_CONFIG_DIR/moto-${LOCAL_PLATFORM_NAME}.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/moto-${LOCAL_PLATFORM_NAME}.config" +fi + +#merge moto platform config that depended on -QGKI.config +if [ $REQUIRED_DEFCONFIG != ${LOCAL_PLATFORM_NAME}-gki_defconfig ]; then + if [ -e $MOTO_CONFIG_DIR/moto-${LOCAL_PLATFORM_NAME}-depQGKI.config ]; then + MOTO_REQUIRED_CONFIG+=" $MOTO_CONFIG_DIR/moto-${LOCAL_PLATFORM_NAME}-depQGKI.config" + fi +fi + +echo "require moto blend configs:$MOTO_REQUIRED_CONFIG" diff --git a/scripts/gki/generate_defconfig.sh b/scripts/gki/generate_defconfig.sh index 04f4dff18e6e..a6e3d6eaea58 100755 --- a/scripts/gki/generate_defconfig.sh +++ b/scripts/gki/generate_defconfig.sh @@ -55,6 +55,9 @@ fi FINAL_DEFCONFIG_BLEND="" +source ${SCRIPTS_ROOT}/fragment_motoconfig.sh ${PLATFORM_NAME} ${REQUIRED_DEFCONFIG} +FINAL_DEFCONFIG_BLEND+=${MOTO_REQUIRED_CONFIG} + case "$REQUIRED_DEFCONFIG" in ${PLATFORM_NAME}-qgki-debug_defconfig ) FINAL_DEFCONFIG_BLEND+=" $QCOM_DEBUG_FRAG"