Skip to contentSkip to conversation

qemuboot.bbclass: add missing task dependency on kernel deploy

PATCH Superseded Siva Balasubramanian 2 participants 4 messages Jun 2 – Jun 12

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 qemuboot.bbclass: add missing task dependency on kernel deploy

do_write_qemuboot_conf had no dependency on the kernel deploy task, so if the kernel was rebuilt without invalidating the rootfs sstate, the task was skipped and .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix.

Add do_write_qemuboot_conf[depends] on KERNEL_DEPLOY_DEPEND using a Python expression to guard against the empty case, since baremetal images (which inherit qemuboot via baremetal-image.bbclass) do not set KERNEL_DEPLOY_DEPEND.

KERNEL_DEPLOY_DEPEND is defined with ?= in image.bbclass and is already used by do_build[depends] for the same reason.

---
 meta/classes-recipe/qemuboot.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes-recipe/qemuboot.bbclass +1 -0
index 56106b1958..639d4bfd9c 100644
@@ -128,6 +128,7 @@ inherit image-artifact-names
 
 # Create qemuboot.conf
 addtask do_write_qemuboot_conf after do_rootfs before do_image
+do_write_qemuboot_conf[depends] += "${@d.getVar('KERNEL_DEPLOY_DEPEND') or ''}"
 
 def qemuboot_vars(d):
     build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Siva Balasubramanian via lists.openembedded.org

do_write_qemuboot_conf had no dependency on the kernel deploy task, so if the kernel was rebuilt without invalidating the rootfs sstate, the task was skipped and .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix.

Add do_write_qemuboot_conf[depends] on KERNEL_DEPLOY_DEPEND using a Python expression to guard against the empty case, since baremetal images (which inherit qemuboot via baremetal-image.bbclass) do not set KERNEL_DEPLOY_DEPEND.

Quoted 6 lines

KERNEL_DEPLOY_DEPEND is defined with ?= in image.bbclass and is already used by do_build[depends] for the same reason.

---

Hi Siva,

Thanks for the new version.

It looks like we still have a failing selftest:

2026-06-02 20:22:55,502 - oe-selftest - INFO - fitimage.KernelFitImageRecipeTests.test_fit_image_sign_initramfs_bundle (subunit.RemotedTestCase)
2026-06-02 20:22:55,503 - oe-selftest - INFO -  ... FAIL

...
Initialising tasks...ERROR: 4014 unbuildable tasks were found.
These are usually caused by circular dependencies and any circular dependency chains found will be printed below. Increase the debug level to see a list of unbuildable tasks.

Identifying dependency loops (this may take a short while)...

ERROR:
Dependency loop #1 found:
Task /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image (dependent Tasks ['core-image-minimal-initramfs.bb:do_flush_pseudodb', 'core-image-minimal-initramfs.bb:do_image_qa', 'core-image-minimal-initramfs.bb:do_write_qemuboot_conf', 'core-image-minimal-initramfs.bb:do_rootfs', 'core-image-minimal-initramfs.bb:do_create_rootfs_spdx']) Task /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_cpio (dependent Tasks ['cpio_2.15.bb:do_populate_sysroot', 'core-image-minimal-initramfs.bb:do_image'])
Task /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_complete (dependent Tasks ['u-boot_2026.04.bb:do_populate_sysroot', 'core-image-minimal-initramfs.bb:do_image_cpio', 'qemu-helper-native_1.0.bb:do_addto_recipe_sysroot', 'core-image-minimal-initramfs.bb:do_image', 'qemu-helper-native_1.0.bb:do_populate_sysroot', 'qemu-native_10.2.0.bb:do_populate_sysroot', 'qemu-system-native_10.2.0.bb:do_populate_sysroot']) Task /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_bundle_initramfs (dependent Tasks ['linux-yocto_6.18.bb:do_install', 'core-image-minimal-initramfs.bb:do_image_complete'])
Task /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_transform_bundled_initramfs (dependent Tasks ['linux-yocto_6.18.bb:do_bundle_initramfs'])
Task /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_deploy (dependent Tasks ['pigz_2.8.bb:do_populate_sysroot', 'linux-yocto_6.18.bb:do_bundle_initramfs', 'linux-yocto_6.18.bb:do_transform_bundled_initramfs', 'linux-yocto_6.18.bb:do_install', 'depmodwrapper-cross_1.0.bb:do_populate_sysroot', 'linux-yocto_6.18.bb:do_packagedata', 'linux-yocto_6.18.bb:do_populate_sysroot']) Task /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_write_qemuboot_conf (dependent Tasks ['core-image-minimal-initramfs.bb:do_rootfs', 'linux-yocto_6.18.bb:do_deploy'])
...

https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4039
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/3951
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3809

Can you have a look at the issue?
The configuration used to reproduce can be found in the "OE Selftest:
Add layers" and "OE Selftest: Write config" steps.

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

Hi Mathieu,

I will look into this and get back to you.

Thanks,
Siva

Quoted 95 lines · Mathieu Dubois-Briand
Quoted 10 lines · Siva Balasubramanian via lists.openembedded.org

do_write_qemuboot_conf had no dependency on the kernel deploy task, so if the kernel was rebuilt without invalidating the rootfs sstate, the task was skipped and .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix.

Add do_write_qemuboot_conf[depends] on KERNEL_DEPLOY_DEPEND using a Python expression to guard against the empty case, since baremetal images (which inherit qemuboot via baremetal-image.bbclass) do not set KERNEL_DEPLOY_DEPEND.

Quoted 6 lines

KERNEL_DEPLOY_DEPEND is defined with ?= in image.bbclass and is already used by do_build[depends] for the same reason.

---

Hi Siva,

Thanks for the new version.

It looks like we still have a failing selftest:

2026-06-02 20:22:55,502 - oe-selftest - INFO -
fitimage.KernelFitImageRecipeTests.test_fit_image_sign_initramfs_bundle
(subunit.RemotedTestCase)
2026-06-02 20:22:55,503 - oe-selftest - INFO -  ... FAIL

...
Initialising tasks...ERROR: 4014 unbuildable tasks were found. These are usually caused by circular dependencies and any circular dependency chains found will be printed below. Increase the debug level to see a list of unbuildable tasks.

Identifying dependency loops (this may take a short while)...

ERROR:
Dependency loop #1 found:
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image (dependent Tasks ['core-image-minimal-initramfs.bb:do_flush_pseudodb',
'core-image-minimal-initramfs.bb:do_image_qa',
'core-image-minimal-initramfs.bb:do_write_qemuboot_conf',
'core-image-minimal-initramfs.bb:do_rootfs',
'core-image-minimal-initramfs.bb:do_create_rootfs_spdx'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_cpio (dependent Tasks ['cpio_2.15.bb:do_populate_sysroot',
'core-image-minimal-initramfs.bb:do_image'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_complete (dependent Tasks ['u-boot_2026.04.bb:do_populate_sysroot',
'core-image-minimal-initramfs.bb:do_image_cpio',
'qemu-helper-native_1.0.bb:do_addto_recipe_sysroot',
'core-image-minimal-initramfs.bb:do_image', 'qemu-helper-native_1.0.bb:do_populate_sysroot', 'qemu-native_10.2.0.bb:do_populate_sysroot', 'qemu-system-native_10.2.0.bb
:do_populate_sysroot'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_bundle_initramfs (dependent Tasks ['linux-yocto_6.18.bb:do_install',
'core-image-minimal-initramfs.bb:do_image_complete'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_transform_bundled_initramfs (dependent Tasks ['linux-yocto_6.18.bb:do_bundle_initramfs'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_deploy (dependent Tasks ['pigz_2.8.bb:do_populate_sysroot', 'linux-yocto_6.18.bb:do_bundle_initramfs', 'linux-yocto_6.18.bb:do_transform_bundled_initramfs',
'linux-yocto_6.18.bb:do_install', 'depmodwrapper-cross_1.0.bb:do_populate_sysroot',
'linux-yocto_6.18.bb:do_packagedata', 'linux-yocto_6.18.bb:
do_populate_sysroot'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_write_qemuboot_conf (dependent Tasks ['core-image-minimal-initramfs.bb:do_rootfs',
'linux-yocto_6.18.bb:do_deploy'])
...

https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4039
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/3951
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3809

Can you have a look at the issue?
The configuration used to reproduce can be found in the "OE Selftest:
Add layers" and "OE Selftest: Write config" steps.

Thanks,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Signature · 1 line
Sivakumar B
#3 lore raw

Hi Mathieu,

The circular dependency occurs because when INITRAMFS_IMAGE_BUNDLE=1, linux-yocto:do_deploy depends on the initramfs image completing first, so adding an unconditional kernel deploy dependency on do_write_qemuboot_conf created a cycle back into the initramfs image.

v4 fixes this by skipping the kernel deploy dependency when INITRAMFS_IMAGE_BUNDLE=1:

do_write_qemuboot_conf[depends] += "${@ '' if
bb.utils.to_boolean(d.getVar('INITRAMFS_IMAGE_BUNDLE')) else (d.getVar('KERNEL_DEPLOY_DEPEND') or '')}"

Tested with INITRAMFS_IMAGE_BUNDLE=1 using bitbake -g — no circular dependency detected.

https://lists.openembedded.org/g/openembedded-core/topic/patch_v4_qemuboot_bbclass/119770767

Thanks,
Siva

Quoted 110 lines · Siva Kumar Balasubramanian

Hi Mathieu,

I will look into this and get back to you.

Thanks,
Siva

Quoted 86 lines · Mathieu Dubois-Briand
Quoted 10 lines · Siva Balasubramanian via lists.openembedded.org

do_write_qemuboot_conf had no dependency on the kernel deploy task, so if the kernel was rebuilt without invalidating the rootfs sstate, the task was skipped and .qemuboot.conf was left stale while new image artifacts were deployed with a new timestamp suffix.

Add do_write_qemuboot_conf[depends] on KERNEL_DEPLOY_DEPEND using a Python expression to guard against the empty case, since baremetal images (which inherit qemuboot via baremetal-image.bbclass) do not set KERNEL_DEPLOY_DEPEND.

Quoted 6 lines

KERNEL_DEPLOY_DEPEND is defined with ?= in image.bbclass and is already used by do_build[depends] for the same reason.

---

Hi Siva,

Thanks for the new version.

It looks like we still have a failing selftest:

2026-06-02 20:22:55,502 - oe-selftest - INFO -
fitimage.KernelFitImageRecipeTests.test_fit_image_sign_initramfs_bundle
(subunit.RemotedTestCase)
2026-06-02 20:22:55,503 - oe-selftest - INFO -  ... FAIL

...
Initialising tasks...ERROR: 4014 unbuildable tasks were found. These are usually caused by circular dependencies and any circular dependency chains found will be printed below. Increase the debug level to see a list of unbuildable tasks.

Identifying dependency loops (this may take a short while)...

ERROR:
Dependency loop #1 found:
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image (dependent Tasks ['core-image-minimal-initramfs.bb:do_flush_pseudodb',
'core-image-minimal-initramfs.bb:do_image_qa',
'core-image-minimal-initramfs.bb:do_write_qemuboot_conf',
'core-image-minimal-initramfs.bb:do_rootfs',
'core-image-minimal-initramfs.bb:do_create_rootfs_spdx'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_cpio (dependent Tasks ['cpio_2.15.bb:do_populate_sysroot',
'core-image-minimal-initramfs.bb:do_image'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_image_complete (dependent Tasks ['u-boot_2026.04.bb:do_populate_sysroot',
'core-image-minimal-initramfs.bb:do_image_cpio',
'qemu-helper-native_1.0.bb:do_addto_recipe_sysroot',
'core-image-minimal-initramfs.bb:do_image', 'qemu-helper-native_1.0.bb:do_populate_sysroot', 'qemu-native_10.2.0.bb:do_populate_sysroot', '
qemu-system-native_10.2.0.bb:do_populate_sysroot'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_bundle_initramfs (dependent Tasks ['linux-yocto_6.18.bb:do_install',
'core-image-minimal-initramfs.bb:do_image_complete'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_transform_bundled_initramfs (dependent Tasks ['linux-yocto_6.18.bb:do_bundle_initramfs'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-kernel/linux/linux-yocto_6.18.bb:do_deploy (dependent Tasks ['pigz_2.8.bb:do_populate_sysroot',
'linux-yocto_6.18.bb:do_bundle_initramfs', 'linux-yocto_6.18.bb:do_transform_bundled_initramfs',
'linux-yocto_6.18.bb:do_install', 'depmodwrapper-cross_1.0.bb:do_populate_sysroot',
'linux-yocto_6.18.bb:do_packagedata', 'linux-yocto_6.18.bb:
do_populate_sysroot'])
Task
/srv/pokybuild/yocto-worker/oe-selftest-armhost/build/layers/openembedded-core/meta/recipes-core/images/core-image-minimal-initramfs.bb:do_write_qemuboot_conf (dependent Tasks ['core-image-minimal-initramfs.bb:do_rootfs',
'linux-yocto_6.18.bb:do_deploy'])
...

https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/4039
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/3951
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3809

Can you have a look at the issue?
The configuration used to reproduce can be found in the "OE Selftest:
Add layers" and "OE Selftest: Write config" steps.

Quoted 9 lines

Thanks,
Mathieu

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

--

Sivakumar B

Signature · 1 line
Sivakumar B