Skip to contentSkip to conversation

boot: call dhcp_run in pxe bootmethod

PATCH In review Heiko Stuebner 2 participants 2 messages Apr 2, 2025 – Apr 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot: call dhcp_run in pxe bootmethod

A recent change tried to speed up EFI booting by not calling dhcp_run from eth_bootdev_hunt() every time. PXE so far relied on that dhcp_run call to get an IP address.

Fix that by adding a dhcp_run call to the pxe bootflow, with autoload disabled to only get the ip address and nothing else.

Fixes 1f68057e0320 ("net: eth_bootdev_hunt() should not run DHCP")

---
This also seems to work, to fix the dhcp problem.

So this is the counter-idea to the revert submitted in
https://lore.kernel.org/u-boot/[email protected]/

Only this one or the revert patch should be applied.

 boot/bootmeth_pxe.c | 4 ++++
 1 file changed, 4 insertions(+)
boot/bootmeth_pxe.c +4 -0
index b91e61bcbc4..6e5e0f99ea4 100644
@@ -73,6 +73,10 @@ static int extlinux_pxe_read_bootflow(struct udevice *dev,
 		return log_msg_ret("pxeb", -EPERM);
 	addr = simple_strtoul(addr_str, NULL, 16);
 
+	ret = dhcp_run(addr, NULL, false);
+	if (ret)
+		return log_msg_ret("dhc", ret);
+
 	log_debug("calling pxe_get()\n");
 	ret = pxe_get(addr, &bootdir, &size, false);
 	log_debug("pxe_get() returned %d\n", ret);
Signature · 1 line
2.47.2
#1 lore raw
Quoted 8 lines · Heiko Stuebner

A recent change tried to speed up EFI booting by not calling dhcp_run from eth_bootdev_hunt() every time. PXE so far relied on that dhcp_run call to get an IP address.

Fix that by adding a dhcp_run call to the pxe bootflow, with autoload disabled to only get the ip address and nothing else.

[...]

Applied to u-boot/master, thanks!

[1/1] boot: call dhcp_run in pxe bootmethod

      commit: 1915fdcc21268c0f5df513461e3ddbb03a26f3c5
Signature · 1 line
Tom