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 efi_loader: git ignore helloworld_efi.S 2020-01-07 18:08:20 +01:00
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: Correct address handling with ACPI tables 2022-01-25 11:44:36 -07:00
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 doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
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_loader: Get rid of kaslr-seed if EFI_RNG_PROTOCOL is installed 2022-01-15 10:57:22 +01:00
efi_esrt.c efi_loader: use %pUs for printing GUIDs 2022-01-19 16:16:33 +01:00
efi_file.c efi_loader: correct function comment style 2022-01-29 10:23:40 +01:00
efi_firmware.c FMP: Remove GUIDs for FIT and raw images 2022-04-15 10:43:18 +02:00
efi_freestanding.c efi_loader: correct function comment style 2022-01-29 10:23:40 +01:00
efi_gop.c efi_loader: correct function comment style 2022-01-29 10:23:40 +01:00
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_loader: use %pUs for printing GUIDs 2022-01-19 16:16:33 +01:00
efi_image_loader.c efi_loader: copy GUID in InstallProtocolInterface() 2022-03-12 12:27:07 +01:00
efi_load_initrd.c efi_loader: avoid multiple local copies of lf2_initrd_guid 2021-10-21 03:46:04 +02:00
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_loader: fix use after free in receive path 2020-10-19 22:59:53 +02:00
efi_riscv.c efi_loader: Enable RISCV_EFI_BOOT_PROTOCOL support 2022-01-29 10:23:40 +01:00
efi_rng.c efi_loader: use %pUs for printing GUIDs 2022-01-19 16:16:33 +01:00
efi_root_node.c efi_loader: remove EFI_UNICODE_COLLATION_PROTOCOL 2021-01-20 08:17:17 +01:00
efi_runtime.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
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 doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
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_loader: carve out utf_to_cp() 2021-03-07 17:37:13 +01:00
efi_var_common.c efi: Use 16-bit unicode strings 2022-02-03 12:16:01 -05:00
efi_var_file.c efi_loader: don't load Shim's MOK database from file 2021-10-21 03:46:04 +02:00
efi_var_mem.c efi_loader: treat UEFI variable name as const 2021-10-25 21:13:06 +02:00
efi_var_seed.S efi_loader: pre-seed UEFI variables 2020-07-16 12:37:02 +02:00
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