[PATCH] scripts: merge_config.sh: support include directives in fragments

Julien Stephan jstephan at baylibre.com
Thu Mar 19 17:49:35 CET 2026


Le jeu. 19 mars 2026 à 17:21, Tom Rini <trini at konsulko.com> a écrit :
>
> On Thu, Mar 19, 2026 at 05:14:05PM +0100, Julien Stephan wrote:
>
> > Many defconfig files rely on include directives to factor out common
> > configuration. When running "make some_board_defconfig", these files are
> > preprocessed and the includes are resolved automatically. However,
> > merge_config.sh script currently does not handle include directives in
> > configuration fragments.
> >
> > Add a preprocessing step to resolve include directives in all fragments
> > before merging them.
> >
> > By default, the include search path consists of:
> >   - the current working directory
> >   - the fragment's directory
> >   - the default U-Boot configs/ directory
> >
> > This ensures that existing defconfig files work out of the box. Additional
> > include directories can be specified using the -I option:
> >
> >   ./scripts/kconfig/merge_config.sh -I <additional include dir>  configs/some_board_defconfig frag1.cfg frag2.cfg
> >
> > Signed-off-by: Julien Stephan <jstephan at baylibre.com>
> > ---
> >  scripts/kconfig/merge_config.sh | 56 +++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 51 insertions(+), 5 deletions(-)
>
> This forks us from the upstream version of the script, and I don't think
> upstream will want this.

I understand. Would that help if I submit this to the kernel first?
and see their reaction?

>
> When I make use of this locally I do a two step:
> - make foo_defconfig savedefconfig
> - merge_config.sh defconfig frag1 ... fragN
>

That works well for defconfig inside configs/ but if you manage some
configs outside of u-boot and they have include it won't work.

> So, I am hesistant to start with to change this tool more.
>
> --
> Tom


More information about the U-Boot mailing list