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/images | |
| 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/images')
| -rw-r--r-- | recipes-extended/images/xen-guest-image-minimal.bb | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/recipes-extended/images/xen-guest-image-minimal.bb b/recipes-extended/images/xen-guest-image-minimal.bb index 76f320e4..1afc4219 100644 --- a/recipes-extended/images/xen-guest-image-minimal.bb +++ b/recipes-extended/images/xen-guest-image-minimal.bb | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | DESCRIPTION = "A Xen guest image." | 1 | DESCRIPTION = "A Xen guest image." |
| 2 | 2 | ||
| 3 | inherit core-image features_check deploy | 3 | inherit core-image features_check |
| 4 | inherit kernel-artifact-names | ||
| 5 | 4 | ||
| 6 | IMAGE_INSTALL += " \ | 5 | IMAGE_INSTALL += " \ |
| 7 | packagegroup-core-boot \ | 6 | packagegroup-core-boot \ |
| @@ -26,26 +25,3 @@ LICENSE = "MIT" | |||
| 26 | APPEND += "console=hvc0" | 25 | APPEND += "console=hvc0" |
| 27 | 26 | ||
| 28 | IMAGE_FSTYPES = "tar.bz2 ext4 ext4.qcow2" | 27 | IMAGE_FSTYPES = "tar.bz2 ext4 ext4.qcow2" |
| 29 | |||
| 30 | XEN_GUEST_AUTO_BUNDLE ?= "" | ||
| 31 | |||
| 32 | # When a xen-guest-image-minimal is built with the | ||
| 33 | # XEN_GUEST_AUTO_BUNDLE varaible set to True, a configuration file for | ||
| 34 | # automatic guest bundling will be generated and the guest bundled | ||
| 35 | # automatically when a xen host image is built. | ||
| 36 | do_deploy() { | ||
| 37 | if [ -n "${XEN_GUEST_AUTO_BUNDLE}" ]; then | ||
| 38 | outname="xen-guest-bundle-${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}-${IMAGE_VERSION_SUFFIX}.cfg" | ||
| 39 | cat <<EOF >>${DEPLOYDIR}/$outname | ||
| 40 | name = "xen-guest" | ||
| 41 | memory = 512 | ||
| 42 | vcpus = 1 | ||
| 43 | disk = ['file:${IMAGE_LINK_NAME}.ext4,xvda,rw'] | ||
| 44 | vif = ['bridge=xenbr0'] | ||
| 45 | kernel = "${KERNEL_IMAGETYPE}" | ||
| 46 | extra = "root=/dev/xvda ro ip=dhcp" | ||
| 47 | EOF | ||
| 48 | fi | ||
| 49 | } | ||
| 50 | |||
| 51 | addtask deploy after do_compile | ||
