network boot without a proper DHCP setup for PXE - 08 Jun 2011


I needed an alternative to the slickness of a network-wide PXE setup. Router DHCPd doesn't allow for modifications. If you can stand to throw in a bootable usb or floppy, then the following might work for you.

1) Make your existing tftp directory accessible over HTTP and said HTTP server should be able to run php scripts. I currently have nginx and lighttpd's spawn-fcgi being overseen by supervisor, very similar to Setting up PHP5/FastCGI with nginx.

2) Throw up a php script in the same directory where your pxelinux.0 is located. Check out my example ipxe_boot.php. Check the GDoc comments for using TFTP if you experience freeze-up problems when booting a VM like I did or as described in VMware/VirtualBox is freezing when loading a kernel/initrd.

3) Create a custom .ipxe boot script for adding into your iPXE boot image. For more on scripting with iPXE; also take a look at my current custom.ipxe script.

4) Grab a copy of the source code from the download/build info page and build it with your custom .ipxe file attached.

git clone git://git.ipxe.org/ipxe.git
cd ipxe/src

Bootable floopy disk:

make bin/ipxe.dsk EMBEDDED_IMAGE=../../custom.ipxe
cat bin/ipxe.dsk > /dev/fd0

Bootable usb PXE replacement:

make bin/ipxe.usb EMBEDDED_IMAGE=../../custom.ipxe
dd if=bin/ipxe.usb of=/dev/sdb

Do be sure that your usb drive is actually /dev/sdb!

231 words. Post tags: iPXE.

Post content is written by Jason Zerbe and licensed CC BY-NC 3.0.