[RFC 0/3] efi_loader: bootmgr itself should support removable media

AKASHI Takahiro takahiro.akashi at linaro.org
Tue Nov 9 02:32:30 CET 2021


# This task is a bit motivated by Simon's discussion about bootflow[1].

Booting UEFI system from removable media is currently supported by
distro_bootcmd script. But the behavior should be best implemented
in UEFI Boot Manager.
(Historically, the boot manager was added later than the support for
removable media boot. So it is a matter of integration.)

Here, "removable media" support means:
  3.5.1.1 Removable Media Boot Behavior
  To generate a file name when none is present in the FilePath,
  the firmware must append a default file name in the form
  \EFI\BOOT\BOOT{machine type short-name}.EFI where machine type
  short-name defines a PE32+ image format architecture.

With this patch set applied, the boot media order can also be defined
by "BooOrder" variable, which the UEFI specification expects.
You can find an example command usage in patch#3.

Please note that this ehnancement improves the compliance to the
specification and that it won't hurt any backward compatibility,
if you don't want to use this feature, as long as a removable-related
script in distro_bootcmd remains unchanged.

The restriction (or drawback?) here is that we need to run all the "scan"
commands before invoking the boot manager.

[1] https://lists.denx.de/pipermail/u-boot/2021-August/458384.html

RFC (Nov 09, 2021)
* initial proposal

AKASHI Takahiro (3):
  efi_loader: export efi_locate_device_handle()
  efi_loader: bootmgr: add booting from removable media
  cmd: efidebug: handle booting from removable media

 cmd/efidebug.c                | 46 +++++++++++++++++++++----
 include/efi_loader.h          |  4 +++
 lib/efi_loader/efi_bootmgr.c  | 65 ++++++++++++++++++++++++++++++++++-
 lib/efi_loader/efi_boottime.c |  7 ++--
 4 files changed, 111 insertions(+), 11 deletions(-)

-- 
2.33.0



More information about the U-Boot mailing list