From 1e51b7173aab728386b8ea1c78f17a53d065b36d Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 29 Dec 2016 10:26:15 -0800 Subject: dev-manual, ref-manual: Created new section on initramfs Fixes [YOCTO #7096] We did not document how to create an initramfs image to be included with a kernel build. Various variables sort of inferred the knowledge. I created a new section in the "Common Tasks" section of the dev-manual that describes how to create an initramfs image. Also, I updated the kernel.bbclass reference section to point back to the new "how-to" section. Finally, I also created a bunch of cross-reference links from various related variables back to the new "how-to" section. (From yocto-docs rev: a14e550494641c46ac2518632cbf251e07d459fd) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'documentation/dev-manual') diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 603ca1ff8e..f3f2a4b026 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -5475,6 +5475,79 @@ +
+ Building an Initial RAM Filesystem (initramfs) Image + + + initramfs is the successor of Initial RAM Disk (initrd). + It is a "copy in and out" (cpio) archive of the initial file system + that gets loaded into memory during the Linux startup process. + Because Linux uses the contents of the archive during + initialization, the initramfs needs to contain all of the device + drivers and tools needed to mount the final root filesystem. + + + + To build an initramfs image and bundle it into the kernel, set the + following variables: + + INITRAMFS_IMAGE_BUNDLE = "1" + INITRAMFS_IMAGE = "image_recipe_name" + + Setting the + INITRAMFS_IMAGE_BUNDLE + flag causes the initramfs created by the recipe + and defined by + INITRAMFS_IMAGE + to be unpacked into the ${B}/usr/ directory. + The unpacked initramfs is then passed to the kernel's + Makefile using the + CONFIG_INITRAMFS_SOURCE + variable, allowing initramfs to be built in to the kernel + normally. + + The preferred method is to use the + INITRAMFS_IMAGE variable rather than the + INITRAMFS_TASK variable. + Setting INITRAMFS_TASK is supported for + backward compatibility. + However, use of this variable has circular dependency + problems. + See the + INITRAMFS_IMAGE_BUNDLE + variable for additional information on these dependency + problems. + + + + + The recipe that INITRAMFS_IMAGE + points to must produce a .cpio.gz, + .cpio.tar, .cpio.lz4, + .cpio.lzma, or + .cpio.xz file. + You can ensure you produce one of these .cpio.* + files by setting the + IMAGE_FSTYPES + variable in your configuration file to one or more of the above + file types. + + If you add items to the initramfs image by way of its recipe, + you should use + PACKAGE_INSTALL + rather than + IMAGE_INSTALL. + PACKAGE_INSTALL gives more direct control + of what is added to the image as compared to the defaults you + might not necessarily want that are set by the + image + or + core-image + classes. + + +
+
Configuring the Kernel -- cgit v1.2.3-54-g00ecf