diff options
| author | Adriano Cordova <[email protected]> | 2024-12-04 00:05:23 -0300 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2024-12-04 12:24:37 +0100 |
| commit | e55a4acb54e807c6411c4f6ab914fa2b3f55784e (patch) | |
| tree | ef9154333c7481e99569aefebd71b4dcfab51ffa /net | |
| parent | 4b0723004b65bfaab528ce3aa669eb552e06130a (diff) | |
efi_loader: net: set EFI bootdevice device path to HTTP when loaded from wget
Set the device path of the efi boot device to an HTTP device path
(as formed by efi_dp_from_http) when the next boot stage is loaded
using wget (i.e., when wget is used with wget_info.set_bootdev=1).
When loaded from HTTP, the device path should account for it so that
the next boot stage is aware (e.g. grub only loads its http stack if
it itself was loaded from http, and it checks this from its device path).
Signed-off-by: Adriano Cordova <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'net')
| -rw-r--r-- | net/lwip/wget.c | 5 | ||||
| -rw-r--r-- | net/wget.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/net/lwip/wget.c b/net/lwip/wget.c index 669eded0f38..c23f0640ec6 100644 --- a/net/lwip/wget.c +++ b/net/lwip/wget.c @@ -260,10 +260,9 @@ static void httpc_result_cb(void *arg, httpc_result_t httpc_result, printf("%u bytes transferred in %lu ms (", rx_content_len, elapsed); print_size(rx_content_len / elapsed * 1000, "/s)\n"); printf("Bytes transferred = %lu (%lx hex)\n", ctx->size, ctx->size); - if (wget_info->set_bootdev) { - efi_set_bootdev("Net", "", ctx->path, map_sysmem(ctx->saved_daddr, 0), + if (wget_info->set_bootdev) + efi_set_bootdev("Http", ctx->server_name, ctx->path, map_sysmem(ctx->saved_daddr, 0), rx_content_len); - } wget_lwip_set_file_size(rx_content_len); if (env_set_hex("filesize", rx_content_len) || env_set_hex("fileaddr", ctx->saved_daddr)) { diff --git a/net/wget.c b/net/wget.c index f3b43b06b8b..d338eaf4ef3 100644 --- a/net/wget.c +++ b/net/wget.c @@ -447,7 +447,7 @@ static void wget_handler(uchar *pkt, u16 dport, net_set_state(wget_loop_state); wget_info->file_size = net_boot_file_size; if (wget_info->method == WGET_HTTP_METHOD_GET && wget_info->set_bootdev) { - efi_set_bootdev("Net", "", image_url, + efi_set_bootdev("Http", NULL, image_url, map_sysmem(image_load_addr, 0), net_boot_file_size); env_set_hex("filesize", net_boot_file_size); |
