Moody Ahmad
2010-Jan-13 16:42 UTC
[syslinux] How to run server side script from boot menu selection ?
Here is what I am trying to do but don't know if it is possible or how to do. Scenario: A pxelinux.cfg boot menu item to load a pristine image. This would execute a script on the linux server providing the pxe boot service to copy / rsync a pristine image and boot from that image. Or at least just do the copy on the server side. Context: I am setting up a drbl (diskless remote boot linux) environment at a public library. I would like users to be able to add software, make changes to the image as they want (free as in open source). Then the next user can just boot from a pristine image by rebooting and selecting that option. For this to work I need the pxe menu item to actually do the copy over of the pristine image on the server. Is this possible? I have looked through the pxelinux and syslinux documentation on the menu options and haven't seen a way to execute a server side script. The script needs a few variable like the mac address and assigned dhcp ip address for the client. I would like to do the script in bash or perl. Any help on doing this would be greatly appreciated. I have been digging through a lot of documentation and have not found a way to do this yet. Thanks in advance, Moody
H. Peter Anvin
2010-Jan-13 19:38 UTC
[syslinux] How to run server side script from boot menu selection ?
On 01/13/2010 08:42 AM, Moody Ahmad wrote:> > Is this possible? I have looked through the pxelinux and syslinux documentation on the menu options and haven't seen a way to execute a server side script. The script needs a few variable like the mac address and assigned dhcp ip address for the client. I would like to do the script in bash or perl. >Well, normally you wouldn't find documentation how to execute a *server*-side script in the *client* documentation, now would you... The answer is that you need a server that supports scripting. Few TFTP servers do, but most HTTP servers do. This isn't inherent to the protocols, but is more of an accident of history (at least until Apache grows TFTP support, which it probably will at some point.) So if you can use gpxelinux.0, then you can use an http server. Otherwise, there are a few hacked TFTP servers around. -hpa