u-boot/lib/efi_loader
AKASHI Takahiro 4e65ca00f3 efi_loader: bootmgr: add booting from removable media
Under the current implementation, booting from removable media using
a architecture-specific default image name, say BOOTAA64.EFI, is
supported only in distro_bootcmd script. See the commit 74522c898b
("efi_loader: Add distro boot script for removable media").

This is, however, half-baked implementation because
1) UEFI specification requires this feature to be implemented as part
   of Boot Manager's responsibility:

  3 - Boot Manager
  3.5.1 Boot via the Simple File Protocol
  When booting via the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, the FilePath will
  start with a device path that points to the device that implements the
  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL or the EFI_BLOCK_IO_PROTOCOL. The next
  part of the FilePath may point to the file name, including
  subdirectories, which contain the bootable image. If the file name is
  a null device path, the file name must be generated from the rules
  defined below.
  ...
  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 ...

2) So (1) entails the hehavior that the user's preference of boot media
   order should be determined by Boot#### and BootOrder variables.

With this patch, the semantics mentioned above is fully implemented.
For example, if you want to boot the system from USB and SCSI in this
order,
* define Boot0001 which contains only a device path to the USB device
  (without any file path/name)
* define Boot0002 which contains only a device path to the SCSI device,
and
* set BootOrder to Boot0001:Boot0002

To avoid build error for sandbox, default file name "BOOTSANDBOX.efi"
is defined even if it is out of scope of UEFI specification.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
On sandbox use binary name corresponding to host architecture.
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-05-03 21:39:22 +02:00
..
.gitignore
dtbdump.c efi_loader: move dtbdump.c, initrddump.c to lib/efi_loader 2022-03-20 17:01:00 +01:00
efi_acpi.c
efi_bootmgr.c efi_loader: bootmgr: add booting from removable media 2022-05-03 21:39:22 +02:00
efi_boottime.c efi_loader: export efi_locate_device_handle() 2022-05-03 21:39:22 +02:00
efi_capsule.c capsule: Put a check for image index before the update 2022-04-15 10:43:18 +02:00
efi_console.c efi_loader: reset colors before clearing screen 2022-05-03 21:39:22 +02:00
efi_device_path.c efi_loader: PARTITION_UUIDS should be optional 2022-04-23 22:05:34 +02:00
efi_device_path_to_text.c efi_loader: fix text output for Uart() DP nodes 2022-02-05 20:20:01 +01:00
efi_device_path_utilities.c
efi_disk.c efi_loader: disk: allow blk devices even without UCLASS_PARTITION 2022-04-29 14:25:40 +02:00
efi_dt_fixup.c
efi_esrt.c
efi_file.c
efi_firmware.c FMP: Remove GUIDs for FIT and raw images 2022-04-15 10:43:18 +02:00
efi_freestanding.c
efi_gop.c
efi_helper.c efi: Use 16-bit unicode strings 2022-02-03 12:16:01 -05:00
efi_hii.c efi_loader: EFI_HII_STRING_PROTOCOL.GetString() 2022-04-15 11:26:21 +02:00
efi_hii_config.c
efi_image_loader.c efi_loader: copy GUID in InstallProtocolInterface() 2022-03-12 12:27:07 +01:00
efi_load_initrd.c
efi_load_options.c efi_loader: simplify efi_serialize_load_option() 2022-04-15 11:26:21 +02:00
efi_memory.c efi_loader: simplify efi_add_conventional_memory_map() 2022-04-29 14:25:39 +02:00
efi_net.c
efi_riscv.c
efi_rng.c
efi_root_node.c
efi_runtime.c
efi_setup.c efi_loader: disk: a helper function to create efi_disk objects from udevice 2022-04-23 22:05:41 +02:00
efi_signature.c efi_loader: fix uefi secure boot with intermediate certs 2022-02-26 07:37:00 +01:00
efi_smbios.c
efi_string.c efi: Use 16-bit unicode strings 2022-02-03 12:16:01 -05:00
efi_tcg2.c efi: Use 16-bit unicode strings 2022-02-03 12:16:01 -05:00
efi_unicode_collation.c
efi_var_common.c efi: Use 16-bit unicode strings 2022-02-03 12:16:01 -05:00
efi_var_file.c
efi_var_mem.c
efi_var_seed.S
efi_variable.c efi: Use 16-bit unicode strings 2022-02-03 12:16:01 -05:00
efi_variable_tee.c efi_loader: Set variable attributes when EFI_BUFFER_TOO_SMALL is returned 2022-03-20 11:03:06 +01:00
efi_watchdog.c efi_loader: update the timing of enabling and disabling EFI watchdog 2022-02-26 07:37:01 +01:00
helloworld.c efi: Use 16-bit unicode strings 2022-02-03 12:16:01 -05:00
initrddump.c efi_loader: initrddump: drain input before prompt 2022-03-26 07:46:21 +01:00
Kconfig lib: fix selection of CONFIG_CHARSET 2022-05-03 21:39:22 +02:00
Makefile efi_loader: disk: compile efi_disk when CONFIG_BLK 2022-04-23 22:05:34 +02:00