diff mbox series

[2/3] kernel-fitImage.bbclass: Handle possible multiconfig.

Message ID 20250206142603.3870360-4-daniel.mueller@karlstorz.com
State New
Headers show
Series Fix incorrect dependencies between multiconfigs | expand

Commit Message

Mueller, Daniel Feb. 6, 2025, 2:22 p.m. UTC
From: "Weisser, Pascal" <pascal.weisser.ext@karlstorz.com>

When specifying the dependencies of do_assemble_fitimage_initramfs the
initramfs image might be built with another multiconfig. This needs to be
handled.

The path of the initramfs image also needs to be adapted to handle the
case when it's built with another multiconfig.

Signed-off-by: Mueller, Daniel <daniel.mueller@karlstorz.com>
---
 meta/classes-recipe/kernel-fitimage.bbclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass
index fe076badfa..48110a76d0 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -39,7 +39,13 @@  python __anonymous () {
 
     image = d.getVar('INITRAMFS_IMAGE')
     if image:
-        d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
+        if d.getVar('INITRAMFS_MULTICONFIG'):
+            mc = d.getVar('BB_CURRENT_MC')
+            if mc == 'default':
+                mc = ''
+            d.appendVarFlag('do_assemble_fitimage_initramfs', 'mcdepends', ' mc:' + mc + ':${INITRAMFS_MULTICONFIG}:${INITRAMFS_IMAGE}:do_image_complete')
+        else:
+            d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
 
     ubootenv = d.getVar('UBOOT_ENV')
     if ubootenv:
@@ -632,7 +638,7 @@  fitimage_assemble() {
 		# Find and use the first initramfs image archive type we find
 		found=
 		for img in ${FIT_SUPPORTED_INITRAMFS_FSTYPES}; do
-			initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img"
+			initramfs_path="${INITRAMFS_DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img"
 			if [ -e "$initramfs_path" ]; then
 				bbnote "Found initramfs image: $initramfs_path"
 				found=true