summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_bootmgr.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-05-25 09:14:07 -0600
committerTom Rini <trini@konsulko.com>2025-05-25 09:14:07 -0600
commit92da174fc6367c6398bda9950b40598f57bd43da (patch)
tree245cf5035b0e115368d2eb0df6a2a38dc5100e66 /lib/efi_loader/efi_bootmgr.c
parentdf2ed552f0b05591090369a7fe7ddc92439dea5c (diff)
parentf8949b1d1d0d4dc4d5abb458c59e831b9e2a0dca (diff)
Merge tag 'efi-2025-07-rc3-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2025-07-rc3-3 CI: * https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/26313 UEFI: * run dhcp if an http boot option is selected * separate device path into its own header and add it to the API docs * rename END to EFI_DP_END * make x86 SMBIOS tables usable in the EFI context
Diffstat (limited to 'lib/efi_loader/efi_bootmgr.c')
-rw-r--r--lib/efi_loader/efi_bootmgr.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index c0df5cb9acd..1a3461f5a9d 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -12,6 +12,7 @@
#include <charset.h>
#include <dm.h>
#include <efi.h>
+#include <efi_device_path.h>
#include <log.h>
#include <malloc.h>
#include <net.h>
@@ -479,6 +480,13 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp,
if (!ctx)
return EFI_OUT_OF_RESOURCES;
+ s = env_get("ipaddr");
+ if (!s && dhcp_run(0, NULL, false)) {
+ log_err("Error: Can't find a valid IP address\n");
+ ret = EFI_DEVICE_ERROR;
+ goto err;
+ }
+
s = env_get("loadaddr");
if (!s) {
log_err("Error: loadaddr is not set\n");
@@ -527,7 +535,7 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp,
* will be freed in return_to_efibootmgr event callback.
*/
loaded_dp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
- (uintptr_t)image_addr, image_size);
+ image_addr, image_size);
ret = efi_install_multiple_protocol_interfaces(
&mem_handle, &efi_guid_device_path, loaded_dp, NULL);
if (ret != EFI_SUCCESS)
@@ -855,7 +863,8 @@ efi_bootmgr_enumerate_boot_options(struct eficonfig_media_boot_option *opt,
lo.label = dev_name;
lo.attributes = LOAD_OPTION_ACTIVE;
lo.file_path = device_path;
- lo.file_path_length = efi_dp_size(device_path) + sizeof(END);
+ lo.file_path_length = efi_dp_size(device_path) +
+ sizeof(EFI_DP_END);
/*
* Set the dedicated guid to optional_data, it is used to identify
* the boot option that automatically generated by the bootmenu.