Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts: merge_config: add strict mode to fail upon any redefinition

When merging configuration fragments, it might be of interest to
identify mismatches (redefinitions) programmatically. Hence add the
option -s (strict mode) to instruct merge_config.sh to bail out in
case any redefinition has been detected.

With strict mode, warnings are emitted as before, but the script
terminates with rc=1. If -y is set to define "builtin having
precedence over modules", fragments are still allowed to set =m (while
the base config has =y). Strict mode will tolerate that as demotions
from =y to =m are ignored when setting -y.

Signed-off-by: Matthias Maennich <maennich@google.com>
Reviewed-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Matthias Maennich and committed by
Masahiro Yamada
a325db2d 36a21d51

+15
+15
scripts/kconfig/merge_config.sh
··· 28 28 echo " -r list redundant entries when merging fragments" 29 29 echo " -y make builtin have precedence over modules" 30 30 echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead." 31 + echo " -s strict mode. Fail if the fragment redefines any value." 31 32 echo 32 33 echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable." 33 34 } ··· 38 37 WARNREDUN=false 39 38 BUILTIN=false 40 39 OUTPUT=. 40 + STRICT=false 41 41 CONFIG_PREFIX=${CONFIG_-CONFIG_} 42 42 43 43 while true; do ··· 75 73 exit 1 76 74 fi 77 75 shift 2 76 + continue 77 + ;; 78 + "-s") 79 + STRICT=true 80 + shift 78 81 continue 79 82 ;; 80 83 *) ··· 148 141 echo Previous value: $PREV_VAL 149 142 echo New value: $NEW_VAL 150 143 echo 144 + if [ "$STRICT" = "true" ]; then 145 + STRICT_MODE_VIOLATED=true 146 + fi 151 147 elif [ "$WARNREDUN" = "true" ]; then 152 148 echo Value of $CFG is redundant by fragment $ORIG_MERGE_FILE: 153 149 fi ··· 162 152 done 163 153 cat $MERGE_FILE >> $TMP_FILE 164 154 done 155 + 156 + if [ "$STRICT_MODE_VIOLATED" = "true" ]; then 157 + echo "The fragment redefined a value and strict mode had been passed." 158 + exit 1 159 + fi 165 160 166 161 if [ "$RUNMAKE" = "false" ]; then 167 162 cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG"