From bf7ab1e70fd7621fea5dea07b6975c576119b86e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 11 Feb 2017 12:39:54 +0900 Subject: 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 --- scripts/kconfig/merge_config.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'scripts/kconfig/merge_config.sh') 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" -- cgit v1.1