[PATCH 1/1] boot: BOOTMETH_DISTRO should select BOOTMETH_EFI_BOOTMGR

Simon Glass sjg at chromium.org
Sun May 25 21:45:41 CEST 2025


Hi Heinrich,

On Wed, 23 Apr 2025 at 14:02, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> On 23.04.25 14:28, Simon Glass wrote:
> > Hi Heinrich,
> >
> > On Mon, 21 Apr 2025 at 03:43, Heinrich Schuchardt
> > <heinrich.schuchardt at canonical.com> wrote:
> >>
> >> Distros expect the EFI boot manager to run. It falls back to launching
> >> EFI\BOOT\BOOT<ARCH>.EFI from the ESP.
> >>
> >> BOOTMETH_EFILOADER is obsolete.
> >>
> >> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> >> ---
> >>   boot/Kconfig | 5 ++++-
> >>   1 file changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/boot/Kconfig b/boot/Kconfig
> >> index fb37d912bc9..89076220adb 100644
> >> --- a/boot/Kconfig
> >> +++ b/boot/Kconfig
> >> @@ -597,6 +597,9 @@ config BOOTMETH_EFILOADER
> >>          imply CMD_TFTPBOOT if CMD_NET
> >>          default y
> >>          help
> >> +         This bootmeth is obsolete. BOOTMETH_EFI_BOOTMGR takes care of
> >> +         launching EFI\BOOT\BOOT<ARCH>.EFI if no boot option matches.
> >> +
> >>            Enables support for EFI boot using bootdevs. This makes the
> >>            bootdevs look for a 'boot<arch>.efi' on each filesystem
> >>            they scan. The resulting file is booted after enabling U-Boot's
> >> @@ -648,7 +651,7 @@ config BOOTMETH_DISTRO
> >>          select BOOTMETH_SCRIPT if CMDLINE # E.g. Armbian uses scripts
> >>          select BOOTMETH_EXTLINUX  # E.g. Debian uses these
> >>          select BOOTMETH_EXTLINUX_PXE if CMD_PXE && CMD_NET && DM_ETH
> >> -       select BOOTMETH_EFILOADER if EFI_BINARY_EXEC # E.g. Ubuntu uses this
> >> +       select BOOTMETH_EFI_BOOTMGR if EFI_BINARY_EXEC # E.g. Ubuntu uses this
> >>
> >>   config SPL_BOOTMETH_VBE
> >>          bool "Bootdev support for Verified Boot for Embedded (SPL)"
> >> --
> >> 2.48.1
> >>
> >
> > I don't want to make this bootmeth obsolete. What is the motivation for that?
>
> This method was written in a way that per se violates the UEFI
> specification as it does not set up required UEFI variables.
>
> You must never run this before the boot manager as booting
> EFI/BOOT/BOOT<ARCH>.EFI if there is a boot option violates the UEFI
> specification-
>
> The boot manager covers the functionality of this bootmeth.

I'm OK with the workaround we discussed, but this seems to go beyond
that. Can you do this without disabling this bootmeth? Or is there
some other clever way to keep things working as they do today?

I know we've discussed this before, but is there really no way to know
whether a board is using bootmgr? That would make things much easier.
Perhaps we should just disable the default for bootmgr and then let
boards enable it as needed? I think we discussed that too, but it
seemed it caused other issues? Perhaps we could add an environment
variable that gets checked?

Regards,
Simon


More information about the U-Boot mailing list