Pxe boot forward with UEFI support

@db0west , @landers-robert et al (i.e. to anyone else landing here from search)

I just want to follow up here with some clarity and a message of success:

Why am I here?

  • It’s 2020 and you tried following along with this guide about PXE-booting nodes via MAAS without MAAS DHCP (perhaps because, like me, you found your need-to-be-commissioned nodes picking up DHCP addresses from your router at home before MAAS DHCP could snag them)
  • AND…
  • You’re now seeing this error/notice on your PXE-booted nodes that are running hardware from a non-legacy era (because hey - UEFI, consumer-grade hardware, 2020, etc. etc.):

PXELINUX 6.xx lwIP copyright H. Peter Anvin et al
Unable to locate configuration file

I want to fix this. What do I need?

  • MAAS-host’s IP address (e.g. 10.0.1.42)
  • Router stuff:
    – SSH access to your router enabled
    – JFFS “permanent storage” enabled (see an example for Merlin WRT)
    – JFFS “user scripts” enabled/allowed
  • Motherboard / hardware-node stuff:
    – Ensure your motherboard’s PXE-boot policy is set to “UEFI”
    – In my case (ASRock B450M), this was found in the “CSM” section on the “Boot” menu (end-user example)

What do I need to do?

  • Via SSH, log in to your router (same un/pw you use via UI; e.g. ssh user@10.0.0.1)
  • For ASUS Merlin WRT, you’ll likely land in /tmp/home/root#
  • Execute the following commands:
cd /
nano jffs/configs/dnsmasq.conf.add
  • Add and save the following content dnsmasq.conf.add (replace 10.0.1.42 with your MAAS-host’s IP):
dhcp-boot=pxelinux.0,,10.0.1.42
dhcp-match=set:efi-x86_64,option:client-arch,9
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-boot=tag:efi-x86_64,bootx64.efi,,10.0.1.42
  • Restart dnsmasq service
service restart_dnsmasq

What the heck did I just do?

  • By default, most routers that facilitate SSH access to the router will only stow what you do in that session, well… in that session
  • To get your changes to persist, it is also common for routers that facilitate this type of interaction to also provide a way to “add” what you want atop the existing implementations
  • By creating the file dnsmasq.conf.add in root’s jffs/configs directory, you’re making it possible for your additions to persist (and apply) after events like a setting change on your router, a reboot of the router, etc.
  • You may have noticed the second , in some of those lines (e.g. pxelinux.0,,10.0.1.42). The commas are a delimeter. But what is that second command… delimiting? There’s nothing there. That’s exactly right; by adding that second comma, you’re conveying that you acknowledge that a hostname for the TFTP server/host is not supplied (and thus, ignored/skipped), favoring the IP address of the TFTP server instead (in this case, “TFTP Server” = MAAS)
  • In order to get your changes to apply immediately, in context of the steps above, you restarted the dnsmasq service

Now, you can leave the DHCP and DNS to your actual router and simply define a reserved range in MAAS (without MAAS DHCP enabled). Nice.

NOTE: At least in our case, there sometimes is a bit of a snag (“Unable to locate configuration file”)

1 Like