From e9206c900f7fd5f3023b020dad23c50b795ad5d9 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 17 Nov 2022 08:20:46 -0800 Subject: [PATCH 1/2] Fix setting a config with an already-existing conflicting value Fix setting a config value in kconfig-inclusions when there's already a conflicting existing value in defconfig. For example, setting CONFIG_SYSTEM_TRUSTED_KEYS would have no effect, because there would already be a setting for this specified by Debian's default config. With this, it _might_ be possible to remove the need for kconfig-force-inclusions, but that still needs to be checked. Signed-off-by: Saikrishna Arcot --- manage-config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manage-config b/manage-config index b5de5c99a..499d5c9c7 100755 --- a/manage-config +++ b/manage-config @@ -79,7 +79,9 @@ if [ -e ${exclusion_file} -o -e ${inclusion_file} -o -e ${force_inclusion_file} inclusion_opts=$(get_section_opts ${inclusion_file} "common" ${ARCH} ${PLATFORM}) while read -r opt; do if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then - echo $opt >> ${CONFIG_FILE} + n=${opt%=*} + v="${opt#*=}" + scripts/config --file ${CONFIG_FILE} -k --set-val "$n" "$v" fi done <<< ${inclusion_opts}; fi From 7f8d898437e37456a8c591171b90eec4cfcce017 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 17 Nov 2022 08:33:16 -0800 Subject: [PATCH 2/2] Support verifying the value of strings (and not just y/m/n settings) Becuase of kpatch-inclusions having quotes around the string, but the value from `scripts/config` having the quotes stripped, the comparison fails due to one side having quotes but the other side not having quotes. This effectively adds support for setting string kconfigs in kconfig-inclusion. Signed-off-by: Saikrishna Arcot --- manage-config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manage-config b/manage-config index 499d5c9c7..e3570db75 100755 --- a/manage-config +++ b/manage-config @@ -115,6 +115,8 @@ if [ -e ${exclusion_file} -o -e ${inclusion_file} -o -e ${force_inclusion_file} if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then n=${opt%=*} v="${opt#*=}" + v="${v/#\"/}" + v="${v/%\"/}" s=$(scripts/config --file ${CONFIG_FILE} -k --state $n) if [ ! "$s" = "$v" ]; then ret=2