The EFI boot manager relies on having an IP address before trying to
boot an EFI HTTP(s) boot entry. However, defining it as a boot or
pre-boot command is not always the right answer since it will
unconditionally add delay to the board boot, even if we don't boot
over the network.
So let's do a DHCP request from the boot manager, if 'ipaddr' is
empty and fail early if we don't have an address.
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
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");