diff mbox series

[v2,1/1] merge_config.sh: Allow to define config prefix

Message ID 20181029211058.7062-1-petr.vorel@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/1] merge_config.sh: Allow to define config prefix | expand

Commit Message

Petr Vorel Oct. 29, 2018, 9:10 p.m. UTC
with CONFIG_ environment variable.

merge_config.sh uses CONFIG_ which is used in kernel and other projects.
There are some projects which use kconfig with different prefixes (e.g.
buildroot: BR2_ prefix). CONFIG_ variable is already used for this
purpose in kconfig binary (scripts/kconfig/lkc.h), let's use the same
rule for in merge_config.sh.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 scripts/kconfig/merge_config.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Masahiro Yamada Oct. 30, 2018, 4 p.m. UTC | #1
On Tue, Oct 30, 2018 at 6:11 AM Petr Vorel <petr.vorel@gmail.com> wrote:
>
> with CONFIG_ environment variable.
>
> merge_config.sh uses CONFIG_ which is used in kernel and other projects.
> There are some projects which use kconfig with different prefixes (e.g.
> buildroot: BR2_ prefix). CONFIG_ variable is already used for this
> purpose in kconfig binary (scripts/kconfig/lkc.h), let's use the same
> rule for in merge_config.sh.
>
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to linux-kbuild. Thanks!



>  scripts/kconfig/merge_config.sh | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index 67d131447631..7067a9fe0fa3 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -26,6 +26,8 @@ clean_up() {
>  }
>  trap clean_up HUP INT TERM
>
> +CONFIG_PREFIX=${CONFIG_-CONFIG_}
> +
>  usage() {
>         echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
>         echo "  -h    display this help text"
> @@ -33,6 +35,8 @@ usage() {
>         echo "  -n    use allnoconfig instead of alldefconfig"
>         echo "  -r    list redundant entries when merging fragments"
>         echo "  -O    dir to put generated output files.  Consider setting \$KCONFIG_CONFIG instead."
> +       echo
> +       echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable."
>  }
>
>  RUNMAKE=true
> @@ -99,7 +103,8 @@ if [ ! -r "$INITFILE" ]; then
>  fi
>
>  MERGE_LIST=$*
> -SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
> +SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p"
> +
>  TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
>
>  echo "Using $INITFILE as base"
> --
> 2.19.1
>
diff mbox series

Patch

diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 67d131447631..7067a9fe0fa3 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -26,6 +26,8 @@  clean_up() {
 }
 trap clean_up HUP INT TERM
 
+CONFIG_PREFIX=${CONFIG_-CONFIG_}
+
 usage() {
 	echo "Usage: $0 [OPTIONS] [CONFIG [...]]"
 	echo "  -h    display this help text"
@@ -33,6 +35,8 @@  usage() {
 	echo "  -n    use allnoconfig instead of alldefconfig"
 	echo "  -r    list redundant entries when merging fragments"
 	echo "  -O    dir to put generated output files.  Consider setting \$KCONFIG_CONFIG instead."
+	echo
+	echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable."
 }
 
 RUNMAKE=true
@@ -99,7 +103,8 @@  if [ ! -r "$INITFILE" ]; then
 fi
 
 MERGE_LIST=$*
-SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
+SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p"
+
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
 
 echo "Using $INITFILE as base"