From 1fbc3bca70f5401a800a8293da34904fca219b7b Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 2 Mar 2026 00:08:18 +0000 Subject: [PATCH] [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 --- src/interface/efi/efi_path.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/interface/efi/efi_path.c b/src/interface/efi/efi_path.c index 38f6f2184..7d7091382 100644 --- a/src/interface/efi/efi_path.c +++ b/src/interface/efi/efi_path.c @@ -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 ) ) {