diff options
| -rw-r--r-- | recipes-containers/vcontainer/vcontainer-initramfs-create.inc | 20 |
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 | ||
