aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/merge_config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/merge_config.sh')
-rwxr-xr-x[-rw-r--r--]scripts/kconfig/merge_config.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index ceadf0e150cf..974d5cb7e30a 100644..100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -31,10 +31,12 @@ usage() {
echo " -h display this help text"
echo " -m only merge the fragments, do not execute the make command"
echo " -n use allnoconfig instead of alldefconfig"
+ echo " -r list redundant entries when merging fragments"
}
MAKE=true
ALLTARGET=alldefconfig
+WARNREDUN=false
while true; do
case $1 in
@@ -52,18 +54,27 @@ while true; do
usage
exit
;;
+ "-r")
+ WARNREDUN=true
+ shift
+ continue
+ ;;
*)
break
;;
esac
done
-
+INITFILE=$1
+shift;
MERGE_LIST=$*
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
+echo "Using $INITFILE as base"
+cat $INITFILE > $TMP_FILE
+
# Merge files, printing warnings on overrided values
for MERGE_FILE in $MERGE_LIST ; do
echo "Merging $MERGE_FILE"
@@ -79,6 +90,8 @@ for MERGE_FILE in $MERGE_LIST ; do
echo Previous value: $PREV_VAL
echo New value: $NEW_VAL
echo
+ elif [ "$WARNREDUN" = "true" ]; then
+ echo Value of $CFG is redundant by fragment $MERGE_FILE:
fi
sed -i "/$CFG[ =]/d" $TMP_FILE
fi