Provide a -O option to specify dir to put generated .config
Signed-off-by: Zhangfei Gao zhangfei.gao@linaro.org Tested-by: Jon Medhurst (Tixy) tixy@linaro.org --- scripts/kconfig/merge_config.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index 974d5cb..9ad5744 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -32,11 +32,13 @@ 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" }
MAKE=true ALLTARGET=alldefconfig WARNREDUN=false +OUTPUT=.
while true; do case $1 in @@ -59,6 +61,16 @@ while true; do shift continue ;; + "-O") + if [ -d $2 ];then + OUTPUT=$2 + else + echo "output directory $2 does not exist" 1>&2 + exit 1 + fi + shift 2 + continue + ;; *) break ;; @@ -100,7 +112,7 @@ for MERGE_FILE in $MERGE_LIST ; do done
if [ "$MAKE" = "false" ]; then - cp $TMP_FILE .config + cp $TMP_FILE $OUTPUT/.config echo "#" echo "# merged configuration written to .config (needs make)" echo "#" @@ -111,14 +123,14 @@ fi # Use the merged file as the starting point for: # alldefconfig: Fills in any missing symbols with Kconfig default # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set -make KCONFIG_ALLCONFIG=$TMP_FILE $ALLTARGET +make KCONFIG_ALLCONFIG=$TMP_FILE O=$OUTPUT $ALLTARGET
# Check all specified config values took (might have missed-dependency issues) 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" .config) + ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config) if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then echo "Value requested for $CFG not in final .config" echo "Requested value: $REQUESTED_VAL"
On 11/29/2012 06:04 PM, Zhangfei Gao wrote:
Provide a -O option to specify dir to put generated .config
This looks ok to me, although you might want to add some extra details in the commit log as to why this is useful.
And one minor nit below.
thanks -john
@@ -100,7 +112,7 @@ for MERGE_FILE in $MERGE_LIST ; do done
if [ "$MAKE" = "false" ]; then
- cp $TMP_FILE .config
- cp $TMP_FILE $OUTPUT/.config echo "#" echo "# merged configuration written to .config (needs make)"
Should this echo have $output/.config?
thanks -john
On 12-11-30 11:13 AM, John Stultz wrote:
On 11/29/2012 06:04 PM, Zhangfei Gao wrote:
Provide a -O option to specify dir to put generated .config
This looks ok to me, although you might want to add some extra details in the commit log as to why this is useful.
Thanks John for the quick review, will add more details.
And one minor nit below.
thanks -john
@@ -100,7 +112,7 @@ for MERGE_FILE in $MERGE_LIST ; do done
if [ "$MAKE" = "false" ]; then
- cp $TMP_FILE .config
- cp $TMP_FILE $OUTPUT/.config echo "#" echo "# merged configuration written to .config (needs make)"
Should this echo have $output/.config?
There may be different message output for O=dir and O=dir/. So for simplicity just use .config here, or we need add parse the dir has '/' or not. For example using sed 's/[/ \t]*$//'. Which one you prefer.
thanks -john
Provide a -O option to specify dir to put generated .config Then merge_config.sh does not need to be copied to target dir, for easy re-usage in other script
Signed-off-by: Zhangfei Gao zhangfei.gao@linaro.org Tested-by: Jon Medhurst (Tixy) tixy@linaro.org --- scripts/kconfig/merge_config.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index 974d5cb..05274fc 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -32,11 +32,13 @@ 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" }
MAKE=true ALLTARGET=alldefconfig WARNREDUN=false +OUTPUT=.
while true; do case $1 in @@ -59,6 +61,16 @@ while true; do shift continue ;; + "-O") + if [ -d $2 ];then + OUTPUT=$(echo $2 | sed 's//*$//') + else + echo "output directory $2 does not exist" 1>&2 + exit 1 + fi + shift 2 + continue + ;; *) break ;; @@ -100,9 +112,9 @@ for MERGE_FILE in $MERGE_LIST ; do done
if [ "$MAKE" = "false" ]; then - cp $TMP_FILE .config + cp $TMP_FILE $OUTPUT/.config echo "#" - echo "# merged configuration written to .config (needs make)" + echo "# merged configuration written to $OUTPUT/.config (needs make)" echo "#" clean_up exit @@ -111,14 +123,14 @@ fi # Use the merged file as the starting point for: # alldefconfig: Fills in any missing symbols with Kconfig default # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set -make KCONFIG_ALLCONFIG=$TMP_FILE $ALLTARGET +make KCONFIG_ALLCONFIG=$TMP_FILE O=$OUTPUT $ALLTARGET
# Check all specified config values took (might have missed-dependency issues) 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" .config) + ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config) if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then echo "Value requested for $CFG not in final .config" echo "Requested value: $REQUESTED_VAL"
On 12/02/2012 11:36 PM, Zhangfei Gao wrote:
Provide a -O option to specify dir to put generated .config Then merge_config.sh does not need to be copied to target dir, for easy re-usage in other script
Signed-off-by: Zhangfei Gao zhangfei.gao@linaro.org Tested-by: Jon Medhurst (Tixy) tixy@linaro.org
Acked-by: John Stultz john.stultz@linaro.org
thanks -john
On Mon, Dec 03, 2012 at 09:05:26AM -0800, John Stultz wrote:
On 12/02/2012 11:36 PM, Zhangfei Gao wrote:
Provide a -O option to specify dir to put generated .config Then merge_config.sh does not need to be copied to target dir, for easy re-usage in other script
Signed-off-by: Zhangfei Gao zhangfei.gao@linaro.org Tested-by: Jon Medhurst (Tixy) tixy@linaro.org
Acked-by: John Stultz john.stultz@linaro.org
Applied to kbuild.git#kconfig, thanks.
Michal
On 10 December 2012 01:22, Michal Marek mmarek@suse.cz wrote:
On Mon, Dec 03, 2012 at 09:05:26AM -0800, John Stultz wrote:
On 12/02/2012 11:36 PM, Zhangfei Gao wrote:
Provide a -O option to specify dir to put generated .config Then merge_config.sh does not need to be copied to target dir, for easy re-usage in other script
Signed-off-by: Zhangfei Gao zhangfei.gao@linaro.org Tested-by: Jon Medhurst (Tixy) tixy@linaro.org
Acked-by: John Stultz john.stultz@linaro.org
Applied to kbuild.git#kconfig, thanks.
Michal
Thanks Michal and John.
On 12/10/2012 06:51 PM, Zhangfei Gao wrote:
On 10 December 2012 01:22, Michal Marek <mmarek@suse.cz mailto:mmarek@suse.cz> wrote:
On Mon, Dec 03, 2012 at 09:05:26AM -0800, John Stultz wrote: > On 12/02/2012 11:36 PM, Zhangfei Gao wrote: >> Provide a -O option to specify dir to put generated .config >> Then merge_config.sh does not need to be copied to target dir, >> for easy re-usage in other script >> >> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org <mailto:zhangfei.gao@linaro.org>> >> Tested-by: Jon Medhurst (Tixy) <tixy@linaro.org <mailto:tixy@linaro.org>> > Acked-by: John Stultz <john.stultz@linaro.org <mailto:john.stultz@linaro.org>> Applied to kbuild.git#kconfig, thanks. Michal
Thanks Michal and John.
This patch has also been included into linux-linaro-core-tracking tree [1], the llct-20121210.0 tag.
Thanks, Andrey
[1] http://git.linaro.org/gitweb?p=kernel/linux-linaro-tracking.git%3Ba=summary , linux-linaro-core-tracking branch