diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-01-05 03:28:17 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-09 03:32:52 +0000 |
| commit | c03fa452f381d54af66c6bc0d0394622c3d3d61f (patch) | |
| tree | f341cba988b577493ec9228ac1c8cb063a10e33f /recipes-containers/vcontainer/README.md | |
| parent | f9f8e294e5d870f28dd65f13ddb43c224be958fc (diff) | |
| download | meta-virtualization-c03fa452f381d54af66c6bc0d0394622c3d3d61f.tar.gz | |
vcontainer: add SDK-based standalone tarball
Add vcontainer-tarball.bb recipe that creates a relocatable standalone
distribution of vdkr and vpdmn container tools using Yocto SDK infrastructure.
Features:
- Auto-detects available architectures from built blobs
- Custom SDK installer with vcontainer-specific messages
- nativesdk-qemu-vcontainer.bb: minimal QEMU without OpenGL deps
Recipe changes:
- DELETE vdkr-native_1.0.bb (functionality moved to SDK)
- DELETE vpdmn-native_1.0.bb (functionality moved to SDK)
- ADD vcontainer-tarball.bb (SDK tarball recipe)
- ADD toolchain-shar-extract.sh (SDK installer template)
- ADD nativesdk-qemu-vcontainer.bb (minimal QEMU for SDK)
Usage:
MACHINE=qemux86-64 bitbake vcontainer-tarball
./tmp/deploy/sdk/vcontainer-standalone.sh -d /opt/vcontainer -y
source /opt/vcontainer/init-env.sh
vdkr images
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/vcontainer/README.md')
| -rw-r--r-- | recipes-containers/vcontainer/README.md | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/recipes-containers/vcontainer/README.md b/recipes-containers/vcontainer/README.md index 4b7b03ed..76d54d18 100644 --- a/recipes-containers/vcontainer/README.md +++ b/recipes-containers/vcontainer/README.md | |||
| @@ -10,8 +10,10 @@ Execute Docker or Podman commands inside a QEMU-emulated target environment. | |||
| 10 | ## Quick Start | 10 | ## Quick Start |
| 11 | 11 | ||
| 12 | ```bash | 12 | ```bash |
| 13 | # Build vdkr | 13 | # Build and install SDK (see "Standalone SDK" section for full instructions) |
| 14 | bitbake vdkr-native | 14 | MACHINE=qemux86-64 bitbake vcontainer-tarball |
| 15 | ./tmp/deploy/sdk/vcontainer-standalone.sh -d /tmp/vcontainer -y | ||
| 16 | source /tmp/vcontainer/init-env.sh | ||
| 15 | 17 | ||
| 16 | # List images (uses host architecture by default) | 18 | # List images (uses host architecture by default) |
| 17 | vdkr images | 19 | vdkr images |
| @@ -190,34 +192,52 @@ vdkr --stateless images # Empty | |||
| 190 | vdkr clean | 192 | vdkr clean |
| 191 | ``` | 193 | ``` |
| 192 | 194 | ||
| 193 | ## Standalone Distribution | 195 | ## Standalone SDK |
| 194 | 196 | ||
| 195 | Create a self-contained redistributable tarball that works without Yocto: | 197 | Create a self-contained redistributable SDK that works without Yocto: |
| 196 | 198 | ||
| 197 | ```bash | 199 | ```bash |
| 198 | # Build the standalone tarball | 200 | # Ensure multiconfig is enabled in local.conf: |
| 199 | MACHINE=qemux86-64 bitbake vdkr-native -c create_tarball | 201 | # BBMULTICONFIG = "vruntime-aarch64 vruntime-x86-64" |
| 200 | 202 | ||
| 201 | # Output: tmp/deploy/vdkr/vdkr-standalone-x86_64.tar.gz | 203 | # Step 1: Build blobs for desired architectures (sequentially to avoid deadlocks) |
| 204 | bitbake mc:vruntime-x86-64:vdkr-initramfs-create mc:vruntime-x86-64:vpdmn-initramfs-create | ||
| 205 | bitbake mc:vruntime-aarch64:vdkr-initramfs-create mc:vruntime-aarch64:vpdmn-initramfs-create | ||
| 206 | |||
| 207 | # Step 2: Build SDK (auto-detects available architectures) | ||
| 208 | MACHINE=qemux86-64 bitbake vcontainer-tarball | ||
| 209 | |||
| 210 | # Output: tmp/deploy/sdk/vcontainer-standalone.sh | ||
| 211 | ``` | ||
| 212 | |||
| 213 | To limit architectures, set in local.conf: | ||
| 214 | ```bash | ||
| 215 | VCONTAINER_ARCHITECTURES = "x86_64" # x86_64 only | ||
| 216 | VCONTAINER_ARCHITECTURES = "aarch64" # aarch64 only | ||
| 217 | VCONTAINER_ARCHITECTURES = "x86_64 aarch64" # both (default if both built) | ||
| 202 | ``` | 218 | ``` |
| 203 | 219 | ||
| 204 | The tarball includes: | 220 | The SDK includes: |
| 205 | - `vdkr` - Main CLI script | 221 | - `vdkr`, `vpdmn` - Main CLI scripts |
| 206 | - `vdkr-aarch64`, `vdkr-x86_64` - Symlinks (only for available architectures) | 222 | - `vdkr-<arch>`, `vpdmn-<arch>` - Symlinks for each included architecture |
| 207 | - `vrunner.sh` - QEMU runner | 223 | - `vrunner.sh` - Shared QEMU runner |
| 208 | - `vdkr-blobs/` - Kernel and initramfs per architecture | 224 | - `vdkr-blobs/`, `vpdmn-blobs/` - Kernel and initramfs per architecture |
| 209 | - `qemu/` - QEMU system emulators with wrapper scripts | 225 | - `sysroots/` - SDK binaries (QEMU, socat, libraries) |
| 210 | - `lib/` - Shared libraries for QEMU | ||
| 211 | - `share/qemu/` - QEMU firmware files | ||
| 212 | - `socat` - Socket communication for memres mode | ||
| 213 | - `init-env.sh` - Environment setup script | 226 | - `init-env.sh` - Environment setup script |
| 214 | 227 | ||
| 215 | Usage: | 228 | Usage: |
| 216 | ```bash | 229 | ```bash |
| 217 | tar -xzf vdkr-standalone-x86_64.tar.gz | 230 | # Install (self-extracting) |
| 218 | cd vdkr-standalone | 231 | ./vcontainer-standalone.sh -d /tmp/vcontainer -y |
| 232 | |||
| 233 | # Or extract tarball directly | ||
| 234 | tar -xf vcontainer-standalone.tar.xz -C /tmp/vcontainer | ||
| 235 | |||
| 236 | # Use | ||
| 237 | cd /tmp/vcontainer | ||
| 219 | source init-env.sh | 238 | source init-env.sh |
| 220 | vdkr images | 239 | vdkr-x86_64 images |
| 240 | vdkr-aarch64 images | ||
| 221 | ``` | 241 | ``` |
| 222 | 242 | ||
| 223 | ## Interactive Mode | 243 | ## Interactive Mode |
| @@ -297,13 +317,13 @@ vdkr rm -f debug | |||
| 297 | See `tests/README.md` for the pytest-based test suite: | 317 | See `tests/README.md` for the pytest-based test suite: |
| 298 | 318 | ||
| 299 | ```bash | 319 | ```bash |
| 300 | # Build standalone tarball | 320 | # Build and install SDK |
| 301 | MACHINE=qemux86-64 bitbake vdkr-native -c create_tarball | 321 | MACHINE=qemux86-64 bitbake vcontainer-tarball |
| 322 | ./tmp/deploy/sdk/vcontainer-standalone.sh -d /tmp/vcontainer -y | ||
| 302 | 323 | ||
| 303 | # Extract and run tests | 324 | # Run tests |
| 304 | cd /tmp && tar -xzf .../vdkr-standalone-x86_64.tar.gz | ||
| 305 | cd /opt/bruce/poky/meta-virtualization | 325 | cd /opt/bruce/poky/meta-virtualization |
| 306 | pytest tests/test_vdkr.py -v --vdkr-dir /tmp/vdkr-standalone | 326 | pytest tests/test_vdkr.py -v --vdkr-dir /tmp/vcontainer |
| 307 | ``` | 327 | ``` |
| 308 | 328 | ||
| 309 | ## vpdmn (Podman) | 329 | ## vpdmn (Podman) |
| @@ -331,9 +351,7 @@ Key differences from vdkr: | |||
| 331 | 351 | ||
| 332 | | Recipe | Purpose | | 352 | | Recipe | Purpose | |
| 333 | |--------|---------| | 353 | |--------|---------| |
| 334 | | `vdkr-native_1.0.bb` | Main vdkr (Docker) CLI and blobs | | 354 | | `vcontainer-tarball.bb` | Standalone SDK with vdkr and vpdmn | |
| 335 | | `vpdmn-native_1.0.bb` | Main vpdmn (Podman) CLI and blobs | | ||
| 336 | | `vcontainer-native_1.0.bb` | Unified tarball with both tools | | ||
| 337 | | `vdkr-initramfs-create_1.0.bb` | Build vdkr initramfs blobs | | 355 | | `vdkr-initramfs-create_1.0.bb` | Build vdkr initramfs blobs | |
| 338 | | `vpdmn-initramfs-create_1.0.bb` | Build vpdmn initramfs blobs | | 356 | | `vpdmn-initramfs-create_1.0.bb` | Build vpdmn initramfs blobs | |
| 339 | 357 | ||
| @@ -347,18 +365,16 @@ Key differences from vdkr: | |||
| 347 | | `vdkr-init.sh` | Docker init script (baked into initramfs) | | 365 | | `vdkr-init.sh` | Docker init script (baked into initramfs) | |
| 348 | | `vpdmn-init.sh` | Podman init script (daemonless) | | 366 | | `vpdmn-init.sh` | Podman init script (daemonless) | |
| 349 | 367 | ||
| 350 | ## Testing | 368 | ## Testing Both Tools |
| 351 | 369 | ||
| 352 | ```bash | 370 | ```bash |
| 353 | # Build unified standalone tarball | 371 | # Build and install SDK (includes both vdkr and vpdmn) |
| 354 | bitbake vcontainer-native -c create_tarball | 372 | MACHINE=qemux86-64 bitbake vcontainer-tarball |
| 355 | 373 | ./tmp/deploy/sdk/vcontainer-standalone.sh -d /tmp/vcontainer -y | |
| 356 | # Extract | ||
| 357 | cd /tmp && tar -xzf .../vcontainer-standalone-*.tar.gz | ||
| 358 | 374 | ||
| 359 | # Run tests for both tools | 375 | # Run tests for both tools |
| 360 | cd /opt/bruce/poky/meta-virtualization | 376 | cd /opt/bruce/poky/meta-virtualization |
| 361 | pytest tests/test_vdkr.py tests/test_vpdmn.py -v --vdkr-dir /tmp/vcontainer-standalone | 377 | pytest tests/test_vdkr.py tests/test_vpdmn.py -v --vdkr-dir /tmp/vcontainer |
| 362 | ``` | 378 | ``` |
| 363 | 379 | ||
| 364 | ## See Also | 380 | ## See Also |
