Skip to content

Commit

Permalink
bootstd: Make efi_mgr bootmeth work for non-sandbox setups
Browse files Browse the repository at this point in the history
Enable the bootflow based on this bootmeth if the BootOrder EFI
variable is set.

Signed-off-by: Mark Kettenis <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
  • Loading branch information
kettenis authored and trini committed Nov 1, 2023
1 parent 073bf4a commit f2bfa0c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion boot/bootmeth_efi_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit f2bfa0c

Please sign in to comment.