summaryrefslogtreecommitdiff
path: root/scripts/kconfig/merge_config.sh
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-02-11 03:39:54 (GMT)
committerTom Rini <trini@konsulko.com>2017-02-12 19:31:25 (GMT)
commitbf7ab1e70fd7621fea5dea07b6975c576119b86e (patch)
tree8d857c342799d9d75d704fd87ea29e42ce0454b6 /scripts/kconfig/merge_config.sh
parent554c73c0256c9e22af1b89e842a310b73b5eb657 (diff)
downloadu-boot-bf7ab1e70fd7621fea5dea07b6975c576119b86e.tar.xz
kconfig: re-sync with Linux 4.10
Re-sync all files under the scripts/kconfig directory with Linux 4.10. Some parts include U-Boot own modification. I made sure to not revert the following commits: 5b8031ccb4ed ("Add more SPDX-License-Identifier tags") 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.") da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags") 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig/merge_config.sh')
-rwxr-xr-xscripts/kconfig/merge_config.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index ec8e203..67d1314 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -32,7 +32,7 @@ usage() {
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"
- echo " -O dir to put generated output files"
+ echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead."
}
RUNMAKE=true
@@ -77,11 +77,19 @@ while true; do
esac
done
-if [ "$#" -lt 2 ] ; then
+if [ "$#" -lt 1 ] ; then
usage
exit
fi
+if [ -z "$KCONFIG_CONFIG" ]; then
+ if [ "$OUTPUT" != . ]; then
+ KCONFIG_CONFIG=$(readlink -m -- "$OUTPUT/.config")
+ else
+ KCONFIG_CONFIG=.config
+ fi
+fi
+
INITFILE=$1
shift;
@@ -100,6 +108,10 @@ cat $INITFILE > $TMP_FILE
# Merge files, printing warnings on overridden values
for MERGE_FILE in $MERGE_LIST ; do
echo "Merging $MERGE_FILE"
+ if [ ! -r "$MERGE_FILE" ]; then
+ echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2
+ exit 1
+ fi
CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
for CFG in $CFG_LIST ; do
@@ -120,9 +132,9 @@ for MERGE_FILE in $MERGE_LIST ; do
done
if [ "$RUNMAKE" = "false" ]; then
- cp $TMP_FILE $OUTPUT/.config
+ cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG"
echo "#"
- echo "# merged configuration written to $OUTPUT/.config (needs make)"
+ echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
echo "#"
clean_up
exit
@@ -146,7 +158,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
- ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config)
+ ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG")
if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
echo "Value requested for $CFG not in final .config"
echo "Requested value: $REQUESTED_VAL"