[Buildroot] [PATCH 3/3] package/mender-grubenv: fix grub module checks
Yann E. MORIN
yann.morin.1998 at free.fr
Sat Dec 4 09:17:50 UTC 2021
Me, All,
On 2021-12-04 00:17 +0100, Yann E. MORIN spake thusly:
> From: Adam Duskett <aduskett at gmail.com>
> Commit b68810e70cbd (boot/grub2: add support to build multiple Grub2
> configurations in the same build) broke mender-grubenv by splititng up
> BR2_TARGET_GRUB2_BUILTIN_MODULES into two separate symbols, one for
> legacy boot and one for EFI boot.
>
> This change causes a systematic build failure now, as the legacy variable
> BR2_TARGET_GRUB2_BUILTIN_MODULES is now always empty (during build).
>
> We fix that by supplicating the missing modules to check: one for EFI and
> one for legacy boot.
>
> The EFI check is tricky: Indeed, there can be more than one EFI platform
> enabled simultaneously; indeed, on x86_64, we can have both the 32-bit
> and 64-bit EFI platforms enabled. So the check is inverted, and we check
> that no platform is not enabled (yeah, double negation). For consistency,
> we do the same for the legacy boot, even though in that case, there can
> only ever be only one enabled at once at most.
>
> Furthermore, mender-grubenv does not support multiple installations of
> grub concurrently; it can only be installed for either legacy or EFI,
> not both at the same time: /etc/mender-grubenv.cfg, its configuration
> file, can only contain settings for one or the other, not both.
>
> So we add a new check to Config.in to support only one grub installation
> type at a time.
>
> Signed-off-by: Adam Duskett <aduskett at gmail.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
> Cc: Köry Maincent <kory.maincent at bootlin.com>
[--SNIP--]
> diff --git a/package/mender-grubenv/Config.in b/package/mender-grubenv/Config.in
> index 38da5b84fe..33d63fbfa3 100644
> --- a/package/mender-grubenv/Config.in
> +++ b/package/mender-grubenv/Config.in
[--SNIP--]
> @@ -34,3 +36,6 @@ comment "mender-grubenv needs a grub2 bootloader"
> depends on BR2_TARGET_GRUB2_ARCH_SUPPORTS
> depends on BR2_PACKAGE_MENDER
> depends on !BR2_TARGET_GRUB2
> +
> +comment "mender-grubenv does not support both legacy and EFI grub2 bootloaders at the same time"
> + depends on BR2_TARGET_GRUB2_HAS_LEGACY_BOOT && BR2_TARGET_GRUB2_HAS_EFI_BOOT
Missing dependency on BR2_PACKAGE_MENDER
> diff --git a/package/mender-grubenv/mender-grubenv.mk b/package/mender-grubenv/mender-grubenv.mk
> index d7bdcc99eb..dd0cf7e4f9 100644
> --- a/package/mender-grubenv/mender-grubenv.mk
> +++ b/package/mender-grubenv/mender-grubenv.mk
> @@ -13,7 +13,7 @@ MENDER_GRUBENV_LICENSE_FILES = LICENSE
> MENDER_GRUBENV_DEPENDENCIES = grub2
> MENDER_GRUBENV_INSTALL_IMAGES = YES
>
> -ifeq ($(BR2_TARGET_GRUB2_I386_PC)$(BR2_TARGET_GRUB2_ARM_UBOOT),y)
> +ifeq ($(BR2_TARGET_GRUB_LEGACY)$(BR2_TARGET_GRUB2_ARM_UBOOT),y)
The ARM U-Boot part is superfluous, now.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
More information about the buildroot
mailing list