[efi] Automatically open network device matching loaded image device path

It is unintuitive to have to include an "ifopen" at the start of an
autoexec.ipxe script.  Commit efe8126 ("[cachedhcp] Automatically open
network device matching cached DHCPACK") causes the chainloaded device
to be opened automatically, using the cached DHCPACK to identify the
chainloaded device.

In the case of a UEFI HTTP(S) boot, the firmware does not provide
access to the DHCPACK and we are forced to instead extract the very
limited amount of information encoded into the loaded image's device
path.

Mark the device matching the loaded image's device path to be opened
automatically, so that the chainloaded device will be opened in the
same way for both TFTP and HTTP(S) boots.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2026-03-02 00:08:18 +00:00
parent a69afd7435
commit 1fbc3bca70

View File

@ -1120,6 +1120,9 @@ static int efi_path_net_probe ( struct net_device *netdev, void *priv ) {
return 0;
}
/* Mark network device to be opened automatically */
netdev->state |= NETDEV_AUTO_OPEN;
/* Never override a real DHCP settings block */
if ( find_child_settings ( netdev_settings ( netdev ),
DHCP_SETTINGS_NAME ) ) {