summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-04-14 00:13:26 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-04-14 00:13:26 +0000
commit43fd5f4d512e5950ec63780214f66a835ffd1294 (patch)
tree25b4a6e079c501c60be2ce6da36a426eb3ccf011
parentb9b7e17eae46c6e3e561f3675870be94eea69332 (diff)
downloadmeta-virtualization-43fd5f4d512e5950ec63780214f66a835ffd1294.tar.gz
vcontainer-initramfs-create: fix kernel path for multiconfig builds
The kernel was copied from DEPLOY_DIR_IMAGE which resolves to the main build config's deploy directory — not the multiconfig's. On autobuilder setups with sstate, this caused the kernel to be missing from the vdkr blob directory because: 1. The mcdepends (mc:<mc>::virtual/kernel:do_deploy) depended on the main config's kernel, which may be a different architecture 2. DEPLOY_DIR_IMAGE pointed to the main deploy dir, not the multiconfig's tmp-vruntime-<arch>/deploy/images/<machine>/ Fix by using MC_DEPLOY (the multiconfig's deploy directory) for the kernel path, consistent with how initramfs and rootfs are already copied. Remove the cross-multiconfig mcdepends since the kernel is built as a transitive dependency of the rootfs image within the same multiconfig. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/vcontainer/vcontainer-initramfs-create.inc20
1 files changed, 12 insertions, 8 deletions
diff --git a/recipes-containers/vcontainer/vcontainer-initramfs-create.inc b/recipes-containers/vcontainer/vcontainer-initramfs-create.inc
index 3e22bdb1..1a22c3d4 100644
--- a/recipes-containers/vcontainer/vcontainer-initramfs-create.inc
+++ b/recipes-containers/vcontainer/vcontainer-initramfs-create.inc
@@ -44,12 +44,12 @@ 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 # Conditionally set mcdepends when our multiconfig is configured 47 # The kernel is built as a dependency of the rootfs image within the
48 # (avoids parse errors when BBMULTICONFIG is not set, e.g. yocto-check-layer) 48 # same multiconfig no cross-multiconfig mcdepends needed. The
49 mc = d.getVar('VCONTAINER_MULTICONFIG') 49 # previous mcdepends on mc:<mc>::virtual/kernel:do_deploy was wrong
50 bbmulticonfig = (d.getVar('BBMULTICONFIG') or "").split() 50 # because it depended on the main config's kernel (which may be a
51 if mc in bbmulticonfig: 51 # different architecture) and deployed to DEPLOY_DIR_IMAGE (main
52 d.setVarFlag('do_compile', 'mcdepends', 'mc:%s::virtual/kernel:do_deploy' % mc) 52 # config), not MC_DEPLOY (multiconfig).
53} 53}
54 54
55# Only populate native sysroot, skip target sysroot to avoid libgcc conflicts 55# Only populate native sysroot, skip target sysroot to avoid libgcc conflicts
@@ -141,14 +141,18 @@ do_compile() {
141 # ========================================================================= 141 # =========================================================================
142 # PART 3: COPY KERNEL 142 # PART 3: COPY KERNEL
143 # ========================================================================= 143 # =========================================================================
144 # Use the multiconfig's deploy directory (same as initramfs/rootfs),
145 # not DEPLOY_DIR_IMAGE which may point to the main config's deploy
146 # directory. The kernel is built as a dependency of the rootfs image
147 # within the same multiconfig.
144 bbnote "Copying kernel image..." 148 bbnote "Copying kernel image..."
145 KERNEL_FILE="${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE_INITRAMFS}" 149 KERNEL_FILE="${MC_DEPLOY}/${KERNEL_IMAGETYPE_INITRAMFS}"
146 if [ -f "${KERNEL_FILE}" ]; then 150 if [ -f "${KERNEL_FILE}" ]; then
147 cp "${KERNEL_FILE}" ${B}/kernel 151 cp "${KERNEL_FILE}" ${B}/kernel
148 KERNEL_SIZE=$(stat -c%s ${B}/kernel) 152 KERNEL_SIZE=$(stat -c%s ${B}/kernel)
149 bbnote "Kernel copied: ${KERNEL_SIZE} bytes ($(expr ${KERNEL_SIZE} / 1024 / 1024)MB)" 153 bbnote "Kernel copied: ${KERNEL_SIZE} bytes ($(expr ${KERNEL_SIZE} / 1024 / 1024)MB)"
150 else 154 else
151 bbwarn "Kernel not found at ${KERNEL_FILE}" 155 bbwarn "Kernel not found at ${KERNEL_FILE} — check that the vruntime multiconfig kernel is built"
152 fi 156 fi
153} 157}
154 158