I know this isn't the purpose of TFTP, but I'm working in an environment where a lot of different types of devices pull provisioning info from a TFTP server. What I'm developing is a provisioning system that tracks and maintains device configurations, and I would like to have the requested files generated on the fly, much like you could do with any web application.
Yes some of these devices can support HTTP for provisioning, but not all of them do, and we want things to be consistent.
Are there any TFTP daemons that can provide something analogous to CGI?
This is addressed here. Sadly, it seems to be difficult or impossible, given the constraints on the TFTP protocol.
A better design would be to generate all config files and cache them in the tftpboot directory rather than trying to generate them on the fly. Ideally the filename your devices request would be unique or identifiable and you could pre-generate files based on that.
A quick search revealed this tftpd-cgi project on Sourceforge - might be worth checking out.
I also just wrote a simple tftpd server capable of serving CGI, available on Github, so it's definitely possible. I haven't tested with any PXE clients yet, but it does work with my operating system's tftp client.
My test usage:
Which outputs from my simple CGI script: