Skip to content

Commit 2cd3faf

Browse files
pevikmasahir0y
authored andcommitted
merge_config.sh: Allow to define config prefix
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. Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 3f80bab commit 2cd3faf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/kconfig/merge_config.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ usage() {
3333
echo " -n use allnoconfig instead of alldefconfig"
3434
echo " -r list redundant entries when merging fragments"
3535
echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead."
36+
echo
37+
echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable."
3638
}
3739

3840
RUNMAKE=true
3941
ALLTARGET=alldefconfig
4042
WARNREDUN=false
4143
OUTPUT=.
44+
CONFIG_PREFIX=${CONFIG_-CONFIG_}
4245

4346
while true; do
4447
case $1 in
@@ -99,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then
99102
fi
100103

101104
MERGE_LIST=$*
102-
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
105+
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p"
106+
103107
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
104108

105109
echo "Using $INITFILE as base"

0 commit comments

Comments
 (0)