]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
image_types_wic.bbclass: add depend on initramfs
authorAdrian Freihofer <adrian.freihofer@siemens.com>
Sun, 22 Feb 2026 12:07:35 +0000 (13:07 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Feb 2026 11:39:04 +0000 (11:39 +0000)
When the wic image creation requires an initramfs image that is not bundled
with the kernel (INITRAMFS_IMAGE_BUNDLE != "1"), ensure that the initramfs
image is built before attempting to create the wic image by adding an
explicit dependency on do_image_complete.

Previously, this dependency was incorrectly handled by kernel.bbclass.
This change moves the responsibility to image_types_wic.bbclass where
it belongs.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/image_types_wic.bbclass

index 675aa97513670449c3034de94065451610d6e9a8..aea61d67e3eda5a00d248105c5e0c895bc235645 100644 (file)
@@ -190,6 +190,18 @@ python () {
                 d.setVar('_WKS_TEMPLATE', body)
                 bb.build.addtask('do_write_wks_template', 'do_image_wic', 'do_image', d)
         bb.build.addtask('do_image_wic', 'do_image_complete', None, d)
+
+        # If the INITRAMFS_IMAGE is set and the INITRAMFS_IMAGE_BUNDLE is set to 1, the initramfs
+        # image is expected to be built as part of the kernel. Otherwise, the standalone image
+        # must be requestd to be in the deployed artifacts for the wic image to be built.
+        initramfs_image = d.getVar('INITRAMFS_IMAGE')
+        if initramfs_image and not bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')):
+            initramfs_multiconfig = d.getVar('INITRAMFS_MULTICONFIG')
+            if initramfs_multiconfig:
+                d.appendVarFlag('do_image_wic', 'mcdepends', ' mc:%s:%s:%s:do_image_complete' %
+                                (d.getVar('BB_CURRENT_MC'), initramfs_multiconfig, initramfs_image))
+            else:
+                d.appendVarFlag('do_image_wic', 'depends', ' %s:do_image_complete' % initramfs_image)
 }
 
 #