From dababab182d8fb150cc9861d9bc495134f8babb8 Mon Sep 17 00:00:00 2001 From: kuanyu_chen Date: Thu, 17 Dec 2020 11:44:09 +0800 Subject: [PATCH 1/2] Fix manage-config option comparison issue * If the option value of the kconfig-inclusions is a string with double quotes, remove it before value comparison to prevent failure. --- manage-config | 1 + 1 file changed, 1 insertion(+) diff --git a/manage-config b/manage-config index 60a101cdd..42be7f998 100755 --- a/manage-config +++ b/manage-config @@ -108,6 +108,7 @@ if [ -e ${exclusion_file} -o -e ${inclusion_file} ]; then if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then n=${opt%=*} v="${opt#*=}" + v=$(sed -e 's/^"//' -e 's/"$//' <<< "$v") s=$(scripts/config --file ${CONFIG_FILE} -k --state $n) if [ ! "$s" = "$v" ]; then ret=2 From 2ca862fccebddd9ef46a49d07e3d76b6aad8132c Mon Sep 17 00:00:00 2001 From: kuanyu_chen Date: Fri, 18 Dec 2020 10:24:09 +0800 Subject: [PATCH 2/2] Fix manage-config option comparison issue * Use parameter expression to remove the double quotes between the string value instead of using sed * This commit can fix following parsing error Originally, take CONFIG_MODULE_SIG_KEY="debian/certs/test.pem" in kconfig-inclusions for example, it will return error like this. ``` Checking added kernel options... Option CONFIG_MODULE_SIG_KEY should be set to ["debian/certs/test.pem"] instead of [debian/certs/test.pem] ``` If set string type value without quotes, CONFIG_MODULE_SIG_KEY=debian/certs/test.pem, it will also return error like this. ``` Checking added kernel options... Option CONFIG_MODULE_SIG_KEY should be set to [debian/certs/test.pem] instead of [] ``` --- manage-config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manage-config b/manage-config index 42be7f998..7ad253e6a 100755 --- a/manage-config +++ b/manage-config @@ -108,7 +108,9 @@ if [ -e ${exclusion_file} -o -e ${inclusion_file} ]; then if [ ! -z "$opt" ] && [[ ! "$opt" =~ ^#.* ]]; then n=${opt%=*} v="${opt#*=}" - v=$(sed -e 's/^"//' -e 's/"$//' <<< "$v") + # Following two lines are used to remove double quotes between the string value + v="${v%\"}" + v="${v#\"}" s=$(scripts/config --file ${CONFIG_FILE} -k --state $n) if [ ! "$s" = "$v" ]; then ret=2