installer-add-rootfs: build target image for image data postfix

Message ID 20251016143650.1875846-1-clara.kowalsky@siemens.com
State Under Review
Headers show
Series installer-add-rootfs: build target image for image data postfix | expand

Commit Message

Clara Kowalsky Oct. 16, 2025, 2:36 p.m. UTC
Even if the image data postfix was set to something other than wic*, the
do_image_wic task was executed for the target image. This fixes this
issue and invokes the correct corresponding task.

Signed-off-by: Clara Kowalsky <clara.kowalsky@siemens.com>
---
 meta-isar/classes/installer-add-rootfs.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta-isar/classes/installer-add-rootfs.bbclass b/meta-isar/classes/installer-add-rootfs.bbclass
index c738f690..6708932c 100644
--- a/meta-isar/classes/installer-add-rootfs.bbclass
+++ b/meta-isar/classes/installer-add-rootfs.bbclass
@@ -44,9 +44,14 @@  def get_mc_depends(d, task):
     installer_target_mc = d.getVar('INSTALLER_TARGET_MC') or ""
     return f"mc:{installer_mc}:{installer_target_mc}:{installer_target_image}:{task}"
 
+def get_image_type(suffix):
+    image_type = suffix.split(".")[0]
+    return f"{image_type}"
+
 ROOTFS_ADDITIONAL_FILE_installer-target[source] = "${@ get_installer_source(d, d.getVar('IMAGE_DATA_POSTFIX'))}"
 ROOTFS_ADDITIONAL_FILE_installer-target[destination] = "${@ get_installer_destination(d, d.getVar('IMAGE_DATA_POSTFIX'))}"
 ROOTFS_ADDITIONAL_FILE_installer-target-bmap[source] = "${@ get_installer_source(d, "wic.bmap")}"
 ROOTFS_ADDITIONAL_FILE_installer-target-bmap[destination] = "${@ get_installer_destination(d, "wic.bmap")}"
 
-do_rootfs_install[mcdepends] += "${@ get_mc_depends(d, "do_image_wic")}"
+INSTALLER_TARGET_TASK ??="do_image_${@ get_image_type(d.getVar('IMAGE_DATA_POSTFIX'))}"
+do_rootfs_install[mcdepends] += "${@ get_mc_depends(d, d.getVar('INSTALLER_TARGET_TASK'))}"