diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-19 19:14:00 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-02-26 01:05:01 +0000 |
| commit | 1e88a57bfa40ec640962a8aaea6c1db6da990500 (patch) | |
| tree | 4b06dd10726dec3c1097fa07758c63c36b106272 /recipes-extended/xen-guest-bundles | |
| parent | 7e8293ee986031f437a29d19533e3d59a8aeda74 (diff) | |
| download | meta-virtualization-1e88a57bfa40ec640962a8aaea6c1db6da990500.tar.gz | |
xen: add guest bundling infrastructure with cross-install class
Add xen-guest-cross-install.bbclass for bundling Xen guest images into
Dom0 host images at build time. Supports per-guest configuration via
varflags (memory, vcpus, vif, kernel extra), custom config files,
external/pre-built guests, and autostart via /etc/xen/auto/ symlinks.
Also add example-xen-guest-bundle recipe as a template, and simplify
xen-guest-image-minimal by removing the old XEN_GUEST_AUTO_BUNDLE
do_deploy mechanism in favor of the new class-based approach.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/xen-guest-bundles')
| -rw-r--r-- | recipes-extended/xen-guest-bundles/example-xen-guest-bundle_1.0.bb | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/recipes-extended/xen-guest-bundles/example-xen-guest-bundle_1.0.bb b/recipes-extended/xen-guest-bundles/example-xen-guest-bundle_1.0.bb new file mode 100644 index 00000000..96e17275 --- /dev/null +++ b/recipes-extended/xen-guest-bundles/example-xen-guest-bundle_1.0.bb | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | # example-xen-guest-bundle_1.0.bb | ||
| 2 | # =========================================================================== | ||
| 3 | # Example Xen guest bundle recipe demonstrating xen-guest-bundle.bbclass | ||
| 4 | # =========================================================================== | ||
| 5 | # | ||
| 6 | # This recipe shows how to create a package that bundles Xen guest images. | ||
| 7 | # When installed via IMAGE_INSTALL into a Dom0 image that inherits | ||
| 8 | # xen-guest-cross-install, the guests are automatically deployed. | ||
| 9 | # | ||
| 10 | # Usage in image recipe (e.g., xen-image-minimal.bb): | ||
| 11 | # IMAGE_INSTALL += "example-xen-guest-bundle" | ||
| 12 | # | ||
| 13 | # Or in local.conf (use pn- override for specific images): | ||
| 14 | # IMAGE_INSTALL:append:pn-xen-image-minimal = " example-xen-guest-bundle" | ||
| 15 | # | ||
| 16 | # IMPORTANT: Do NOT use global IMAGE_INSTALL:append without pn- override! | ||
| 17 | # This causes circular dependencies when guest images try to include | ||
| 18 | # the bundle that depends on them. | ||
| 19 | # | ||
| 20 | # =========================================================================== | ||
| 21 | |||
| 22 | SUMMARY = "Example Xen guest bundle" | ||
| 23 | DESCRIPTION = "Demonstrates xen-guest-bundle.bbclass by bundling the \ | ||
| 24 | xen-guest-image-minimal guest. Use this as a template \ | ||
| 25 | for your own Xen guest bundles." | ||
| 26 | LICENSE = "MIT" | ||
| 27 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 28 | |||
| 29 | inherit xen-guest-bundle | ||
| 30 | |||
| 31 | # Define guests to bundle | ||
| 32 | # Format: recipe-name[:autostart][:external] | ||
| 33 | # | ||
| 34 | # recipe-name: Yocto image recipe that produces the guest rootfs | ||
| 35 | # autostart: Creates symlink in /etc/xen/auto/ for xendomains | ||
| 36 | # external: Skip dependency generation (pre-built/3rd-party guest) | ||
| 37 | XEN_GUEST_BUNDLES = "\ | ||
| 38 | xen-guest-image-minimal:autostart \ | ||
| 39 | " | ||
| 40 | |||
| 41 | # Per-guest configuration via varflags (optional): | ||
| 42 | XEN_GUEST_MEMORY[xen-guest-image-minimal] = "1024" | ||
| 43 | # XEN_GUEST_VCPUS[xen-guest-image-minimal] = "2" | ||
| 44 | # XEN_GUEST_VIF[xen-guest-image-minimal] = "bridge=xenbr0" | ||
| 45 | # XEN_GUEST_EXTRA[xen-guest-image-minimal] = "root=/dev/xvda ro console=hvc0 ip=dhcp" | ||
| 46 | |||
| 47 | # Custom config file (replaces auto-generation): | ||
| 48 | # SRC_URI += "file://my-custom-guest.cfg" | ||
| 49 | # XEN_GUEST_CONFIG_FILE[xen-guest-image-minimal] = "${UNPACKDIR}/my-custom-guest.cfg" | ||
| 50 | |||
| 51 | # External guest example (rootfs/kernel already in DEPLOY_DIR_IMAGE): | ||
| 52 | # XEN_GUEST_BUNDLES += "my-vendor-guest:external" | ||
| 53 | # XEN_GUEST_ROOTFS[my-vendor-guest] = "vendor-rootfs.ext4" | ||
| 54 | # XEN_GUEST_KERNEL[my-vendor-guest] = "vendor-kernel" | ||
