Re: want to clarify a couple things about initramfs

2016-06-19 Thread Nathan Williams
On Sun, 2016-06-19 at 09:55 -0400, Robert P. J. Day wrote:
>   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.

Hi Robert,

Yes I believe the documentation is still accurate. An initramfs image
can either be linked into the kernel image, or passed to the kernel by
the bootloader (e.g. U-Boot)

I use Buildroot to build a kernel with an embedded rootfs that has all
the tools I need for testing an embedded system. I've also used
Buildroot to make a cpio archive of the root filesystem and used that as
an external initramfs.

Nathan


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


want to clarify a couple things about initramfs

2016-06-19 Thread Robert P. J. Day

  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
diagnostics.

  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
recompiling."


  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.

  thoughts?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

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



___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies