Kjetil.Mikkelborg at kongsberg.com
2008-Mar-13 10:12 UTC
[syslinux] Adding memdisk or similar when booting linux
Hi Thanx guys for the help on understanding howto read dmi info! I now have a custom boot menu for install of different linux versions based if they have been installed before (reinstall is ok for users, first install is not), and installquirks like if we detect odd hardware, we add install options to redhat installer so it can install anyhow (for instance hp dc7800 who needs pci=nommconf as kernel append for booting). But now I need to add a driver disk to my install enviroment, and when thinking about it, the nice method would be having syslinux create a memdisk which linux could see when starting install, and load its drivers from there. The reason i need a memdisk image (or similar), is since often the driver I need is a network driver, which offcourse is a tad difficult getting from the net _After_ the kernel have taken over. Embedding the initrd would be an option, but would require me to change all install initrd's for every driver I put in my driver disk, and also it would require me to also allways modify new releases with custom initrd. But with a memdisk approach, the only image who would need attention would be the driver disk image alone (which actually supports multi versions) Is there any clean approches to achive this? like starting first memdisk, load a image to it, and then start linux (all thru pxelinux?) --Kjetil
Harald_Jensas at Dell.com
2008-Mar-13 14:53 UTC
[syslinux] Adding memdisk or similar when booting linux
Hi Kjetil, I used ISOLINUX, MEMDISK and SYSLINUX to load drivers disk for Windows using MEMDISK in a tool I made a few years back. What I did was: - ISOLINUX loads MEMDISK and a gzipped floppy image and boots the A: floppy image. - Floppy image has SYSLINUX that in my case load another floppy image using MEMDISK to create a virtual B: drive. (The reason for loading MEMDISK twice in my case is because of a special case in how the Windows installer handles B: drives with driver disks inserted.) - The B: floppy image boots and also run SYSLINUX wich kick of a bootloader that let me change CD and boot from the new CD inserted, im my case this is the Windows 2k3 installation media. You should be able to do something similar like: - PXELINUX loads MEMDISK and a gzipped floppy image and boots the A: floppy image. This image contain your driver disk and SYSLINUX+MEMDISK+"Floppy bootable ROM Image". - SYSLINUX could then load MEMDISK that in turn loads and boots the "Floppy bootable ROM Image". - The "Floppy bootable ROM Image" will now do another PXE boot. You can also configure the bootfile loaded by the Floppy bootable ROM Image when this is created. E.g overriding the bootfile specified in your DHCP config. E.g the NIC PXE boot get the bootfile info from DHCP wich is tftp://server/loadddisk/pxelinux.0 which load MEMDISK and then the Floppy bootable ROM Image will load tftp://server/installer/pxelinux.0 which in turn start the kernel/initrd for OS installation. I would'nt call this clean, but it should work... :) \\ Harald Jens?s> -----Original Message----- > From: syslinux-bounces at zytor.com [mailto:syslinux-bounces at zytor.com] On > Behalf Of Kjetil.Mikkelborg at kongsberg.com > Sent: 13 March 2008 11:13 > To: SYSLINUX at zytor.com > Subject: [syslinux] Adding memdisk or similar when booting linux > > Hi > > Thanx guys for the help on understanding howto read dmi info! > I now have a custom boot menu for install of different linux versions > based if they have been installed before (reinstall is ok for users, > first install is not), and installquirks like if we detect odd > hardware, we add install options to redhat installer so it can install > anyhow (for instance hp dc7800 who needs pci=nommconf as kernel append > for booting). > > But now I need to add a driver disk to my install enviroment, and when > thinking about it, the nice method would be having syslinux create a > memdisk which linux could see when starting install, and load its > drivers from there. The reason i need a memdisk image (or similar), is > since often the driver I need is a network driver, which offcourse is a > tad difficult getting from the net _After_ the kernel have taken over. > > Embedding the initrd would be an option, but would require me to change > all install initrd's for every driver I put in my driver disk, and also > it would require me to also allways modify new releases with custom > initrd. But with a memdisk approach, the only image who would need > attention would be the driver disk image alone (which actually supports > multi versions) > > Is there any clean approches to achive this? like starting first > memdisk, load a image to it, and then start linux (all thru pxelinux?) > > --Kjetil > _______________________________________________ > 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.
On Thu, 13 Mar 2008, Kjetil.Mikkelborg at kongsberg.com wrote:> Thanx guys for the help on understanding howto read dmi info! > I now have a custom boot menu for install of different linux versions > based if they have been installed before (reinstall is ok for users, > first install is not), and installquirks like if we detect odd hardware, > we add install options to redhat installer so it can install anyhow (for > instance hp dc7800 who needs pci=nommconf as kernel append for booting).Kjetil, You would do me a very big favor in showing me how you do this (or even beter, writing up a document for the wiki how you achieved this). I am very interested to implement the same and I am confident that this is something Red Hat should be doing as well (or if not, I would like to see within the CentOS project what is possible) Thanks in advance, -- -- dag wieers, dag at wieers.com, http://dag.wieers.com/ -- [Any errors in spelling, tact or fact are transmission errors]
Kjetil.Mikkelborg at kongsberg.com
2008-Mar-14 07:23 UTC
[syslinux] Adding memdisk or similar when booting linux
Ok, First off, thnx guys for giving me some hints to how to solve my problem with driver disks, I am not sure it will work with my setup (basicly because I relies so much on PXE), but I will use some time to figure it out at least ;) And for you Dag, first of, my approach of fixing this is probably due to lack of support in redhat enterprise itself, so I can really see where your questions comes from! the first issue, about install/reinstall Is just i feature I needed because I have to be 110% sure the hardware my users are using actually is well behaving (and my company have dedicated personell for installing windows, so what the heck, let them install linux and verify that too). The whole concept relies on using the comboot complex.c menu system included with syslinux, and modififying it to read from a register file located on the tftp server. This approach is not extremly scalable, but will do for now in my usage area. This register file is modified by a rpm package installed by yum at first boot (after install). (hence first install or reinstall, if entry in register file exists, we are reinstalling). And everytime my clients are booting their client after that, the same package has installed a init script which check to see if it has any changes (like new IP, new hostname or alias), and contacts a server with its updates (makes dns and friends allways updated in a dhcp enviroment). This central server when asked for making changes, verify the changes, and updates the tftp register file if any changes has been made. So this ensures that if a client changes hostname, the pxe install menu actually knows what it is called (using MAC address as system-id in the register file). Ive also password protected override for install, so if first install (no entry in register file), my install crew can punch in their password, register what the client actually should be named, and start installing (post script in anaconda uses HOSTNAME= variable in cmdline from kernel boot). My second thing (installquirks), is actually just some of the same code reads dmi info, and checks for product name string, and parses it with help from a installquirks file found in pxelinux tftp server. If we find a entry which matches whats inserted in installquirks file, then we append what that record holds when installing. The nice thing about this, is that anaconda adds by default every "quirk" the user use for install to grub when installing grub, so this change is only needed on install. The coolest thing, would offcourse be if someone had a own project for maintaining a installquirks register on the net, so it could be read (with help of a tiny comboot program) at install by syslinux as default. But that is a pretty big task. So my approaches is somewhat hackish, but really makes installing and maintaining large installation of linux clients doable :) So now I just have to get to the buttom of the driver disk problem! --Kjetil -----Original Message----- From: syslinux-bounces at zytor.com [mailto:syslinux-bounces at zytor.com] On Behalf Of Dag Wieers Sent: 14. mars 2008 02:55 To: For discussion of SYSLINUX and tftp-hpa Subject: Re: [syslinux] Adding memdisk or similar when booting linux On Thu, 13 Mar 2008, Kjetil.Mikkelborg at kongsberg.com wrote:> Thanx guys for the help on understanding howto read dmi info! > I now have a custom boot menu for install of different linux versions > based if they have been installed before (reinstall is ok for users, > first install is not), and installquirks like if we detect odd hardware, > we add install options to redhat installer so it can install anyhow (for > instance hp dc7800 who needs pci=nommconf as kernel append for booting).Kjetil, You would do me a very big favor in showing me how you do this (or even beter, writing up a document for the wiki how you achieved this). I am very interested to implement the same and I am confident that this is something Red Hat should be doing as well (or if not, I would like to see within the CentOS project what is possible) Thanks in advance, -- -- dag wieers, dag at wieers.com, http://dag.wieers.com/ -- [Any errors in spelling, tact or fact are transmission errors] _______________________________________________ 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.
H. Peter Anvin
2008-Mar-14 08:00 UTC
[syslinux] Adding memdisk or similar when booting linux
Kjetil.Mikkelborg at kongsberg.com wrote:> Hi > > Thanx guys for the help on understanding howto read dmi info! > I now have a custom boot menu for install of different linux versions based if they have been installed before (reinstall is ok for users, first install is not), and installquirks like if we detect odd hardware, we add install options to redhat installer so it can install anyhow (for instance hp dc7800 who needs pci=nommconf as kernel append for booting). > > But now I need to add a driver disk to my install enviroment, and when thinking about it, the nice method would be having syslinux create a memdisk which linux could see when starting install, and load its drivers from there. The reason i need a memdisk image (or similar), is since often the driver I need is a network driver, which offcourse is a tad difficult getting from the net _After_ the kernel have taken over. > > Embedding the initrd would be an option, but would require me to change all install initrd's for every driver I put in my driver disk, and also it would require me to also allways modify new releases with custom initrd. But with a memdisk approach, the only image who would need attention would be the driver disk image alone (which actually supports multi versions) > > Is there any clean approches to achive this? like starting first memdisk, load a image to it, and then start linux (all thru pxelinux?) >Writing a COM32 module to construct an initramfs on the fly might be the best of all worlds. That way the COM32 module can download the specific drivers it needs. The library support for that is already there. -hpa
Kjetil.Mikkelborg at kongsberg.com
2008-Mar-19 11:36 UTC
[syslinux] Adding memdisk or similar when booting linux
>Kjetil.Mikkelborg at kongsberg.com wrote: >> >> Is there anyway i can keep redhats initramfs image, and load a second one? >> >> If not, I really would need to ensure that the initramfs could hold both redhats data, and my driverdisk data. But still this is much cleaner than jumping from memdisk >to syslinux and so on. How does actually initramfs handle this? can it be dynamicly enlarged? with this scenario, the initramfs could with no problem be twice and tripple >the original size. >> >> And if i really can have a second initramfs, how do i access it? >> > >If you load multiple initramfs images, then they overlay; the resulting >filesystem contains both files. > > -hpaOk, thanks, but.. Ive tried using linux.c as an example, but I am in no way capable of adding files with this simple code size_t kernel_len, dd_len; void *kernel_data, *dd_data; struct initramfs *initramfs; loadfile("path to vmlinuz on tftp server",&kernel_data,&kernel_len); loadfile("Path to dd.img file on tftp server",&dd_data,&dd_len); initramfs = initramfs_init(); initramfs_load_archive(initramfs,"path to redhat enterprise 4 initrd.img file on tftp server"); initramfs_add_file(initramfs,dd_data,dd_len,dd_len,"/dd.img",0,0755); syslinux_boot-linux(kernel-data,kernel_len,initramfs,"append string",0xffff,0); is there any more init I have to do to add files? and, is it really right to use dd_len,dd_len as arguments (whats the first len since the second is for how much data we add). --Kjetil