diff --git a/binary/script/build_and_pr.sh b/binary/script/build_and_pr.sh index b0dc9c2..671fa9b 100755 --- a/binary/script/build_and_pr.sh +++ b/binary/script/build_and_pr.sh @@ -70,7 +70,7 @@ function build_iPXE() { # build iPXE echo "Building iPXE" top_level_dir="$(git rev-parse --show-toplevel)" - if ! (cd "${top_level_dir}"; nix-shell "${top_level_dir}/binary/script/shell.nix" --run 'make binary'); then + if ! (cd "${top_level_dir}"; nix-shell "${top_level_dir}/binary/script/shell.nix" --run 'make VERSION=2.0+ binary'); then echo "Failed to build iPXE" 1>&2 exit 1 fi diff --git a/binary/script/embed.ipxe b/binary/script/embed.ipxe index b2c582b..b93a7ce 100644 --- a/binary/script/embed.ipxe +++ b/binary/script/embed.ipxe @@ -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