Attempt to upgrade iPXE if no mac found

Apparently older iPXE implementations that may be burned into
ROMs may not recognize the template MAC syntax, and thus be unable to
boot.

In the event of this happening, we should attempt to chainload the
iPXE image.

Additionally removed autofree as this may not be recognized by
some versions of iPXE.

Change-Id: I6e458d6a9383fb2d31d743b0124384a2036520df
This commit is contained in:
Julia Kreger 2015-06-18 21:07:07 -04:00
parent 16c19775ad
commit 32121c073e
3 changed files with 13 additions and 1 deletions

View File

@ -1,7 +1,11 @@
#!ipxe
isset ${mac:hexhyp} && goto boot_system ||
chain ipxe.pxe
# load the MAC-specific file or fail if it's not found
chain --autofree pxelinux.cfg/${mac:hexraw} || goto error_no_config
:boot_system
chain pxelinux.cfg/${mac:hexhyp} || goto error_no_config
:error_no_config
echo PXE boot failed. No configuration found for MAC ${mac}

View File

@ -37,6 +37,11 @@
copy: src=xinetd.tftp dest=/etc/xinetd.d/tftp
- name: "Copy iPXE image into place"
copy: src={{ ipxe_dir }}/undionly.kpxe dest=/tftpboot/
# NOTE(TheJulia): Copy full iPXE chain loader images in case they are required.
- name: "Copy full iPXE image into /httpboot"
copy: src={{ ipxe_dir }}/ipxe.pxe dest=/httpboot/
- name: "Copy full iPXE image into /tftpboot"
copy: src={{ ipxe_dir }}/ipxe.pxe dest=/tftpboot/
# Similar logic to below can be utilized to retrieve files
- name: "Determine if folder exists, else create and populate folder."
stat: path=/tftpboot/master_images

View File

@ -433,6 +433,9 @@ dhcp-range={{dhcp_pool_start}},{{dhcp_pool_end}},12h
# Boot for Etherboot gPXE. The idea is to send two different
# filenames, the first loads gPXE, and the second tells gPXE what to
# load. The dhcp-match sets the gpxe tag for requests from gPXE.
dhcp-userclass=set:gpxe,"gPXE"
dhcp-boot=tag:gpxe,ipxe.pxe
dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
dhcp-boot=tag:!ipxe,undionly.kpxe
{% if testing %}