qemuboot.bbclass: regenerate .qemuboot.conf after do_image
PATCH 1/1 qemuboot.bbclass: regenerate .qemuboot.conf after do_image
do_write_qemuboot_conf was chained after do_rootfs, so it only ran when the rootfs was rebuilt. If only the kernel was rebuilt (or any change that regenerates the image without invalidating the rootfs sstate), the .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix. This caused runqemu to reference mismatched or missing artifacts.
Move the task to run after do_image instead, so the conf file is always consistent with whatever was last deployed.
--- meta/classes-recipe/qemuboot.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/qemuboot.bbclass +1 -1
@@ -127,7 +127,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_image before do_build def qemuboot_vars(d): build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
Signature · 1 line
2.34.1
Quoted 26 lines · Siva Balasubramanian via lists.openembedded.org
do_write_qemuboot_confwas chained afterdo_rootfs, so it only ran when the rootfs was rebuilt. If only the kernel was rebuilt (or any change that regenerates the image without invalidating the rootfs sstate), the .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix. This caused runqemu to reference mismatched or missing artifacts.Move the task to run after
do_imageinstead, so the conf file is always consistent with whatever was last deployed.Signed-off-by Siva Balasubramanian <[email protected]>---
meta/classes-recipe/qemuboot.bbclass | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)meta/classes-recipe/qemuboot.bbclass +0
-0@@ -127,7 +127,7 @@ QB_DRIVE_TYPE ?= "/dev/sd"inherit image-artifact-names
# Create qemuboot.confmeta/classes-recipe/qemuboot.bbclass +1
-1-addtask do_write_qemuboot_conf after do_rootfs before do_image +addtask do_write_qemuboot_conf after do_image before do_build
Quoted 3 lines
defqemuboot_vars(d):
build_vars= ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
Shouldn't we be fixing the task's dependencies so that it runs at the right time anything it references changes?
I'm not really seeing how this will improve things if to use your example, the kernel is rebuilt since you haven't added a dependency on that...
Cheers,
Richard
Thank you for the review.
You are right, the fix needs proper [depends] declarations rather than just reordering. I will look at what the conf file actually references and add the appropriate task dependencies so do_write_qemuboot_conf is correctly invalidated whenever those artifacts change.
Will send a v2 shortly.
Quoted 44 lines · Richard Purdie
Quoted 10 lines · Siva Balasubramanian via lists.openembedded.org
do_write_qemuboot_confwas chained afterdo_rootfs, so it only ran when the rootfs was rebuilt. If only the kernel was rebuilt (or any change that regenerates the image without invalidating the rootfs sstate), the .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix. This caused runqemu to reference mismatched or missing artifacts.Move the task to run after
do_imageinstead, so the conf file is always consistent with whatever was last deployed.Review
Quoted 7 lines
Signed-off-by Siva Balasubramanian <[email protected]>--- meta/classes-recipe/qemuboot.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0b/meta/classes-recipe/qemuboot.bbclass
meta/classes-recipe/qemuboot.bbclass QB_DRIVE_TYPE ?= "/dev/sd" · line 133
Quoted 12 lines
index
56106b1958..47ce16935f100644meta/classes-recipe/qemuboot.bbclass +1
-1@@ -127,7 +127,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_image before do_build def qemuboot_vars(d): build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',Shouldn't we be fixing the task's dependencies so that it runs at the right time anything it references changes?
I'm not really seeing how this will improve things if to use your example, the kernel is rebuilt since you haven't added a dependency on that...
Cheers,
Richard
Signature · 1 line
Sivakumar B
Quoted 8 lines · Siva Balasubramanian via lists.openembedded.org
Thank you for the review.
You are right, the fix needs proper [depends] declarations rather than just reordering. I will look at what the conf file actually references and add the appropriate task dependencies so
do_write_qemuboot_confis correctly invalidated whenever those artifacts change.Will send a v2 shortly.
Just adding a dependency on virtual/kernel or linux-yocto or... it's right either. We have firmware and baremetal components that use QEMU that we depend on as well.
So this dependency mechanism is needed, but it's not as simple as just hard coding Linux.
--Mark
Quoted 63 lines · On Mon, Jun 1, 2026 at 6:28 PM Richard Purdie…
On Mon, 2026-06-01 at 16:53 +0530, Siva Balasubramanian via lists.openembedded.org <http://lists.openembedded.org> wrote:
>do_write_qemuboot_confwas chained afterdo_rootfs, so it only ran > when the rootfs was rebuilt. If only the kernel was rebuilt (or any > change that regenerates the image without invalidating the rootfs > sstate), the .qemuboot.conf was left stale while new image artifacts > were deployed with a new timestamp suffix. This caused runqemu to > reference mismatched or missing artifacts.
>
> Move the task to run afterdo_imageinstead, so the conf file is > always consistent with whatever was last deployed.
>
> Fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=14520
<https://bugzilla.yoctoproject.org/show_bug.cgi?id=14520>
> Signed-off-by: Siva Balasubramanian <[email protected]
<mailto:[email protected]>>
> ---
> meta/classes-recipe/qemuboot.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/qemuboot.bbclass
b/meta/classes-recipe/qemuboot.bbclass
> index56106b1958..47ce16935f100644
> --- a/meta/classes-recipe/qemuboot.bbclass
> +++ b/meta/classes-recipe/qemuboot.bbclass
> @@ -127,7 +127,7 @@QB_DRIVE_TYPE?= "/dev/sd"
> inherit image-artifact-names
>
> # Create qemuboot.conf
> -addtaskdo_write_qemuboot_confafterdo_rootfsbeforedo_image> +addtaskdo_write_qemuboot_confafterdo_imagebeforedo_build>
> defqemuboot_vars(d):
>build_vars= ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',Shouldn't we be fixing the task's dependencies so that it runs at the right time anything it references changes?
I'm not really seeing how this will improve things if to use your example, the kernel is rebuilt since you haven't added a dependency on that...
Cheers,
Richard
Signature · 10 lines
Sivakumar B -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#237834): https://lists.openembedded.org/g/openembedded-core/message/237834 Mute This Topic: https://lists.openembedded.org/mt/119588648/3616948 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
v2 sent. Used KERNEL_DEPLOY_DEPEND which is already used by do_build[depends] in image.bbclass for the same reason.
Tested on qemux86-64, linux-yocto 6.18.33 do_write_qemuboot_conf reruns correctly after kernel rebuild.
https://lists.openembedded.org/g/openembedded-core/topic/patch_v2_qemuboot_bbclass/119596210
Quoted 62 lines · Siva Kumar Balasubramanian
Thank you for the review.
You are right, the fix needs proper [depends] declarations rather than just reordering. I will look at what the conf file actually references and add the appropriate task dependencies so
do_write_qemuboot_confis correctly invalidated whenever those artifacts change.Will send a v2 shortly.
Quoted 36 lines · Richard Purdie
Quoted 10 lines · Siva Balasubramanian via lists.openembedded.org
do_write_qemuboot_confwas chained afterdo_rootfs, so it only ran when the rootfs was rebuilt. If only the kernel was rebuilt (or any change that regenerates the image without invalidating the rootfs sstate), the .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix. This caused runqemu to reference mismatched or missing artifacts.Move the task to run after
do_imageinstead, so the conf file is always consistent with whatever was last deployed.Review
Quoted 7 lines
Signed-off-by Siva Balasubramanian <[email protected]>--- meta/classes-recipe/qemuboot.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0b/meta/classes-recipe/qemuboot.bbclass
meta/classes-recipe/qemuboot.bbclass QB_DRIVE_TYPE ?= "/dev/sd" · line 133
Quoted 12 lines
index
56106b1958..47ce16935f100644meta/classes-recipe/qemuboot.bbclass +1
-1@@ -127,7 +127,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_image before do_build def qemuboot_vars(d): build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',Shouldn't we be fixing the task's dependencies so that it runs at the right time anything it references changes?
Quoted 8 lines
I'm not really seeing how this will improve things if to use your example, the kernel is rebuilt since you haven't added a dependency on that...
Cheers,
Richard
--
Sivakumar B
Signature · 1 line
Sivakumar B