Etherboot
First, we had etherboot, very old project, and very useful. You can take some informations from this site http://etherboot.org
Oh, miracle this guy want to talk about another boot system based upon PXE, it's gPXE, from a GsOC, it was a very interesting conference. after i saw it (few hours after) i want to create a setup for testing, and it was so simple and useful that i scratched my old setup and only use the new one.
gPXE
Download it from source, git and compile it.
cd /data/Tools
git clone git://git.etherboot.org/scm/gpxe.gitgit pullcd gpxe/srcmake bin/undionly.kpxeBut you can also create an option rom or an iso file for booting your system. For doing this, you must change kpxe with rom or iso.
The undionly is the way to boot generic interface (Universal Network Device Interface)
iPXE
Same as gPXE, but there's no dev on gPXE since august 2010, and a new project starts known as iPXE.
all what i written on gPXE is valid for iPXE, the git clone is just not the same.
cd /data/Toolsgit clone git://git.ipxe.org/ipxe.gitgit pullcd ipxe/srcmake bin/undionly.kpxe(g|i)PXE with serial console
Same as before but we must uncomment some parameters in the sources code
cd /data/Tool/src/configsed -i 's=^//#define CONSOLE_PCBIOS=#define CONSOLE_PCBIOS=' console.h
sed -i 's=^//#define CONSOLE_SERIAL=#define CONSOLE_SERIAL=' console.h
cd ../..make bin/undionly.kpxeYes, it s juste to uncomment the serial entry and the "bios" output.
Syslinux V3 subsystem
download syslinux and checkout the V3.86.
cd /data/Toolsgit clone git://git.kernel.org/pub/scm/boot/syslinux/syslinux.gitgit describe                             # answer something like syslinux-4.06git checkout syslinux-3.86git describe                             # answer something like syslinux-3.86make install INSTALLROOT=/data/Boot/SyslinuxWhat we want to do
We have a new computer, but with a clean hard drive, no OS on it. We can't boot and use this computer.
What we want to do, many thing like:
We can do this for real or virtual environment.
What we add in config file
Add the boot file.
option bootfile-name "/gpxe/undionly.kpxe";with this, we risk to download and execute the same file again and again. For breaking the infinite loops we can add this.
option space gpxe;option gpxe-encap-opts code 175 = encapsulate gpxe;option gpxe.bus-id code 177 = string;And we use gpxe.bus-id for checking if we already download the gPXE boot file. Another way is to use this code.
if exists user-class and option user-class = "gPXE" {      filename "http://bootserver.my.zone.tld/pxelinux.cfg/gpxe.php";} else {      filename "/gpxe/undionly.kpxe";}We want, no, we need to leave the tftp subsystem for booting the whole environment. In fact if we want to boot a very large file (more than 200Mo). The tftp is only use for sending the gPXE boot system, then the computer starts the gpxe subsystem, we can start to download a kernel or a disk for booting an operating system.
I think http is the better for doing this, but we can also use AoE, Iscsi.
The gui is a curses config system.
we also have cli.
for this, we need a file (gpxe.php), who can send the boot command to gPXE, so if we get the url http://bootserver.my.zone.tld/pxelinux.cfg/gpxe.php with a web browser like curl, we have some gPXE script, or boot chain to a syslinux subsystem.
You must use the syslinux V3 not the syslinux V4.
gPXE Script
For booting a disk image
user@host:~/> curl http://bootserver.my.zone.tld/pxelinux.cfg/gpxe.php#!gPXEkernel http://bootserver.my.zone.tld/pxelinux.cfg/bin/memdiskinitrd http://bootserver.my.zone.tld/image/freedos.img harddisk=1Syslinux config file
the same with syslinux subsystem for memtest or hdt.
user@host:~/> curl http://bootserver.my.zone.tld/pxelinux.cfg/gpxe.phpDEFAULT menu.c32PROMPT 0MENU WIDTH 80MENU MARGIN 10MENU PASSWORDMARGIN 3MENU ROWS 12MENU TABMSGROW 18MENU CMDLINEROW 18MENU ENDROW 24MENU PASSWORDROW 11MENU TIMEOUTROW 20# Return to Main Menu LABEL Main   MENU DEFAULT   MENU LABEL ^Main Menu   KERNEL menu.c32   APPEND defaultMENU TITLE Main Menu## Menus## gPXELABEL Support  MENU LABEL ^1 - Support  KERNEL menu.c32  APPEND support.conf...user@host:~/> curl http://bootserver.my.zone.tld/pxelinux.cfg/support.conf...LABEL Hardware Dectection Tool  MENU LABEL ^Hardware Dectection Tool  KERNEL bin/hdt.c32  APPEND modules=bin/modules.pcimap pciids=bin/pci.idsLABEL Memtest  MENU LABEL Memory tester  KERNEL bin/memtest#...The second solution is very interesting because we can use menu, but tje first is interesting because it s non interactive. For interactive use, the syslinux subsystem is better, but for unattended install the first one is better.
It will be very interesting if we can switch dynamically from gPXE script to syslinux config file, and the php script can do this. if we have a php setup who can check in a database some config, this php script can choose how to boot.