summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-04-28 02:36:41 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-04-28 11:49:28 +0000
commitad63ebe65234e4755a152ec5c2d5cf4719847d84 (patch)
tree727fb50734558066cf1f22579f3486144e747d78
parent052241689a0c419d13e15e83e7ad65dd16fc8ffd (diff)
downloadmeta-virtualization-ad63ebe65234e4755a152ec5c2d5cf4719847d84.tar.gz
vcontainer-initramfs-create: fix kernel deploy dependency via do_build
On sstate-accelerated builds, the kernel binary (bzImage/Image) was missing from MC_DEPLOY because do_compile depended on the image recipes' do_image_complete, which runs before do_build. The kernel deploy dependency (virtual/kernel:do_deploy) is attached to do_build in image.bbclass, so depending on do_image_complete cut the chain short and virtual/kernel:do_deploy was never guaranteed to have run. Fix by depending on do_build instead of do_image_complete. The image artifacts (cpio.gz, squashfs) are already in DEPLOY_DIR_IMAGE after do_image_complete, so they remain available. do_build additionally ensures virtual/kernel:do_deploy has completed, placing the kernel in MC_DEPLOY for our do_compile to copy. This avoids adding an explicit virtual/kernel:do_deploy dependency which would couple this recipe to the kernel and prevent use cases where the kernel is provided externally. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/vcontainer/vcontainer-initramfs-create.inc21
1 files changed, 10 insertions, 11 deletions
diff --git a/recipes-containers/vcontainer/vcontainer-initramfs-create.inc b/recipes-containers/vcontainer/vcontainer-initramfs-create.inc
index 1a22c3d4..68011abc 100644
--- a/recipes-containers/vcontainer/vcontainer-initramfs-create.inc
+++ b/recipes-containers/vcontainer/vcontainer-initramfs-create.inc
@@ -44,12 +44,6 @@ python () {
44 d.setVarFlag('do_compile', 'nostamp', '1') 44 d.setVarFlag('do_compile', 'nostamp', '1')
45 d.setVarFlag('do_deploy', 'nostamp', '1') 45 d.setVarFlag('do_deploy', 'nostamp', '1')
46 46
47 # The kernel is built as a dependency of the rootfs image within the
48 # same multiconfig — no cross-multiconfig mcdepends needed. The
49 # previous mcdepends on mc:<mc>::virtual/kernel:do_deploy was wrong
50 # because it depended on the main config's kernel (which may be a
51 # different architecture) and deployed to DEPLOY_DIR_IMAGE (main
52 # config), not MC_DEPLOY (multiconfig).
53} 47}
54 48
55# Only populate native sysroot, skip target sysroot to avoid libgcc conflicts 49# Only populate native sysroot, skip target sysroot to avoid libgcc conflicts
@@ -58,12 +52,17 @@ INHIBIT_DEFAULT_DEPS = "1"
58# Dependencies: 52# Dependencies:
59# 1. The tiny initramfs image (produces cpio.gz) 53# 1. The tiny initramfs image (produces cpio.gz)
60# 2. The multiconfig rootfs image (produces squashfs) 54# 2. The multiconfig rootfs image (produces squashfs)
61# 3. The kernel from main build 55# 3. The kernel (deployed transitively via image.bbclass do_build)
62# 56#
63# Both initramfs and rootfs images are in the same multiconfig 57# Both image recipes inherit core-image/image.bbclass which has:
64do_compile[depends] = "${VCONTAINER_RUNTIME}-tiny-initramfs-image:do_image_complete" 58# do_build[depends] += "virtual/kernel:do_deploy"
65do_compile[depends] += "${VCONTAINER_RUNTIME}-rootfs-image:do_image_complete" 59# By depending on do_build (not do_image_complete), we ensure the
66# mcdepends set conditionally in anonymous python below 60# kernel is deployed to MC_DEPLOY before do_compile copies it.
61# Using do_image_complete cut the chain short — it runs before
62# do_build, so virtual/kernel:do_deploy was not guaranteed to have
63# run, causing missing kernel on sstate-accelerated builds.
64do_compile[depends] = "${VCONTAINER_RUNTIME}-tiny-initramfs-image:do_build"
65do_compile[depends] += "${VCONTAINER_RUNTIME}-rootfs-image:do_build"
67 66
68S = "${UNPACKDIR}" 67S = "${UNPACKDIR}"
69B = "${WORKDIR}/build" 68B = "${WORKDIR}/build"