diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 19:58:56 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 20:03:27 +0000 |
| commit | d79d3d2a449054b700f66fe04532f11c1c72c65a (patch) | |
| tree | ea3d2eee1ef3d80978e9dbbe70d95a26f0157852 /classes/container-cross-install.bbclass | |
| parent | ed5b33932e5f9ad8dc530a53fddfc865fc60d60c (diff) | |
| download | meta-virtualization-d79d3d2a449054b700f66fe04532f11c1c72c65a.tar.gz | |
vcontainer: fix yocto-check-layer mcdepends parse error
Fix yocto-check-layer failure:
ERROR: Multiconfig dependency mc::vruntime-x86-64:vpdmn-initramfs-create:do_deploy
depends on nonexistent multiconfig configuration named configuration vruntime-x86-64
Several recipes and classes declared static mcdepends referencing
vruntime-aarch64 and vruntime-x86-64 multiconfigs. When parsed without
BBMULTICONFIG set (e.g. yocto-check-layer), BitBake validates these and
fails because the referenced multiconfigs don't exist.
Move mcdepends into anonymous python functions and only set them when
the target multiconfig exists in BBMULTICONFIG, following the pattern
established in meta/classes-recipe/kernel-fit-image.bbclass.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'classes/container-cross-install.bbclass')
| -rw-r--r-- | classes/container-cross-install.bbclass | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/classes/container-cross-install.bbclass b/classes/container-cross-install.bbclass index 2ae25d9b..05a40abb 100644 --- a/classes/container-cross-install.bbclass +++ b/classes/container-cross-install.bbclass | |||
| @@ -144,17 +144,20 @@ DEPENDS += "vcontainer-native coreutils-native" | |||
| 144 | VRUNTIME_MULTICONFIG = "${@get_vruntime_multiconfig(d)}" | 144 | VRUNTIME_MULTICONFIG = "${@get_vruntime_multiconfig(d)}" |
| 145 | VRUNTIME_MACHINE = "${@get_vruntime_machine(d)}" | 145 | VRUNTIME_MACHINE = "${@get_vruntime_machine(d)}" |
| 146 | 146 | ||
| 147 | # Use mcdepends to automatically build vdkr/vpdmn blobs via multiconfig | ||
| 148 | # This ensures blobs are built as part of the normal Yocto build flow | ||
| 149 | # Requires BBMULTICONFIG = "vruntime-aarch64 vruntime-x86-64" in local.conf | ||
| 150 | do_rootfs[mcdepends] = "mc::${VRUNTIME_MULTICONFIG}:vdkr-initramfs-create:do_deploy mc::${VRUNTIME_MULTICONFIG}:vpdmn-initramfs-create:do_deploy" | ||
| 151 | |||
| 152 | # Generate dependencies for BUNDLED_CONTAINERS at parse time | 147 | # Generate dependencies for BUNDLED_CONTAINERS at parse time |
| 153 | # Format: name:runtime[:autostart][:external] | 148 | # Format: name:runtime[:autostart][:external] |
| 154 | # - If :external present, no dependency generated (third-party blob) | 149 | # - If :external present, no dependency generated (third-party blob) |
| 155 | # - If name ends in -oci, derive recipe name and generate dependency | 150 | # - If name ends in -oci, derive recipe name and generate dependency |
| 156 | # - Otherwise, generate dependency on name:do_image_complete | 151 | # - Otherwise, generate dependency on name:do_image_complete |
| 157 | python __anonymous() { | 152 | python __anonymous() { |
| 153 | # Conditionally set mcdepends when vruntime multiconfig is configured | ||
| 154 | # (avoids parse errors when BBMULTICONFIG is not set, e.g. yocto-check-layer) | ||
| 155 | vruntime_mc = d.getVar('VRUNTIME_MULTICONFIG') | ||
| 156 | bbmulticonfig = (d.getVar('BBMULTICONFIG') or "").split() | ||
| 157 | if vruntime_mc and vruntime_mc in bbmulticonfig: | ||
| 158 | d.setVarFlag('do_rootfs', 'mcdepends', | ||
| 159 | 'mc::%s:vdkr-initramfs-create:do_deploy mc::%s:vpdmn-initramfs-create:do_deploy' % (vruntime_mc, vruntime_mc)) | ||
| 160 | |||
| 158 | bundled = (d.getVar('BUNDLED_CONTAINERS') or "").split() | 161 | bundled = (d.getVar('BUNDLED_CONTAINERS') or "").split() |
| 159 | if not bundled: | 162 | if not bundled: |
| 160 | return | 163 | return |
