summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2013-08-22 18:04:27 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-06 23:04:47 +0100
commit0fa12e44663c9e27de7d2c33be9132127679d0d3 (patch)
treef53799785bce2e509b3175cabd8646a370497da4 /meta/classes/image.bbclass
parent95d413d03f66299aa7a835e84dd8ce00d623da6d (diff)
downloadpoky-0fa12e44663c9e27de7d2c33be9132127679d0d3.tar.gz
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] (From OE-Core rev: 609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 84f638c099..4a0946c8e3 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -130,6 +130,10 @@ python () {
130 d.setVar('MULTILIB_VENDORS', ml_vendor_list) 130 d.setVar('MULTILIB_VENDORS', ml_vendor_list)
131 131
132 check_image_features(d) 132 check_image_features(d)
133 initramfs_image = d.getVar('INITRAMFS_IMAGE', True) or ""
134 if initramfs_image != "":
135 d.appendVarFlag('do_build', 'depends', " %s:do_bundle_initramfs" % d.getVar('PN', True))
136 d.appendVarFlag('do_bundle_initramfs', 'depends', " %s:do_rootfs" % initramfs_image)
133} 137}
134 138
135# 139#
@@ -629,3 +633,11 @@ do_package_write_deb[noexec] = "1"
629do_package_write_rpm[noexec] = "1" 633do_package_write_rpm[noexec] = "1"
630 634
631addtask rootfs before do_build 635addtask rootfs before do_build
636# Allow the kernel to be repacked with the initramfs and boot image file as a single file
637do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs"
638do_bundle_initramfs[nostamp] = "1"
639do_bundle_initramfs[noexec] = "1"
640do_bundle_initramfs () {
641 :
642}
643addtask bundle_initramfs after do_rootfs