summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2022-09-12 17:33:54 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-09-14 08:43:32 +0200
commitc416f1c0bcab87179661b367e469e51f35bd1841 (patch)
tree6726880fc8688317436dcfd255a1763ea98ff5f8 /include
parentbb8498aad676dbb7c4d29ceee6e8f8f4dfef9b57 (diff)
downloadu-boot-c416f1c0bcab87179661b367e469e51f35bd1841.tar.gz
u-boot-c416f1c0bcab87179661b367e469e51f35bd1841.tar.bz2
u-boot-c416f1c0bcab87179661b367e469e51f35bd1841.zip
bootmenu: add removable media entries
UEFI specification requires booting from removal media using a architecture-specific default image name such as BOOTAA64.EFI. This commit adds the removable media entries into bootmenu, so that user can select the removable media and boot with default image. The bootmenu automatically enumerates the possible bootable media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, add it as new UEFI boot option(BOOT####) and update BootOrder variable. This automatically generated UEFI boot option has the dedicated guid in the optional_data to distinguish it from the UEFI boot option user adds manually. This optional_data is removed when the efi bootmgr loads the selected UEFI boot option. This commit also provides the BOOT#### variable maintenance feature. Depending on the system hardware setup, some devices may not exist at a later system boot, so bootmenu checks the available device in each bootmenu invocation and automatically removes the BOOT#### variable corrensponding to the non-existent media device. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/efi_config.h1
-rw-r--r--include/efi_loader.h16
2 files changed, 17 insertions, 0 deletions
diff --git a/include/efi_config.h b/include/efi_config.h
index dddffe045e..098cac2115 100644
--- a/include/efi_config.h
+++ b/include/efi_config.h
@@ -93,5 +93,6 @@ efi_status_t eficonfig_select_file_handler(void *data);
efi_status_t eficonfig_get_unused_bootoption(u16 *buf,
efi_uintn_t buf_size, u32 *index);
efi_status_t eficonfig_append_bootorder(u16 index);
+efi_status_t eficonfig_generate_media_device_boot_option(void);
#endif
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 4461f721e0..6b63ae8dde 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -953,6 +953,22 @@ struct efi_signature_store {
struct x509_certificate;
struct pkcs7_message;
+/**
+ * struct eficonfig_media_boot_option - boot option for (removable) media device
+ *
+ * This structure is used to enumerate possible boot option
+ *
+ * @lo: Serialized load option data
+ * @size: Size of serialized load option data
+ * @exist: Flag to indicate the load option already exists
+ * in Non-volatile load option
+ */
+struct eficonfig_media_boot_option {
+ void *lo;
+ efi_uintn_t size;
+ bool exist;
+};
+
bool efi_hash_regions(struct image_region *regs, int count,
void **hash, const char *hash_algo, int *len);
bool efi_signature_lookup_digest(struct efi_image_regions *regs,