[syslinux] Chainloading from one PXELINUX to another (with some iPXE in the mix)?
Mike Sollanych
msollany at sfu.ca
Tue Jun 7 18:04:01 PDT 2011
Hello SYSLINUX folks, thanks for all your hard work over the years!
I'm working on a fairly complex deployment services project, and one of the
aspects of it is to make it possible to federate deployment services across
our university. Supporting existing deployment services is a priority, so
I am presently trying to integrate an existing PXELINUX install, part of a
FOG windows imaging service, with a larger iPXE / SYSLINUX setup.
The boot order is as follows:
F12 network boot -> local PXE -> iPXE from master server -> Syslinux VESA menu.
iPXE is in the chain first because we have some custom scripting that runs that
could result in a machine not booting to SYSLINUX, but that functionality is all
working well at the moment.
Once we hit Syslinux, one of the submenus covers a department's existing FOG
server. FOG uses PXELINUX itself, and provides a number of static boot lines
in its own pxelinux.cfg/default file. Those lines were simply integrated into
our new master Syslinux setup.
However, FOG assigns a "task" to a machine by creating a MAC-address specific
config file in its TFTP pxelinux.cfg directory, so that when the machine boots,
it runs a specific kernel with a complex APPEND string of options (including the
image file to use and more). Without this APPEND line, FOG is broken.
Within the framework of this federated deployment project, after much head
scratching, the next easiest method for me to use was to create a shim of
sorts, written in PHP and executing on the FOG server.
When provided with the MAC address of a machine as a GET parameter, it
searches for a pxelinux.cfg file specific to that MAC, and outputs an iPXE
script that causes iPXE to start FOG the same way with the same parameters.
I then call iPXE as 'ipxe.lkrn' from within the master SYSLINUX, with a
parameter that is a short one-line script to get a DHCP address, download
the output of that script from the FOG server, and execute it:
LABEL fog.currentTask
kernel ipxe.lkrn dhcp && chain http://[FQDN]/tftpboot/fog-ipxe.php?mac=${mac}
MENU LABEL Boot to FOG server and run assigned task
This works really well on *most* machines, and ends up being quite robust.
However, 'ipxe.lkrn' seems to require native network driver support in order to
function, unlike the initial iPXE instance which uses the network card's UNDI
support. So, on machines with even slightly weird network hardware (read: most
laptops), this second iPXE instance can't get to the network.
The iPXE development mailing list had a suggestion for me to try using
SYSLINUX's CONFIG statement, wherein I provide the TFTP address of a
pxelinux.cfg file.
LABEL fog.currentTaskDebug1
CONFIG tftp://[FQDN]/pxelinux.cfg/default
MENU LABEL Fog with Syslinux CONFIG directive
This works, sort of. What it will do is display the PXELINUX menu from the FOG
server. However, it cannot run the 'current task' for the machine, because doing
so would have required that we fetch instead something like:
tftp://[FQDN]/pxelinux.cfg/01-11-22-33-44-55-66
There is no variable support in SYSLINUX yet, unfortunately, so I can't just issue
a line like the iPXE ${mac} above.
Is there some way to use this CONFIG line (or the mysteriously undocumented
config COM32 module, which could be the same thing?) to load the SYSLINUX config
file from some other server using the same order of precedence that SYSLINUX uses
when first loading its own config file?
If this feature doesn't exist, could some kind soul that knows how to program
better than I whip it up for me? I'll find a way to repay you in coffee/beer
somehow :-)
Much appreciated,
Mike Sollanych - msollany at sfu.ca
IT Services - Research Computing Group
Simon Fraser University
More information about the Syslinux
mailing list