forked from tinkerbell/ipxedust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
7 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,13 @@ | ||
#!ipxe | ||
|
||
set user-class Tinkerbell | ||
echo Welcome to Neverland! | ||
echo Welcome to the workaround iPXE | ||
|
||
# Allow the operator to drop to a shell | ||
prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell || | ||
dhcp | ||
|
||
# Random string to enable binary patching | ||
#a8b7e61f1075c37a793f2f92cee89f7bba00c4a8d7842ce3d40b5889032d8881 | ||
#ddd16a4fc4926ecefdfb6941e33c44ed3647133638f5e84021ea44d3152e7f97 | ||
|
||
# This is possible because the DHCP options from the original vendor PXE DHCP request | ||
# are available to chainloaded iPXE binaries. See https://github.com/ipxe/ipxe/issues/188 | ||
set vlan-id ${43.116:string} | ||
isset ${vlan-id} && goto boot-with-vlan || | ||
|
||
:iterate-interfaces | ||
set idx:int32 0 | ||
:interfaces-loop | ||
isset ${net${idx}/ip} && goto interfaces-loop-done || iseq ${idx} 50 && goto autoboot || inc idx && goto interfaces-loop | ||
|
||
:interfaces-loop-done | ||
echo Booting from net${idx}... | ||
autoboot net${idx} | ||
|
||
:autoboot | ||
autoboot | ||
|
||
:boot-with-vlan | ||
set idx:int32 0 | ||
# Find the interface that is configured with an IP, this will be the iPXE auto created vlan interface. | ||
:loop isset ${net${idx}-${vlan-id}/ip} && goto loop_done || | ||
iseq ${idx} 50 && goto error || | ||
inc idx && goto loop | ||
|
||
:loop_done | ||
echo Booting from net${idx}-${vlan-id}... | ||
autoboot net${idx}-${vlan-id} | ||
|
||
:error | ||
echo Failed to find the vlan interface | ||
set conn_type https | ||
chain --autofree https://boot.netboot.xyz/menu.ipxe || echo HTTPS failed... attempting HTTP... | ||
set conn_type http | ||
chain --autofree http://boot.netboot.xyz/menu.ipxe || echo HTTP failed, dropping to a shell... | ||
shell |