summaryrefslogtreecommitdiff
path: root/scripts/kconfig
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig')
-rwxr-xr-xscripts/kconfig/merge_config.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 0d883b37882a..67653538e322 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
@@ -82,6 +82,14 @@ if [ "$#" -lt 2 ] ; then
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;
@@ -124,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
@@ -150,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"