diff options
author | Tom Rini <trini@konsulko.com> | 2023-11-01 12:52:32 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-01 12:52:32 -0400 |
commit | 46ff7dd09653e9fb32440fcafb59d54096a1ff52 (patch) | |
tree | 2dde0f46bd882ebe4aeba8b033972ff19b932343 /boot/bootmeth_efi_mgr.c | |
parent | a803f87202aa48974bdff4d8100464a8288931e4 (diff) | |
parent | a831d1137845732db68ac80edf15bfe4a68d0c8f (diff) |
Merge branch '2023-11-01-bootstd-fixes'
- Four patches to address issues with bootstd flows in some cases
Diffstat (limited to 'boot/bootmeth_efi_mgr.c')
-rw-r--r-- | boot/bootmeth_efi_mgr.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c index e9d973429f..e6c42d41fb 100644 --- a/boot/bootmeth_efi_mgr.c +++ b/boot/bootmeth_efi_mgr.c @@ -14,6 +14,8 @@ #include <bootmeth.h> #include <command.h> #include <dm.h> +#include <efi_loader.h> +#include <efi_variable.h> /** * struct efi_mgr_priv - private info for the efi-mgr driver @@ -46,13 +48,26 @@ 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; } - /* To be implemented */ + 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) { + bflow->state = BOOTFLOWST_READY; + return 0; + } return -EINVAL; } |