[syslinux] tftp server with mysql backend

Pierre Lombard pl at icatis.com
Wed Apr 26 02:20:58 PDT 2006


> James_Martin at ao.uscourts.gov wrote:
> >Are there any open source efforts ( I haven't found any) that have a tftp 
> >server with a mysql backend?  I'd like an incoming pxelinux request to 
> >give the tftp server the mac address, and then it performs a query to find 
> >out which configuration file it should get.  Of course it would be great 
> >if some day tftp-hpa would integrate with libmysql..

* Pierre Neyron <pierre.neyron at imag.fr> [2006-04-26 10:00]:
> We are using such a mechanism in Computemode (www.computemode.org).
> Some time ago, a patch was proposed against tftpd-hpa in this ML.
> It provides a way to add in the remap mechanism a execution feature, 
> which allows for instance to run in a chroot  busybox environement, any 
> command that is made available, say wget.
> This wget calls a php script which interacts with a PostgresSQL server.

For the record the files (&deb packages) are available at:

(the chroot builder for our environment - you might have to do a bit of
tuning though)

The script bin/gen.sh is tuned for our needs but you may just replace it
by any application handling your needs.

The etc/remap files contains the rewriting rules:
xe /PXEClient/pxelinux.cfg/01-* /bin/gen.sh

This means when a client requests something matching
'/PXEClient/pxelinux.cfg/01-foobarwhatever' then the tftpd will call
'/bin/gen.sh foobarwhatever'

Now the script/application has to follow a few straightforward rules:
 - get the matched part of the file path as a first argument
 - output the result file on stdout
 - do an 'exit 0' if no error occured

Pierre Lombard <pl at icatis.com>                          GPG: 0xECF801E6

More information about the Syslinux mailing list