diff options
author | Tom Rini <trini@konsulko.com> | 2023-11-18 15:52:53 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-18 15:52:53 -0500 |
commit | 9e4b42267e1fb5805ecddbb92629f456d8cd4047 (patch) | |
tree | 55418a14399a744ee648c997eeb1b3fdb3fb5ef4 /lib/efi_loader/efi_disk.c | |
parent | ae7ec8b0be41b59ef323f7531c0fe6745e8fef45 (diff) | |
parent | c022eed4bedf2e16e737fde22b03289d2a48cb27 (diff) |
Merge tag 'efi-next-18112023' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next
EFI HTTP Boot is currently supported by using a combination of
wget, blkmap and bootefi commands. The user has to download the
image, mount it using blkmap and then execute the efi installer
using bootefi.
This series simplifies the user experience. Instead of doing all the
steps manually, users can now enable a new Kconfig (EFI_HTTP_BOOT)
which will select wget, blkmap and dns options. They can then use
efidebug command to add a boot option for the EFI Bootmanager using
=> efidebug boot add -u 3 netinst http://<path>
=> efidebug boot order 3
=> bootefi bootmgr
The boot manager will automatically download and mount the image.
Once it's mounted it will locate and launch the installer.
It's worth noting that this rarely fails, but the reason is irrelevant
to the current patchset. More information can be found here
https://lore.kernel.org/u-boot/CAOMZO5CoduEgwgdQiybmoKh6qQZOezUtRRQO4ecaGdZBBz5dDw@mail.gmail.c
om/
The tl;dr is that wget sometimes fails to download the file correctly
or set the size env variables. We expect all these to be solved once
LWIP is stable and pulled
Diffstat (limited to 'lib/efi_loader/efi_disk.c')
-rw-r--r-- | lib/efi_loader/efi_disk.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index f0d76113b00..b808a7fe627 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -690,6 +690,13 @@ int efi_disk_probe(void *ctx, struct event *event) return -1; } + /* only do the boot option management when UEFI sub-system is initialized */ + if (IS_ENABLED(CONFIG_CMD_BOOTEFI_BOOTMGR) && efi_obj_list_initialized == EFI_SUCCESS) { + ret = efi_bootmgr_update_media_device_boot_option(); + if (ret != EFI_SUCCESS) + return -1; + } + return 0; } @@ -742,6 +749,17 @@ int efi_disk_remove(void *ctx, struct event *event) dev_tag_del(dev, DM_TAG_EFI); return 0; + + /* + * TODO A flag to distinguish below 2 different scenarios of this + * function call is needed: + * a) Unplugging of a removable media under U-Boot + * b) U-Boot exiting and booting an OS + * In case of scenario a), efi_bootmgr_update_media_device_boot_option() + * needs to be invoked here to update the boot options and remove the + * unnecessary ones. + */ + } /** |