Simon Glass <s...@chromium.org> schrieb am Sa., 3. Mai 2025, 23:26:

> HI Heinrich,
>
> On Sat, 3 May 2025 at 01:04, Heinrich Schuchardt
> <heinrich.schucha...@canonical.com> wrote:
> >
> >
> >
> > Simon Glass <s...@chromium.org> schrieb am Sa., 3. Mai 2025, 04:10:
> >>
> >> Hi Heinrich,
> >>
> >> On Fri, 2 May 2025 at 10:09, Heinrich Schuchardt
> >> <heinrich.schucha...@canonical.com> wrote:
> >> >
> >> > On 5/2/25 16:49, Simon Glass wrote:
> >> > > Hi Heinrich,
> >> > >
> >> > > On Mon, 21 Apr 2025 at 10:26, Heinrich Schuchardt
> >> > > <heinrich.schucha...@canonical.com> wrote:
> >> > >>
> >> > >> The EFI boot manager bootmeth does not require variable BootOrder
> to be
> >> > >> preexisting. It creates this variable.
> >> > >>
> >> > >> Signed-off-by: Heinrich Schuchardt <
> heinrich.schucha...@canonical.com>
> >> > >> ---
> >> > >>   boot/bootmeth_efi_mgr.c | 21 +++------------------
> >> > >>   1 file changed, 3 insertions(+), 18 deletions(-)
> >> > >>
> >> > >> diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c
> >> > >> index 42b8863815e..1669cbed5bd 100644
> >> > >> --- a/boot/bootmeth_efi_mgr.c
> >> > >> +++ b/boot/bootmeth_efi_mgr.c
> >> > >> @@ -47,30 +47,15 @@ static int efi_mgr_check(struct udevice *dev,
> struct bootflow_iter *iter)
> >> > >>
> >> > >>   static int efi_mgr_read_bootflow(struct udevice *dev, struct
> bootflow *bflow)
> >> > >>   {
> >> > >> -       struct efi_mgr_priv *priv = dev_get_priv(dev);
> >> > >> -       efi_status_t ret;
> >> > >> -       efi_uintn_t size;
> >> > >> -       u16 *bootorder;
> >> > >> -
> >> > >> -       if (priv->fake_dev) {
> >> > >> -               bflow->state = BOOTFLOWST_READY;
> >> > >> -               return 0;
> >> > >> -       }
> >> > >> +       int ret
> >> > >>
> >> > >>          ret = efi_init_obj_list();
> >> > >>          if (ret)
> >> > >>                  return log_msg_ret("init", ret);
> >> > >>
> >> > >> -       /* Enable this method if the "BootOrder" UEFI exists. */
> >> > >> -       bootorder = efi_get_var(u"BootOrder",
> &efi_global_variable_guid,
> >> > >> -                               &size);
> >> > >> -       if (bootorder) {
> >> > >> -               free(bootorder);
> >> > >> -               bflow->state = BOOTFLOWST_READY;
> >> > >> -               return 0;
> >> > >> -       }
> >> > >> +       bflow->state = BOOTFLOWST_READY;
> >> > >>
> >> > >> -       return -EINVAL;
> >> > >> +       return 0;
> >> > >>   }
> >> > >>
> >> > >>   static int efi_mgr_read_file(struct udevice *dev, struct
> bootflow *bflow,
> >> > >> --
> >> > >> 2.48.1
> >> > >>
> >> > >
> >> > > How do we know if the board is using EFI bootmgr? My understanding
> was
> >> > > that this was a way to find out?
> >> >
> >> > The boot manager must always run.
> >>
> >> Are you sure that is true? It seems false to me, e.g.
> >>
> >> - if we are booting FEL on suxi, it must not run.
> >> - none of the boards in my lab use it
> >> - the Ubuntu 24.04 test in my lab doesn't use it
> >>
> >> So how can we say that it must always run?
> >
> >
> > If a boot method that is earlier in the sequence boots the boot manager
> will not be reached. But the existence of BootOrder or any other EFI
> variable shall not decide if the boot manager runs or not.
>
> So is there *any* way to know whether it should run or not? Should we
> use the Kconfig to control it?


We already have a Kconfig variable for the bootmeth. If that is chosen and
FEL, script, extlinux fail the boot manager should run.

It feels like disappearing into the
> abyss when we run bootmgr, at present.


All boot methods may fail to find anything to boot. The EFI boot manager is
not special in that regard.

Best regards

Heinrich

I'm wondering if we can improve
> this.
>
> Regards,
> Simon
>

Reply via email to