From a464cc3c0439bec4055fe48d22c3af3d640935b1 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Fri, 26 Jul 2024 16:41:16 -0600 Subject: [PATCH] Add dhcp retries to embedded iPXE script: This resolves issues when an interface might need some time before the upstream port is forwarding properly or if the firmware is slow, etc. I found this to make a Raspberry PI 4b boot consistently. This was also tested and resolved consistency issues with Cisco ACI switches using LACP configured interfaces. Signed-off-by: Jacob Weinstock --- binary/script/embed.ipxe | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/binary/script/embed.ipxe b/binary/script/embed.ipxe index b2c582b..e84d618 100644 --- a/binary/script/embed.ipxe +++ b/binary/script/embed.ipxe @@ -22,10 +22,22 @@ isset ${net${idx}/ip} && goto interfaces-loop-done || iseq ${idx} 50 && goto aut :interfaces-loop-done echo Booting from net${idx}... -autoboot net${idx} +set retry-max:int32 10 +set count:int32 1 +:retry-loop1 +echo trying dhcp ( attempt ${count}/${retry-max} ) +dhcp net${idx} && goto done1 || iseq ${count} ${retry-max} || inc count && goto retry-loop1 +:done1 +autoboot net${idx} || exit :autoboot -autoboot +set retry-max:int32 10 +set count:int32 1 +:retry-loop2 +echo trying dhcp ( attempt ${count}/${retry-max} ) +dhcp && goto done2 || iseq ${count} ${retry-max} || inc count && goto retry-loop2 +:done2 +autoboot || exit :boot-with-vlan set idx:int32 0