[uClibc] Initrd issues (was: Linux 2.6 ROMFS vs EXT2)

Dave Dodge dododge at dododge.net
Thu Mar 11 20:45:12 UTC 2004


On Thu, Mar 11, 2004 at 08:40:43PM +0100, Matthias Kilian wrote:
> On Wed, Mar 10, 2004 at 04:07:19PM -0600, Pete Flugstad wrote:
> >     genromfs -d /mnt/root_fs_i386 -f initrd
> [...]
> >   Is genromfs any better/worse than just using the raw EXT2 partion 
> > instead?  Other than it's read-only vs EXT2 would be read-write, correct?
> 
> If you want an initrd-like boot process, try linux-2.6.3 with
> initramfs. I've not yet tested it, but from the source I think it should
> work out of the box now.

I haven't tried it with 2.6.3 either, but from a quick glance at bkbits.net
I'm not sure it's fully enabled yet.

> Booting is similar to good old initrds, but instead of passing a
> filesysten image to the kernel, you can use a cpio archive. That archive
> will than be extracted to a root-mounted tmpfs.

The usual problem has been that the kernel then immediately mounts the
real root device on top of it. So it unpacks initramfs correctly but
never actually _runs_ anything you put in there. There are a couple
patches floating around to fix this; for example:

  http://www.zytor.com/pipermail/klibc/2003-November/000168.html

Some of the -mm trees have supposedly had a similar workaround in them,
but it might have been removed due to other side effects.

> And tmpfs is really what you want at the early boot stage: it's small
> (less than one page IIRC), it has absolutely no overhead, it's completely
> stored in virtual memory, and it occupies only memory for the files
> it contains.

I think it's also the case that when root does get mounted on top of
the initramfs, any files left in the unpacked initramfs may be
inaccessible but occupying memory.  So if you have a large initramfs
you might have to actually delete the files prior to the mount if you want
to free up the space.

                                                  -Dave Dodge



More information about the uClibc mailing list