From ac63c97d08f2f24cad2f503bd020b898caeead5a Mon Sep 17 00:00:00 2001 From: Raghavendra Rao Ananta Date: Mon, 17 Jun 2019 19:30:32 -0700 Subject: [PATCH] scripts: gki: Fix setting of a CONFIG if it's unset in base defconfig CONFIGs that are unset in base defconfig (# CONFIG_X is not set), but gets enabled in fragments through menuconfig, the diff is shown as: -# CONFIG_X is not set. However, for the fragments to work correctly, it must be set to 'y'. Hence, explicitly set them in the config fragments. Change-Id: Ic1c1578fb8109c09f3f39b9d254474d2c341a6d6 Signed-off-by: Raghavendra Rao Ananta --- scripts/gki/fragment_menuconfig.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/gki/fragment_menuconfig.sh b/scripts/gki/fragment_menuconfig.sh index 208fc806f126..25e8cfdecbef 100755 --- a/scripts/gki/fragment_menuconfig.sh +++ b/scripts/gki/fragment_menuconfig.sh @@ -95,6 +95,16 @@ for config_del in $configs_to_remove; do sed -i "/$config_del/d" ${FRAG_CONFIG} done +# CONFIGs that are unset in base defconfig (# CONFIG_X is not set), but enabled in fragments, +# the diff is shown as: -# CONFIG_X is not set. Hence, explicitly set them in the config fragments. +configs_to_set=`diff -u defconfig_base defconfig | grep "^-# CONFIG_" | awk '{print $2}'` +for config_to_set in $configs_to_set; do + # The CONFIG could be set as 'm' in the previous steps. Ignore setting them to 'y' + if ! grep -q "$config_to_set" ${FRAG_CONFIG}; then + echo $config_to_set=y >> ${FRAG_CONFIG} + fi +done + # CONFIGs that are set in base defconfig (or lower fragment), but wanted it to be disabled in FRAG_CONFIG diff -u .config_base .config | grep "^+# CONFIG_" | sed 's/^.//' >> ${FRAG_CONFIG}