User: Password:
Subscribe / Log in / New account

Embedded Linux: Small Root Filesystems

Embedded Linux: Small Root Filesystems

Posted Nov 26, 2006 0:31 UTC (Sun) by giraffedata (subscriber, #1954)
In reply to: Embedded Linux: Small Root Filesystems by nix
Parent article: Embedded Linux: Small Root Filesystems

initrd and initramfs are separate things and work quite differently. Notably, initrds are whole filesystem images, so once you're done with them you have to get rid of them (hence the nasty pivot_root(2) kludge ...

I don't get the distinction. First of all, there's some confusion because "filesystem image" means two different things.

On the one hand, it's the entity that you create when you mount and destroy when you unmount, and by that definition the rootfs filesystem image (which gets loaded with files from a cpio archive) doesn't seem any less whole to me than the initrd filesystem image. pivot_root() allows you to unmount an initrd filesystem, thus destroying it and freeing its memory as well as removing its names from the namespace. Why don't you need to do that with initramfs?

In its other meaning, a filesystem image is a copy of the bits that make up a filesystem, such as what the boot loader uses to convey initrd contents to a 2.4 kernel. Pivoting has nothing to do with getting rid of that kind of filesystem image. And it's equivalent to "getting rid of" the cpio archive used with initramfs.

(Log in to post comments)

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds