pxelinux
2009-Mar-13 09:56 UTC
[syslinux] Custom .c32 module which can send tcp or udp packets
I need to write a custom .c32 module which can send information over to a separated service or tftp deamon. The goal is to send inventory information gathered in pxelinux to be transfered back to the inventory database without booting a kernel or os-image. Is this possible and if so, can you give me a hint how to realise this? Thanks, Daniel
Gene Cumm
2009-Mar-13 12:32 UTC
[syslinux] Custom .c32 module which can send tcp or udp packets
On Fri, Mar 13, 2009 at 5:56 AM, pxelinux <pxelinux at myserver.ch> wrote:> I need to write a custom .c32 module which can send information over to a separated service or tftp deamon. The goal is to send inventory information gathered in pxelinux to be transfered back to the inventory database without booting a kernel or os-image. > > Is this possible and if so, can you give me a hint how to realise this? >Peter, is it me or is asking about the capability of writing to a file, remote or local, coming up more often? The first issue is that you must implement the TFTP PUT in assembly in pxelinux.asm. Then, you'd have to utilize it either in a COM32 library call or directly from your COM32 program. If you don't start in pxelinux.asm, you'd need to open the network card up yourself. INT 22h AX=0009h provides access to the PXE stack in the COMBOOT API. -- -Gene
Florin Izvoranu
2009-Mar-13 20:43 UTC
[syslinux] Custom .c32 module which can send tcp or udp packets
On Friday 13 March 2009 11:56:29 pxelinux wrote:> I need to write a custom .c32 module which can send information over to a > separated service or tftp deamon. The goal is to send inventory information > gathered in pxelinux to be transfered back to the inventory database > without booting a kernel or os-image. > > Is this possible and if so, can you give me a hint how to realise this? > > Thanks, > Daniel > _______________________________________________ > Syslinux mailing list > Submissions to Syslinux at zytor.com > Unsubscribe or set options at: > http://www.zytor.com/mailman/listinfo/syslinux > Please do not send private replies to mailing list traffic.Can You clarify what do You want to do after inventory has been send ?? Shutdown ? I would wait in a loop for a file <MAC>.initrd to be created and boot with that. My use case would be to boot small kernel with small initrd+network module needed and get everything else from linux. Sorry for my english Regards Florin
Gordon Schumacher
2009-Mar-16 18:39 UTC
[syslinux] Custom .c32 module which can send tcp or udp packets
Jeffrey Hutzelman <jhutz at cmu.edu> wrote:>> > Gene Cumm wrote: >> >>> >> Peter, is it me or is asking about the capability of writing to a >>> >> file, remote or local, coming up more often? >>> >>I could certainly use that feature, but I also readily recognize why it's not very practical...!> It's too bad that floppy drives have become so uncommon. I wouldn't feel > so bad about supporting raw (no filesystem) writes to a BIOS-supported > floppy, perhaps with the syslinux core warning and prompting the user > before doing the first write.Oh, indeed - or even a FAT-formatted floppy. It's easy enough to tell if the floppy is blank, after all... and even if it's not, FAT is pretty well understood. This would make the problem simple - but the replacements for a floppy are a CD or USB stick, neither of which is "simple" to be able to address... I've not figured out a good solution here.
Miller, Shao
2009-Mar-27 19:24 UTC
[syslinux] Custom .c32 module which can send tcp or udp packets
Good day Daniel, You might be interested in the possibility of using gPXE to accomplish your goal below. If you boot gPXE, your DHCP filename option can be a gPXE script, something like "boot.gpxe" which could contain: #!gpxe chain http://webserver/inven.gpxe?mac=${mac}&ip=${ip}&manu=${manufacturer:uris tring}&model=${product:uristring}&serial=${serial:uristring}&asset=${smb ios/3.8.0:uristring}&biosrev=${smbios/0.5.0:uristring} The "webserver" would host the "inven.gpxe" script, which would actually be a server script. It would collect the inventory parameters passed to it, then return yet another gPXE script to the gPXE client. This returned script might contain something like: #!gpxe set 209:string pxelinux.cfg/default set 210:string http://webserver/ chain http://webserver/pxelinux.0 The gPXE client would then load pxelinux.0 from the _web-server_ via HTTP, then load your pxelinux.cfg/default file, again via HTTP, after which point your process should resemble what you already have in place, except that all files would be requested via HTTP and would be requested from the web-server. The 209 and 210 options are PXELINUX options and are documented in syslinux/doc/rfc5071.txt. Another thing to keep in mind is that since you can dynamically generate the second returned script, it can be based on the client's inventory... Which means you can return a script that points to pxelinux.cfg/foo or a different script that points to pxelinux.cfg/bar. If you _don't_ want to use HTTP _except_ for the inventory collection, and wish to use TFTP for the pxelinux.0 operations in order to minimize the change to your environment, change the 210 option line to: set 210:string tftp://${next-server}/ And the PXELINUX operations should likely continue as normal for you. I hope this helps! - Shao Miller P. S. Some folks might notice that I've cross-e-mailed this one to both SYSLINUX and gPXE. Maybe it could make for a handy point-to in case this question comes up again. I hope nobody minds. -----Original Message----- From: syslinux-bounces at zytor.com [mailto:syslinux-bounces at zytor.com] On Behalf Of pxelinux Sent: Friday, March 13, 2009 05:56 To: syslinux at zytor.com Subject: [syslinux] Custom .c32 module which can send tcp or udp packets I need to write a custom .c32 module which can send information over to a separated service or tftp deamon. The goal is to send inventory information gathered in pxelinux to be transfered back to the inventory database without booting a kernel or os-image. Is this possible and if so, can you give me a hint how to realise this? Thanks, Daniel _______________________________________________ Syslinux mailing list Submissions to Syslinux at zytor.com Unsubscribe or set options at: http://www.zytor.com/mailman/listinfo/syslinux Please do not send private replies to mailing list traffic.