Kevin P. Fleming wrote:

IIRC, the kernel does not keep the compressed initramfs image in memory, but unpacks it into initramfs at load time.

Even though the initramfs image is built in to the kernel itself? Does the kernel drop the compressed image from memory after it has unpacked it? If so, that's great.


Everything I have read so
far has said that the unpacked items sitting in memory are never reclaimed, although I don't know specifically what would happen if you deleted them.

Correct. And unless you specifically mount something else over root, they all just stay right there. See my note below.



Keep in mind, though, that any program that wants to
delete them has to do it _before_ the root filesystem is mounted; once that happens the initramfs is no longer visible anywhere (except as remnants in /proc/mounts) and nothing can be deleted from it.

But at least with my cd, there never is a root system mounted after the initramfs. With the current ones, if you 'ls /' you'll see the init. (The next iso will delete the init via the bootscripts). That's the same init that's packaged into the initramfs and that the kernel runs after it's unpacked the initramfs to memory. When my init is done setting up the filesystem in the initramfs and mounting the cd/symlinking dirs, it finally spawns a new process: /.cdrom/sbin/init, which is the real sysvinit. In my cd '/' *is* the initramfs. Which is why I need to remind people *not* to do silly stuff like unpack sources in /root.


--
Jeremy H.
--
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to