On Fri, Aug 5, 2011 at 10:37 PM, William Hubbs <willi...@gentoo.org> wrote: > Hi Rich, > > On Fri, Aug 05, 2011 at 09:04:50PM -0400, Rich Freeman wrote: >> On Fri, Aug 5, 2011 at 8:42 PM, William Hubbs <willi...@gentoo.org> wrote: >> > On Fri, Aug 05, 2011 at 10:06:48PM +0200, Sven Vermeulen wrote: >> >> How does the tool that creates an initramfs know which files to copy from >> >> /usr and /var anyhow? >> > >> > My understanding is that nothing gets copied from /usr and /var, and it >> > doesn't have to. >> > >> > Here is my basic understanding of how the boot sequence works: >> > >> > 1) rootfs is mounted on /. Rootfs contains the contents of the >> > initramfs. >> >> Ok, so the initfs is typically in /boot, though it need not be. It >> needs to be someplace the bootloader can find it, and with grub legacy >> that typically means on a bare hard drive partition, or one using md >> raid-1 with older metadata. The initramfs doesn't need to find itself >> - the bootloader loads it into ram and passes its address to the >> kernel when executing it. > > Not quite. It is actually inside the kernel binary. You are thinking of > an initrd. > > Look at these files: > > /usr/src/linux/Documentation/filesystems/ramfs-rootfs-initramfs.txt. > /usr/src/linux/Documentation/early-userspace/README >
The initramfs cpio archive does not HAVE to be inside the kernel binary. It may be assembled as a separate file (perhaps in /boot), and passed to the kernel by the bootloader, just as Rich describes. See the section "External initramfs images" in ramfs-rootfs-initramfs.txt.