From f968e1a22d3ed928278a04f0da9124678474ff0a Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Fri, 27 Nov 2015 11:59:32 +0100 Subject: [PATCH] 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 --- ironic/drivers/modules/boot.ipxe | 9 ++++++++- .../notes/boot-ipxe-inc-workaround-548e10d1d6616752.yaml | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/boot-ipxe-inc-workaround-548e10d1d6616752.yaml diff --git a/ironic/drivers/modules/boot.ipxe b/ironic/drivers/modules/boot.ipxe index c2d7f83ea8..aa8ee9e511 100644 --- a/ironic/drivers/modules/boot.ipxe +++ b/ironic/drivers/modules/boot.ipxe @@ -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 diff --git a/releasenotes/notes/boot-ipxe-inc-workaround-548e10d1d6616752.yaml b/releasenotes/notes/boot-ipxe-inc-workaround-548e10d1d6616752.yaml new file mode 100644 index 0000000000..dba277a465 --- /dev/null +++ b/releasenotes/notes/boot-ipxe-inc-workaround-548e10d1d6616752.yaml @@ -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.