[Buildroot] [RFC 1/3] support/kconfig/merge_config.sh: merge also buildroot config files

Arnout Vandecappelle arnout at mind.be
Wed Oct 11 21:43:42 UTC 2017



On 10-10-17 22:43, Angelo Compagnucci wrote:
> This patch adds a way to merge buildroot config file programmatically.

 We already do that in test-pkg, without this patch. What are we doing wrong?

> It adds an option (-b, buildroot mode) to manage buildroot config files.

 I wouldn't bother with that option. It's only going to be used for Buildroot
config files (other packages using Kconfig will have a copy of the script
already). So we can just change it directly. And we already have a stack of
changes on the upstream kconfig.

> The buildroot mode changes the way the script looks for configurations
> entries using the BR2_ prefix and modify the call to the make command
> to be buildroot friendly.
> 
> Signed-off-by: Angelo Compagnucci <angelo.compagnucci at gmail.com>
[snip]
> @@ -81,7 +90,7 @@ INITFILE=$1
>  shift;
>  
>  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"

 So here you can just hardcode BR2_

>  TMP_FILE=$(mktemp -t .tmp.config.XXXXXXXXXX)
>  
>  echo "Using $INITFILE as base"
> @@ -131,7 +140,12 @@ 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
> +if [ "$BUILDROOT_MODE" = "false" ]; then
>  make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
> +else
> +cp $TMP_FILE $OUTPUT/.config
> +make $OUTPUT_ARG olddefconfig

 Why is this needed? alldefconfig works fine, no?

> +fi
>  
>  
>  # Check all specified config values took (might have missed-dependency issues)

 Since the kconfig stuff comes from upstream but is modified, we also maintain
the changes as a stack of patches in support/kconfig/patches. So you should
generate a new patch for this change and add it to the series file. I'm not sure
why we don't use a vendor branch and just merge, but that's the way we do it :-).


 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF



More information about the buildroot mailing list