[klibc] initramfs as an initrd replacement

dododge at smart.net dododge at smart.net
Tue Oct 14 08:28:51 PDT 2003

> One of the things I am working on requires me to have a kernel and an
> initrd (as root filesystem , based on busybox) in one single image.

I'm doing something along these lines as well (end goal in my case is
a livecd to run a game on a diskless system). At the moment I'm
PXE-booting 2.6.0-test7 with a uClibc/busybox initramfs as the root

> As a test, I made a cpio archive of my own for the kernel source (plain
> 2.6.0-test5).  Everything gets unpacked just fine during boot. Somehow I
> was expecting that there would be a way to have it execute its own
> /sbin/init and stay in ramfs - but I do not know how to get this to
> work. 
> The best I could come up with was modifying /init/do_mounts.c to skip
> over all the initrd loading stuff - then it worked.

Same here. The only way I got this to work was to modify do_mounts.c.
I inserted a one-liner to skip the mount_root call if I boot with
"root=0:0". Someone else has posted a similar patch to the mailing
list archives, and I think it's in the -mm series kernel.

> My question is, is there a  way to use an initramfs archive as a
> rootfilesystem, without patching the kernel source? 

Perhaps I'm missing something obvious, but I don't see any way to do this
with a stock kernel.

More information about the klibc mailing list