[klibc] booting initramfs

Dave Dodge dododge at dododge.net
Tue Nov 4 12:58:16 PST 2003


On Sun, 2 Nov 2003 uaca at alumni.uv.es wrote:
> I'm trying to boot with initramfs
[...]
> when It tries to mount the rootfs it tries to mount from
> an IDE device (where the kernel was built from), and not from
> the initramfs "image"

Last I checked, a stock kernel does not yet allow you to boot into
initramfs. It always tries to mount some other root filesystem
instead.

> I think this is not documented and I did not found it by gooling

It's been mentioned a couple of times in this list, but I think
you're right that most people don't find out about it until they
actually try to use initramfs :-). Some patches have been floating
around to fix this, but I don't know if any of them are considered
authoritative.

You need to stop the kernel from calling mount_root. One simple
approach is to modify the "prepare_namespace" function in
"init/do_mounts.c". Replace the call to "mount_root();" with this:

    if((MAJOR(ROOT_DEV) != 0) || (MINOR(ROOT_DEV) != 0))
            mount_root();

Then if you boot with "root=0:0" on the kernel command line, it
should go directly into initramfs. I don't have my patched source
handy but the above is what I seem to remember doing.

                                                  -Dave Dodge



More information about the klibc mailing list