want to clarify a couple things about initramfs

Robert P. J. Day rpjday at crashcourse.ca
Sun Jun 19 09:55:11 EDT 2016

  for the first time, i'm going to dive into the kernel support for
initramfs, so i'll start with a couple questions.

  first, i note that the Doc file ramfs-rootfs-initramfs.txt seems(?)
a bit dated, in that it refers to the 2.6 kernel, but it may just mean
that it's relevant for 2.6 and everything newer, so it may be just
fine, i guess i'll find out eventually.

  next (and possibly a silly question), i know that the primary(?)
purpose of an initramfs is to load an early rootfs to get access to
kernel modules, after which one tosses away the initramfs and mounts
the "real" rootfs. but i'm pretty sure i have the right to build a
kernel with enough of an initramfs that i can run off that embedded
initramfs entirely out of RAM if all i want to do is, say, basic

  next, from the Doc file, i see the possibility of a second
(external) initramfs:

External initramfs images:

If the kernel has initrd support enabled, an external cpio.gz archive can also
be passed into a 2.6 kernel in place of an initrd.  In this case, the kernel
will autodetect the type (initramfs, not initrd) and extract the external cpio
archive into rootfs before trying to run /init.

This has the memory efficiency advantages of initramfs (no ramdisk block
device) but the separate packaging of initrd (which is nice if you have
non-GPL code you'd like to run from initramfs, without conflating it with
the GPL licensed Linux kernel binary).

It can also be used to supplement the kernel's built-in initramfs image.  The
files in the external archive will overwrite any conflicting files in
the built-in initramfs archive.  Some distributors also prefer to customize
a single kernel image with task-specific initramfs images, without

  is all that still accurate? again, i'm sure i can confirm that once
i start digging through the code. in my case, i don't think i'll need
an external initramfs if i can cram everything i need into the one
embedded in the kernel.




Robert P. J. Day                                 Ottawa, Ontario, CANADA

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

More information about the Kernelnewbies mailing list