Paolo Salvan
2004-Oct-27 06:20 UTC
[syslinux] Passing one more file after initrd to the kernel...
Hi! I have a particular need... I'm not sure if this is the right place to ask, but surely here there are people that can say me if it is feasible or not... I'm working for a thin-client distribution (thinstation.sf.net); I want to boot it from various media (netowork, cdrom, hd, usb key...), and at the moment syslinux/isolinux/pxelinux are doing it very well... The problem is that the distribution is composed by a kernel, an initrd and a CONFIGURATION TEXT FILE, some kb-long, that should be read by the system after boot... At the moment I'm solving the problem instaling modules for all the unit types (cd, hd, usb...) and fs (iso, fat), mounting the boot unit and reading this file after boot... It would be quite a cleaner solution if I could pass this file to the system directly during the boot phase, tghether woth kernel params and initrd... and later if I could read this file in someway after the boot (ie in the dev/ or proc/ path) In this way the file would be read using BIOS drivers, and if the system can boot I would be sure that my conf file would also be read, without needing to know which filesystem the system has been booted from, and without requiring my mini-system to have a lot of driver used only to load this small file... Does someone have some idea? Bye! Paolo
H. Peter Anvin
2004-Oct-27 06:45 UTC
[syslinux] Passing one more file after initrd to the kernel...
Paolo Salvan wrote:> Hi! > > I have a particular need... I'm not sure if this is the right place to > ask, but surely here there are people that can say me if it is feasible > or not... > > I'm working for a thin-client distribution (thinstation.sf.net); I want > to boot it from various media (netowork, cdrom, hd, usb key...), and at > the moment syslinux/isolinux/pxelinux are doing it very well... > > The problem is that the distribution is composed by a kernel, an initrd > and a CONFIGURATION TEXT FILE, some kb-long, that should be read by the > system after boot... > > At the moment I'm solving the problem instaling modules for all the unit > types (cd, hd, usb...) and fs (iso, fat), mounting the boot unit and > reading this file after boot... > > It would be quite a cleaner solution if I could pass this file to the > system directly during the boot phase, tghether woth kernel params and > initrd... and later if I could read this file in someway after the boot > (ie in the dev/ or proc/ path) > > In this way the file would be read using BIOS drivers, and if the system > can boot I would be sure that my conf file would also be read, without > needing to know which filesystem the system has been booted from, and > without requiring my mini-system to have a lot of driver used only to > load this small file... > > Does someone have some idea?> This can be done with initramfs, although right now it's a bit clumsy. However, initramfs is simply one *OR MORE* cpio archives strung together; if your config file thus could be wrapped into a cpio header and appended to the initramfs that would do the job. Right now syslinux et al don't have any support for loading more than one file, but it has been somewhere on my list of things to do. Another possibility would of course be to make this possible to do from a com32 file; it technically speaking already is, but you have to load the kernel image and initramfs image yourself and then use the "terminate and replace boot code" function with a small stub that puts everything into the right place and invokes the kernel. Definitely messier than it should be, and requires quite a bit of low-level hacking knowledge. -hpa