From 95c73d34ee73fc7522bcfcb8f28570df14df1bbd Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Wed, 16 May 2018 14:40:54 -0700 Subject: dev-manual: Moved "Building an Initial RAM Filesystem (initramfs) Image" This section now belongs under the parent "building" section in the common tasks chapter. (From yocto-docs rev: dad6029b9b45fd6ec564894ba101991fd8a2162e) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 244 +++++++++------------ 1 file changed, 105 insertions(+), 139 deletions(-) (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 14e30de039..63b758a569 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -5420,6 +5420,108 @@ + +
+ Building an Initial RAM Filesystem (initramfs) Image + + + An initial RAM filesystem (initramfs) image provides a temporary + root filesystem used for early system initialization (e.g. + loading of modules needed to locate and mount the "real" root + filesystem). + + The initramfs image is the successor of initial RAM disk + (initrd). + It is a "copy in and out" (cpio) archive of the initial + filesystem that gets loaded into memory during the Linux + startup process. + Because Linux uses the contents of the archive during + initialization, the initramfs image needs to contain all of the + device drivers and tools needed to mount the final root + filesystem. + + + + + Follow these steps to create an initramfs image: + + + Create the initramfs Image Recipe: + You can reference the + core-image-minimal-initramfs.bb + recipe found in the meta/recipes-core + directory of the + Source Directory + as an example from which to work. + + + Decide if You Need to Bundle the initramfs Image + Into the Kernel Image: + If you want the initramfs image that is built to be + bundled in with the kernel image, set the + INITRAMFS_IMAGE_BUNDLE + variable to "1" in your local.conf + configuration file and set the + INITRAMFS_IMAGE + variable in the recipe that builds the kernel image. + Tip + It is recommended that you do bundle the initramfs + image with the kernel image to avoid circular + dependencies between the kernel recipe and the + initramfs recipe should the initramfs image + include kernel modules. + + Setting the INITRAMFS_IMAGE_BUNDLE + flag causes the initramfs image to be unpacked + into the ${B}/usr/ directory. + The unpacked initramfs image is then passed to the kernel's + Makefile using the + CONFIG_INITRAMFS_SOURCE + variable, allowing the initramfs image to be built into + the kernel normally. + + If you choose to not bundle the initramfs image with + the kernel image, you are essentially using an + Initial RAM Disk (initrd). + Creating an initrd is handled primarily through the + INITRD_IMAGE, + INITRD_LIVE, and + INITRD_IMAGE_LIVE variables. + For more information, see the + image-live.bbclass + file. + + + + Optionally Add Items to the initramfs Image + Through the initramfs Image Recipe: + 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. + + + Build the Kernel Image and the initramfs + Image: + Build your kernel image using BitBake. + Because the initramfs image recipe is a dependency of the + kernel image, the initramfs image is built as well and + bundled with the kernel image if you used the + INITRAMFS_IMAGE_BUNDLE + variable described earlier. + + + +
@@ -5427,6 +5529,9 @@ + + +
Working With Libraries @@ -7128,145 +7233,6 @@
-
- Building an Initial RAM Filesystem (initramfs) Image - - - An initial RAM filesystem (initramfs) image provides a temporary - root filesystem used for early system initialization (e.g. - loading of modules needed to locate and mount the "real" root - filesystem). - - The initramfs image is the successor of initial RAM disk - (initrd). - It is a "copy in and out" (cpio) archive of the initial - filesystem that gets loaded into memory during the Linux - startup process. - Because Linux uses the contents of the archive during - initialization, the initramfs image needs to contain all of the - device drivers and tools needed to mount the final root - filesystem. - - - - - Follow these steps to create an initramfs image: - - - Create the initramfs Image Recipe: - You can reference the - core-image-minimal-initramfs.bb - recipe found in the meta/recipes-core - directory of the - Source Directory - as an example from which to work. - - - Decide if You Need to Bundle the initramfs Image - Into the Kernel Image: - If you want the initramfs image that is built to be - bundled in with the kernel image, set the - INITRAMFS_IMAGE_BUNDLE - variable to "1" in your local.conf - configuration file and set the - INITRAMFS_IMAGE - variable in the recipe that builds the kernel image. - Tip - It is recommended that you do bundle the initramfs - image with the kernel image to avoid circular - dependencies between the kernel recipe and the - initramfs recipe should the initramfs image - include kernel modules. - - Setting the INITRAMFS_IMAGE_BUNDLE - flag causes the initramfs image to be unpacked - into the ${B}/usr/ directory. - The unpacked initramfs image is then passed to the kernel's - Makefile using the - CONFIG_INITRAMFS_SOURCE - variable, allowing the initramfs image to be built into - the kernel normally. - - If you choose to not bundle the initramfs image with - the kernel image, you are essentially using an - Initial RAM Disk (initrd). - Creating an initrd is handled primarily through the - INITRD_IMAGE, - INITRD_LIVE, and - INITRD_IMAGE_LIVE variables. - For more information, see the - image-live.bbclass - file. - - - - - Optionally Add Items to the initramfs Image - Through the initramfs Image Recipe: - 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. - - - Build the Kernel Image and the initramfs - Image: - Build your kernel image using BitBake. - Because the initramfs image recipe is a dependency of the - kernel image, the initramfs image is built as well and - bundled with the kernel image if you used the - INITRAMFS_IMAGE_BUNDLE - variable described earlier. - - - -
-
Flashing Images Using <filename>bmaptool</filename> -- cgit v1.2.3-54-g00ecf