diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-05 20:44:18 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 03:34:12 +0000 |
| commit | ffa5f611925a0eef7a18ed3ce461f88424604afd (patch) | |
| tree | ffa03f549729117c87429cf348687998251253bc /recipes-containers/vcontainer | |
| parent | 5063d6f0e9e25a8bde17bd3b89ee3f0f88b5f85b (diff) | |
| download | meta-virtualization-ffa5f611925a0eef7a18ed3ce461f88424604afd.tar.gz | |
vcontainer-tarball: build all architectures via single bitbake command
Previously, building vcontainer-tarball required multiple bitbake
invocations or complex command lines to build both x86_64 and aarch64
blobs. This was a usability issue.
Changes:
- mcdepends now triggers builds for BOTH architectures automatically
- VCONTAINER_ARCHITECTURES defaults to "x86_64 aarch64" (was auto-detect)
- Add informational banner at parse time showing what will be built
- Fix duplicate sanity check messages when multiconfig is active
Usage is now simply:
bitbake vcontainer-tarball
To build only one architecture, set in local.conf:
VCONTAINER_ARCHITECTURES = "x86_64"
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/vcontainer')
| -rw-r--r-- | recipes-containers/vcontainer/vcontainer-tarball.bb | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/recipes-containers/vcontainer/vcontainer-tarball.bb b/recipes-containers/vcontainer/vcontainer-tarball.bb index dc874557..180f3c19 100644 --- a/recipes-containers/vcontainer/vcontainer-tarball.bb +++ b/recipes-containers/vcontainer/vcontainer-tarball.bb | |||
| @@ -86,11 +86,12 @@ VCONTAINER_MC = "${@'vruntime-aarch64' if d.getVar('MACHINE') == 'qemuarm64' els | |||
| 86 | # =========================================================================== | 86 | # =========================================================================== |
| 87 | # Multiconfig dependencies for blobs | 87 | # Multiconfig dependencies for blobs |
| 88 | # =========================================================================== | 88 | # =========================================================================== |
| 89 | # Auto-detect which architectures have blobs available. | 89 | # By default, builds BOTH x86_64 and aarch64 via mcdepends. |
| 90 | # To limit to specific architectures, set in local.conf: | 90 | # To limit to a single architecture, set in local.conf: |
| 91 | # VCONTAINER_ARCHITECTURES = "x86_64" # x86_64 only | 91 | # VCONTAINER_ARCHITECTURES = "x86_64" # x86_64 only |
| 92 | # VCONTAINER_ARCHITECTURES = "aarch64" # aarch64 only | 92 | # VCONTAINER_ARCHITECTURES = "aarch64" # aarch64 only |
| 93 | # VCONTAINER_ARCHITECTURES = "x86_64 aarch64" # both (default if both built) | 93 | # |
| 94 | # Helper function (optional - for auto-detection if needed) | ||
| 94 | def get_available_architectures(d): | 95 | def get_available_architectures(d): |
| 95 | import os | 96 | import os |
| 96 | topdir = d.getVar('TOPDIR') | 97 | topdir = d.getVar('TOPDIR') |
| @@ -108,11 +109,44 @@ def get_available_architectures(d): | |||
| 108 | available.append(d.getVar('VCONTAINER_TARGET_ARCH')) | 109 | available.append(d.getVar('VCONTAINER_TARGET_ARCH')) |
| 109 | return " ".join(sorted(available)) | 110 | return " ".join(sorted(available)) |
| 110 | 111 | ||
| 111 | VCONTAINER_ARCHITECTURES ?= "${@get_available_architectures(d)}" | 112 | # Default to both architectures. Override in local.conf if you only want one: |
| 113 | # VCONTAINER_ARCHITECTURES = "x86_64" | ||
| 114 | # VCONTAINER_ARCHITECTURES = "aarch64" | ||
| 115 | VCONTAINER_ARCHITECTURES ?= "x86_64 aarch64" | ||
| 112 | 116 | ||
| 113 | # Trigger multiconfig blob builds automatically via mcdepends | 117 | # Trigger multiconfig blob builds automatically via mcdepends |
| 114 | # VCONTAINER_MC is set based on MACHINE (qemuarm64 -> vruntime-aarch64, qemux86-64 -> vruntime-x86-64) | 118 | # Build BOTH architectures so a single bitbake command produces a complete SDK |
| 115 | do_populate_sdk[mcdepends] = "mc::${VCONTAINER_MC}:vdkr-initramfs-create:do_deploy mc::${VCONTAINER_MC}:vpdmn-initramfs-create:do_deploy" | 119 | do_populate_sdk[mcdepends] = "\ |
| 120 | mc::vruntime-x86-64:vdkr-initramfs-create:do_deploy \ | ||
| 121 | mc::vruntime-x86-64:vpdmn-initramfs-create:do_deploy \ | ||
| 122 | mc::vruntime-aarch64:vdkr-initramfs-create:do_deploy \ | ||
| 123 | mc::vruntime-aarch64:vpdmn-initramfs-create:do_deploy \ | ||
| 124 | " | ||
| 125 | |||
| 126 | # Print banner at parse time (before builds start) | ||
| 127 | python () { | ||
| 128 | # Only print for main multiconfig (not vruntime-* multiconfigs) | ||
| 129 | mc = d.getVar('BB_CURRENT_MC') or '' | ||
| 130 | if mc == '' and d.getVar('BB_WORKERCONTEXT') != '1': | ||
| 131 | archs = d.getVar('VCONTAINER_ARCHITECTURES') | ||
| 132 | bb.plain("") | ||
| 133 | bb.plain("=" * 70) | ||
| 134 | bb.plain("vcontainer-tarball: Building SDK with multiconfig dependencies") | ||
| 135 | bb.plain("") | ||
| 136 | bb.plain(" Architectures: %s" % archs) | ||
| 137 | bb.plain("") | ||
| 138 | bb.plain(" This will automatically build:") | ||
| 139 | for arch in archs.split(): | ||
| 140 | mc_name = "vruntime-aarch64" if arch == "aarch64" else "vruntime-x86-64" | ||
| 141 | bb.plain(" - mc:%s:vdkr-initramfs-create" % mc_name) | ||
| 142 | bb.plain(" - mc:%s:vpdmn-initramfs-create" % mc_name) | ||
| 143 | bb.plain("") | ||
| 144 | bb.plain(" To build only one architecture, set in local.conf:") | ||
| 145 | bb.plain(" VCONTAINER_ARCHITECTURES = \"x86_64\"") | ||
| 146 | bb.plain(" VCONTAINER_ARCHITECTURES = \"aarch64\"") | ||
| 147 | bb.plain("=" * 70) | ||
| 148 | bb.plain("") | ||
| 149 | } | ||
| 116 | 150 | ||
| 117 | # =========================================================================== | 151 | # =========================================================================== |
| 118 | # Custom SDK files - environment script AND blobs/scripts | 152 | # Custom SDK files - environment script AND blobs/scripts |
