Getting hostnames from PXE to build

Darryl Luff darryl at
Sun Feb 26 11:26:02 CET 2006

Hi all. I'm new to FAI. I've seen a few requests in the archives about
setting the hostname on the built machine using other than the DHCP
config, but none really did what I need to do.

I boot via PXE and type the hostname I want to build at the pxelinux
prompt. Some hosts are redhat, others are windows, others (will be) fai.
The pxelinux config runs the appropriate installer for that specific
host. For the fai hosts I have (in pxelinux.cfg/default):

label jack
kernel fai/vmlinuz-install
append ... hostname=jack

So 'jack' is a debian host to be built using FAI. So I only need to type
the hostname at the pxelinux prompt and the rest of the build is hands off.

I add 'hostname=jack' to the kernel command line so I can use the
hostname as a key to select the FAI classes. To make it work like this,
I had to add a few lines to fai/nfsroot/usr/sbin/fai to pickup the
hostname from /proc/cmdline and export it to $HOSTNAME.

Is there a more standard 'fai' way to do this, that doesn't involve
modifying 'fai' itself in any way? The hostname has to be set before the
fai classes are selected.


More information about the linux-fai mailing list