Fall back to old boot.ipxe behaviour if inc command is not found

We introduced looping over all NIC's as on older iPXE ROM's ${mac} variable
does not always point to the PXE-booting NIC. However, CentOS/RHEL ship
even older iPXE ROM that does not even have inc command at all.

This patch restores the old behaviour of relying on ${mac} variable when
inc command cannot be executed. It's still not perfect and might break
sometimes, but it won't be completely broken. Nothing is changes for users
for which inc command is already working.

Change-Id: I30b8c0e4ab076684ea9baa042e5a9a4f44da9a3a
Closes-Bug: #1507738
This commit is contained in:
Dmitry Tantsur 2015-11-27 11:59:32 +01:00
parent 09550ff1a4
commit f968e1a22d
2 changed files with 13 additions and 1 deletions

View File

@ -5,7 +5,7 @@
# https://bugs.launchpad.net/ironic/+bug/1504482
set netid:int32 -1
:loop
inc netid
inc netid || chain pxelinux.cfg/${mac:hexhyp} || goto old_rom
isset ${net${netid}/mac} || goto loop_done
echo Attempting to boot from MAC ${net${netid}/mac:hexhyp}
chain pxelinux.cfg/${net${netid}/mac:hexhyp} || goto loop
@ -15,3 +15,10 @@ 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

View File

@ -0,0 +1,5 @@
---
fixes:
- Make boot.ipxe fallback to its previous behavior on *really* old iPXE
ROMs where 'inc' command is not available at all, see
https://launchpad.net/bugs/1507738.