PDA

View Full Version : Customized initrd boots regular ext3 systems



bitster
02-26-2004, 10:31 PM
I love the configuration of the knoppix kernel so much, I use on my regular debian desktop system. One of the biggest problems I had with it was that I couldn't mount my root fs ext3 because the modules wouldn't fit on the floppy-size initrd image (and why should it - it's running from a cd! :).

So I hacked up this little alternative initrd image (http://planetdone.com/knxe3fs.img) tweaked from the 2004-02-16 release (with the 2.4.24-xfs knoppix kernel) that I thought I would share.

It adds an extra cheat code, "bootfs=", ( example: "bootfs=/dev/hda2" ), that will cause the knoppix boot process to skip looking for the cloop image, and will instead attempt to mount the device listed in bootfs as the root filesystem, as ext3 if it can, as ext2 otherwise, and failing that, as vfat. It will then boot that system with init from there as usual.

To make this work, you'll probably need to copy the /lib/modules/2.4.24-xfs/ and /lib/modules/extra/ directories from the knoppix system into your system's /lib/modules/ so that the booting kernel can load the right modules for itself as it goes.

I had to add the jbd.o and ext3.o modules onto the image, so I'm sure it's too big to copy onto a floppy drive along with the kernel, but it's fat and happy loading from my hard drive using the grub bootloader.

I hope you find it useful. :) enjoy

palm
03-15-2004, 11:49 PM
yes ! very useful !
I've been searching for the linuxrc tweak to get this result. Thank you :P

By the way, could you describe your mods ?
- Why should we mount read only ?
- The signal to the kernel for real root dev is also mysterious, although I've seen such things in every scripts... as well as all these mount /proc...

bitster
03-16-2004, 04:03 AM
The real-root-dev call was there in the initial script, so I just preserved it.

After finishing with the initrd, the kernel remounts the root fs read/write on it's own. IIRC, mounting it rw to begin with failed to boot properly. Either that, or it screwed up recovery operations in case one was necessary. Adding the jbd.o and ext3.o, and tweaking the linuxrc comprise the only changes (a diff against the original should point them out)

I was thinking about adding some more capabilities - like throwing smbfs in there allowing a remote network boot. Once you've decided that size is a small enough consideration that you're initrd doesn't need to fit on a floppy, tons of crap can suddenly be justified to have stuffed into it... ;p

toltech
03-16-2004, 09:49 AM
Hi Bitster,
I have just posted a question about customising the kernel which has been driving me nuts. Could you please have a look at it and tell me what you actually did to create a customised kernel?

Robert

c123
04-20-2004, 09:23 AM
I was thinking about adding some more capabilities - like throwing smbfs in there allowing a remote network boot. Once you've decided that size is a small enough consideration that you're initrd doesn't need to fit on a floppy, tons of crap can suddenly be justified to have stuffed into it... ;p

Well people are always looking for an easy way to 'boot' off USB and 1394 external hard drives if you are looking for a challenge...