Re: ramfs: mounting ramfs as / at boot time

From: Werner Almesberger (almesber@lrc.epfl.ch)
Date: Thu May 25 2000 - 16:59:41 EST


Dave Cinege wrote:
> initrd-archive, which currently dynamically creates a minix fs on /dev/ram0.
> The idea is to allow bypassing rd.mkminixfs, and mount the
> root using ramfs.

What about the following procedure:
 - you load a small initrd, and boot as usual, with or without /linuxrc
 - your initrd environment creates and populates the ramfs (*)
 - use pivot_root to switch to your ramfs
 - exec init
 - clean up whenever it's convenient for you

(*) you may have to add a mechanism to retain the initrd data (for access
    with /dev/initrd) for this to work efficiently, i.e. you'd retrieve
    the ramfs data from /dev/initrd right after then the of the first
    block of gzip'ed data. (This way, you can also avoid explicitly
    passing the length of the first RAM disk.)

As an added benefit, this avoids any reliance on change_root, which
already prepares your solution for the day when change_root is dropped.
(Well, that probably won't happen too soon, but the general direction
is to get rid of it.)

> I just really have no idea how to mount ramfs from within the kernel.

I think this illustrates the problem: once you start doing those thing
in the kernel, you need to pull all dependent steps into the kernel
too - including some that were never meant to be there.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:14 EST