From 609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Thu, 22 Aug 2013 18:04:27 -0500 Subject: kernel.bbclass, image.bbclass: Implement kernel INITRAMFS dependency and bundling This patch aims to fix the following two cases for the INITRAMFS generation. 1) Allow an image recipe to specify a paired INITRAMFS recipe such as core-image-minimal-initramfs. This allows building a base image which always generates the needed initramfs image in one step 2) Allow building a single binary which contains a kernel and the initramfs. A key requirement of the initramfs is to be able to add kernel modules. The current implementation of the INITRAMFS_IMAGE variable has a circular dependency when using kernel modules in the initramfs image.bb file that is caused by kernel.bbclass trying to build the initramfs before the kernel's do_install rule. The solution for this problem is to have the kernel's do_bundle_initramfs_image task depend on the do_rootfs from the INITRAMFS_IMAGE and not some intermediate point. The image.bbclass will also sets up dependencies to make the initramfs creation task run last. The code to bundle the kernel and initramfs together has been added. At a high level, all it is doing is invoking a second compilation of the kernel but changing the value of CONFIG_INITRAMFS_SOURCE to point to the generated initramfs from the image recipe. [YOCTO #4072] Signed-off-by: Jason Wessel Acked-by: Bruce Ashfield Signed-off-by: Saul Wold --- meta/conf/local.conf.sample | 1 + meta/conf/local.conf.sample.extended | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'meta/conf') diff --git a/meta/conf/local.conf.sample b/meta/conf/local.conf.sample index 2b078d081e..4030492c89 100644 --- a/meta/conf/local.conf.sample +++ b/meta/conf/local.conf.sample @@ -145,6 +145,7 @@ EXTRA_IMAGE_FEATURES = "debug-tweaks" # NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended USER_CLASSES ?= "buildstats image-mklibs image-prelink" + # # Runtime testing of images # diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended index 23a79dcc26..1db1a0b87c 100644 --- a/meta/conf/local.conf.sample.extended +++ b/meta/conf/local.conf.sample.extended @@ -237,3 +237,25 @@ FORTRAN_forcevariable = ",fortran" RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath libgfortran" export BUILD_FC = "${CCACHE}${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}" export FC = "${CCACHE}${HOST_PREFIX}gfortran ${HOST_CC_ARCH}" + +# +# Kernel image features +# +# The INITRAMFS_IMAGE image variable will cause an additional recipe to +# be built as a dependency to the what ever rootfs recipe you might be +# using such as core-image-sato. The initramfs might be needed for +# the initial boot of of the target system such as to load kernel +# modules prior to mounting the root file system. +# +# INITRAMFS_IMAGE_BUNDLE variable controls if the image recipe +# specified by the INITRAMFS_IMAGE will be run through an extra pass +# through the kernel compilation in order to build a single binary +# which contains both the kernel image and the initramfs. The +# combined binary will be deposited into the tmp/deploy directory. +# NOTE: You can set INITRAMFS_IMAGE in an image recipe, but +# INITRAMFS_IMAGE_BUNDLE can only be set in a conf file. +# +#INITRAMFS_IMAGE = "core-image-minimal-initramfs" +#INITRAMFS_IMAGE_BUNDLE = "1" + + -- cgit v1.2.3