diff mbox series

[2/3] qemuboot: Trigger do_write_qemuboot_conf task on bundled initramfs changes

Message ID 20250318104853.1442703-3-pascal.weisser.ext@karlstorz.com
State New
Headers show
Series Resolve YOCTO #14520 and YOCTO #15525. | expand

Commit Message

Weisser, Pascal March 18, 2025, 10:48 a.m. UTC
This change is needed for several reasons:

First, the do_write_qemuboot_conf task needs to access the deployed kernel
symbolic link in DEPLOY_DIR_IMAGE for determining its real path. If the
kernel symbolic link isn't already deployed, its real path cannot be
determined.

Second, an initramfs might be embedded into the kernel. Making changes to
the initramfs doesn't necessarily trigger the do_rootfs task of the file
system that includes the kernel but it triggers the do_deploy task of the
kernel. In order to trigger the do_write_qemuboot_conf task in this case,
too, we need the dependency on the virtual/kernel:do_deploy task.

When the do_write_qemuboot_conf task is triggered, we do not necessarily
need to create a new image, thus, we only demand the task to be executed
before the do_image_complete task.

Fixes: [YOCTO #14520]
Fixes: [YOCTO #15525]

Signed-off-by: Weisser, Pascal <pascal.weisser.ext@karlstorz.com>
---
 meta/classes-recipe/qemuboot.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/qemuboot.bbclass b/meta/classes-recipe/qemuboot.bbclass
index 895fd38d68..163c4085ee 100644
--- a/meta/classes-recipe/qemuboot.bbclass
+++ b/meta/classes-recipe/qemuboot.bbclass
@@ -125,7 +125,7 @@  QB_DRIVE_TYPE ?= "/dev/sd"
 inherit image-artifact-names
 
 # Create qemuboot.conf
-addtask do_write_qemuboot_conf after do_rootfs before do_image
+addtask do_write_qemuboot_conf after do_rootfs before do_image_complete
 
 def qemuboot_vars(d):
     build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
@@ -134,6 +134,7 @@  def qemuboot_vars(d):
                 'STAGING_DIR_HOST', 'SERIAL_CONSOLES', 'UNINATIVE_LOADER']
     return build_vars + [k for k in d.keys() if k.startswith('QB_')]
 
+do_write_qemuboot_conf[depends] += "virtual/kernel:do_deploy"
 do_write_qemuboot_conf[vardeps] += "${@' '.join(qemuboot_vars(d))}"
 do_write_qemuboot_conf[vardepsexclude] += "TOPDIR"
 python do_write_qemuboot_conf() {