diff options
author | Gabriel de Perthuis <g2p.code@gmail.com> | 2015-10-14 10:04:20 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.com> | 2015-10-14 10:19:33 -0400 |
commit | ed94fea5ba78d03808576f14745d8e59126489bd (patch) | |
tree | 9ec83afc486ff9fb200d5e0f9c1abae6a811c82b /scripts | |
parent | d1b0dc90abdb3487a8b60ac7c843708f98ff409a (diff) |
kconfig/merge_config.sh: Support KCONFIG_CONFIG
All make targets support $KCONFIG_CONFIG because they
run scripts/kconf. Make sure merge_config.sh accesses the
correct file in all cases.
Previously this script broke in two different code paths,
one for targets like kvmconfig (which use merge_config.sh -m
then call a target that respects KCONFIG_CONFIG) and one for
direct use of the script without -m, which called make rules
that edit KCONFIG_CONFIG but verified a different file.
Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kconfig/merge_config.sh | 16 |
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() { | |||
32 | echo " -m only merge the fragments, do not execute the make command" | 32 | echo " -m only merge the fragments, do not execute the make command" |
33 | echo " -n use allnoconfig instead of alldefconfig" | 33 | echo " -n use allnoconfig instead of alldefconfig" |
34 | echo " -r list redundant entries when merging fragments" | 34 | echo " -r list redundant entries when merging fragments" |
35 | echo " -O dir to put generated output files" | 35 | echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead." |
36 | } | 36 | } |
37 | 37 | ||
38 | RUNMAKE=true | 38 | RUNMAKE=true |
@@ -82,6 +82,14 @@ if [ "$#" -lt 2 ] ; then | |||
82 | exit | 82 | exit |
83 | fi | 83 | fi |
84 | 84 | ||
85 | if [ -z "$KCONFIG_CONFIG" ]; then | ||
86 | if [ "$OUTPUT" != . ]; then | ||
87 | KCONFIG_CONFIG=$(readlink -m -- "$OUTPUT/.config") | ||
88 | else | ||
89 | KCONFIG_CONFIG=.config | ||
90 | fi | ||
91 | fi | ||
92 | |||
85 | INITFILE=$1 | 93 | INITFILE=$1 |
86 | shift; | 94 | shift; |
87 | 95 | ||
@@ -124,9 +132,9 @@ for MERGE_FILE in $MERGE_LIST ; do | |||
124 | done | 132 | done |
125 | 133 | ||
126 | if [ "$RUNMAKE" = "false" ]; then | 134 | if [ "$RUNMAKE" = "false" ]; then |
127 | cp $TMP_FILE $OUTPUT/.config | 135 | cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG" |
128 | echo "#" | 136 | echo "#" |
129 | echo "# merged configuration written to $OUTPUT/.config (needs make)" | 137 | echo "# merged configuration written to $KCONFIG_CONFIG (needs make)" |
130 | echo "#" | 138 | echo "#" |
131 | clean_up | 139 | clean_up |
132 | exit | 140 | exit |
@@ -150,7 +158,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET | |||
150 | for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do | 158 | for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do |
151 | 159 | ||
152 | REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) | 160 | REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) |
153 | ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config) | 161 | ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG") |
154 | if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then | 162 | if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then |
155 | echo "Value requested for $CFG not in final .config" | 163 | echo "Value requested for $CFG not in final .config" |
156 | echo "Requested value: $REQUESTED_VAL" | 164 | echo "Requested value: $REQUESTED_VAL" |