[Buildroot] [PATCH v3 2/7] boot/grub2: add support to build multiple Grub2 configurations in the same build

Köry Maincent kory.maincent at bootlin.com
Thu Oct 7 08:23:18 UTC 2021


On Wed, 6 Oct 2021 20:11:04 +0200
"Yann E. MORIN" <yann.morin.1998 at free.fr> wrote:

> Köry, All,
> 
> On 2021-09-23 17:57 +0200, Kory Maincent spake thusly:
> [--SNIP--]
> > We can no longer use autotools-package as a consequence of this
> > multi-build, and we have to resort to generic-package and a partial
> > duplication of the autotools-infra. Grub2 was already using custom option
> > like --prefix or --exec-prefix so this won't add much more weirdness.  
> 
> But this had an unfortunate side effect: the grub2 tools, like
> grub-editenv, enabled with BR2_TARGET_GRUB2_INSTALL_TOOLS, are no
> longer installed in the target now.

Doh, didn't thought of that!
 
> But generic-package has no default install command, so declaring that
> the package installs in target does nothing.
> 
> I see two options:
> 
>  1. provide a custom command for one of the enabled platforms; e.g.
>     arbitrarily choose the first in the tuple and install in target
>     from that one tuple
> 
>  2. revert to using an autotools package, but build for no platform at
>     all and just install the tools. For the platforms, move the current
>     foreach loops into post-build and post-install-image hooks
> 
> Care to look into that, please?

mmh that's tricky, because in the case we want to use the Grub modules it need
to be generated for each platforms.
For example we can face a case where we will have these three Grub modules
repositories for each platform:
target/lib/grub/i386-pc/
target/lib/grub/i386-efi/
target/lib/grub/x86_64-efi/

What about just adding the "make install" command in the foreach loop?
This will overwrite the binaries, the locale and the /etc configurations for
each "make" loop but we will have all the Grub modules repositories. I don't
think the overwrites will cause issues because it is just tools.

Regards,

Köry


More information about the buildroot mailing list