Question on initrd and initramfs

Ezequiel Garcia elezegarcia at
Thu Sep 27 12:57:46 EDT 2012


This is *not* another question about initrd vs initramfs (I already
read Documentation/...).

That said, I'm doing some experiments with:
 * qemu
* a very small kernel
* busybox static-linked rootfs

I can create an initramfs using this:
$ cd initramfs
$ find . | cpio -H newc -o > ../initramfs.cpio

Then I use start qemu like this:
$ qemu -kernel bzImage -initrd initramfs.cpio

This works.

Now to my first question:
The kernel is compiled WITHOUT any fs driver... So how the f@#ck did
he mounted initramfs? How are the files formatted?

And second question:
I want to repeat the above procedure but using initrd instead of
initramfs, is this still supported?
I'd like to use romfs or squashfs... anyone knows how to create this
initrd and how to give it to qemulated kernel?

This seems trivial, but I spent all morning and had no luck... :-(

FWIW: My current kernel size (compressed) is around 500k!
This is the smaller kernel I managed to boot. It has nothing (not even /proc)
so it's pretty useless but at least it can run a shell :-)

The question I'm trying to answer is: how little can it be, while
still remaining useful?


More information about the Kernelnewbies mailing list