Skip to content

Commit d2ea24c

Browse files
Merge pull request #169 from jacobweinstock/dhcp-retries
Add dhcp retries to embedded iPXE script: ## Description <!--- Please describe what this PR is going to change --> 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. ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 3800ec9 + a464cc3 commit d2ea24c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

binary/script/embed.ipxe

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,22 @@ isset ${net${idx}/ip} && goto interfaces-loop-done || iseq ${idx} 50 && goto aut
2222

2323
:interfaces-loop-done
2424
echo Booting from net${idx}...
25-
autoboot net${idx}
25+
set retry-max:int32 10
26+
set count:int32 1
27+
:retry-loop1
28+
echo trying dhcp ( attempt ${count}/${retry-max} )
29+
dhcp net${idx} && goto done1 || iseq ${count} ${retry-max} || inc count && goto retry-loop1
30+
:done1
31+
autoboot net${idx} || exit
2632

2733
:autoboot
28-
autoboot
34+
set retry-max:int32 10
35+
set count:int32 1
36+
:retry-loop2
37+
echo trying dhcp ( attempt ${count}/${retry-max} )
38+
dhcp && goto done2 || iseq ${count} ${retry-max} || inc count && goto retry-loop2
39+
:done2
40+
autoboot || exit
2941

3042
:boot-with-vlan
3143
set idx:int32 0

0 commit comments

Comments
 (0)