[syslinux] How to run server side script from boot menuselection ?

Shao Miller Shao.Miller at yrdsb.edu.on.ca
Wed Jan 13 12:59:04 PST 2010

Moody Ahmad wrote:
> ...I would also appreciate any suggestions on what is a good way to do 
> this server-side script...

Unfortunately, the best way that I know of to pass client-specific 
params to a CGI script on a web-server from PXELINUX is not using 

Instead, you'd need the gPXE source code and the ability to compile it.  
Then you'd go into your gpxe/src/ directory and do:

make EMBEDDED_IMAGE=~/param_boot.gpxe bin/undionly.kkpxe

where ~/param_boot.gpxe would be a gPXE script in your home directory.  
Something like:

dhcp net0
set 210:string 
chain ${210:string}pxelinux.0

In this ugly-looking URI, your CGI script would be passed these details 
every time the client downloads a file.  Thus, you CGI script would have 
to use the &file= parameter to determine which file to actually return.  
The first such file it would need to return would be pxelinux.0 (not 
gpxelinux.0), which you can see that the 'chain' command immediately 
tries to request.  After that, any files references by your PXELINUX 
config-files whose paths are non-absolute (relative) would have this 
DHCP option 210 prefixed to them.  So if your config-file looked like this:

  KERNEL memdisk
  INITRD dos.vfd

then the client would try to download something like:


Pretty long!  But at least the CGI script can make an informed decision 
about what file to return to the client as "memdisk," for whatever 
that's worth.  Then next file download would be the same detail, except 

- Shao Miller

More information about the Syslinux mailing list