Pavlo Shchelokovskyy 687a16bd75 Convert iPXE boot script to Jinja template
This will not affect those using custom out-of-tree boot scripts,
as such files will be rendered as-is.

This patch also moves template rendering to a common place and sets
create_pxe_config to use it.

Change-Id: Ie5c94fee26054a209d35a25a99f3e9f57bd39d14
Partial-Bug: #1526275
2016-11-21 18:44:38 +02:00

25 lines
777 B
Plaintext

#!ipxe
# NOTE(lucasagomes): Loop over all network devices and boot from
# the first one capable of booting. For more information see:
# https://bugs.launchpad.net/ironic/+bug/1504482
set netid:int32 -1
:loop
inc netid || chain {{ ipxe_for_mac_uri }}${mac:hexhyp} || goto old_rom
isset ${net${netid}/mac} || goto loop_done
echo Attempting to boot from MAC ${net${netid}/mac:hexhyp}
chain {{ ipxe_for_mac_uri }}${net${netid}/mac:hexhyp} || goto loop
:loop_done
echo PXE boot failed! No configuration found for any of the present NICs.
echo Press any key to reboot...
prompt --timeout 180
reboot
:old_rom
echo PXE boot failed! No configuration found for NIC ${mac:hexhyp}.
echo Please update your iPXE ROM and retry.
echo Press any key to reboot...
prompt --timeout 180
reboot