cd /usr/src/
git clone git://git.ipxe.org/ipxe.git
cd /tftpboot
tar xvzf ipxe.tgz
cd ipxe
./embed_script.sh


# The following goes someplace in your ISC dhcpd.conf:

if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
	# enter your TFTP server here
	next-server 192.168.x.y;
	# many PXE ROM's out there use overlapping/default GUIDs in DHCP :-(
	ignore-client-uids true;

	# this is what UEFI x86_64 should look like
	if option architecture-type = 00:09 {
		filename "ipxe/ipxe.efi";
	}

	# this is what UEFI x86_64 sometimes looks like
	if option architecture-type = 00:07 {
		filename "ipxe/ipxe.efi";
	}

	# the traditional "BIOS PXE"
	if option architecture-type = 00:00 {
		filename "pxelinux.0";
		# Or ipxe, or whatever.
		# You may need further options for pxelinux.
	}
}

# This is all just a very crude beginning!
# iPXE can load your images via NFS, HTTP or boot from iSCSI.
# You can use the "chain" command to "exec" another #!ipxe script,
# or another UEFI payload.
# As documented at ipxe.org, you can create the chainloaded script
# on the fly using CGI or PHP or some such, even the suffix of the
# HTTP download can be .php (the file extension doesn't make a difference).

