I’ve recently been asked by people using gpxelinux.0 how they can build it with the newer iPXE instead of the stagnant gPXE. ipxelinux.0 is basically iPXE with an embedded boot script that starts an embedded version of pxelinux.0.
Then install the required dependencies using your distribution’s packaging tools. Chances are high you already have everything you need installed except git.
# On Ubuntu or Debian-based systems this should work sudo apt-get install build-essential binutils perl git nasm
#!/bin/sh git clone git://git.ipxe.org/ipxe.git git clone git://git.kernel.org/pub/scm/boot/syslinux/syslinux.git
Next up is to build
pxelinux.0, which is part of syslinux, so we can embed it into iPXE:
cd syslinux make
Verify that the file named
core/pxelinux.0 exists and is approx. 26KB. Then you should change directory to the ipxe checkout and create a file named
ipxelinux.ipxe with this content:
#!ipxe dhcp chain pxelinux.0
Finally we can build a chainloadable version of iPXE with the above script and pxelinux.0 embedded:
cd src make bin/undionly.kkkpxe EMBED=../ipxelinux.ipxe,../../syslinux/core/pxelinux.0
The last thing to do is to install it onto your TFTP server.
sudo install -v -m 0644 -g root -o root bin/undionly.kkkpxe /srv/tftp/ipxelinux.0
If you haven’t already set up your ISC DHCP server for network booting, make sure you include this snippet in your subnet declaration. If you already have an entry for pxelinux.0 in there, you can just rename the file. The file name is not magical and can be anything you like. Calling it something.0 is just a convention.
next-server 22.214.171.124; filename "ipxelinux.0";
I also want to tell you that iPXE has had a text-based menu system since March 2012, so if you’re not too invested in your PXELINUX setup, you might want to look into how things can be done without PXELINUX. Take a look at the iPXE menu documentation and my iPXE menu example that shows the menu I use in my home network.
If this made you curious, please join us on #ipxe on irc.freenode.net to learn more.