Re: [PATCH] bootstd: Make efi_mgr bootmeth work for non-sandbox setups

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Jul 14 22:21:04 CEST 2023



Am 14. Juli 2023 21:56:02 MESZ schrieb Mark Kettenis <kettenis at openbsd.org>:
>Enable the bootflow based on this bootmeth if the BootOrder EFI
>variable is set.
>
>Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
>---
> boot/bootmeth_efi_mgr.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
>diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c
>index e9d973429f..db650861ff 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,21 @@ 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_uintn_t size;
>+	u16 *bootorder;
> 
> 	if (priv->fake_dev) {
> 		bflow->state = BOOTFLOWST_READY;
> 		return 0;
> 	}
> 
>-	/* To be implemented */
>+	/* Enable this method if the "BootOrder" UEFI exists. */
>+	bootorder = efi_get_var(u"BootOrder", &efi_global_variable_guid,
>+				&size);

Are EFI variables already loaded when you hit this code?

Even if the variable Boot Order is not set we must boot EFI/BOOT/BOOT????.EFI.

Best regards

Heinrich 



>+	if (bootorder) {
>+		bflow->state = BOOTFLOWST_READY;
>+		return 0;
>+	}
> 
> 	return -EINVAL;
> }


More information about the U-Boot mailing list