Skip to content

Commit

Permalink
Merge pull request #169 from jacobweinstock/dhcp-retries
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jacobweinstock authored Jul 26, 2024
2 parents 3800ec9 + a464cc3 commit d2ea24c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions binary/script/embed.ipxe
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2ea24c

Please sign in to comment.