summaryrefslogtreecommitdiffstats
path: root/meta-agl-lxc/recipes-platform/images
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-lxc/recipes-platform/images')
-rw-r--r--meta-agl-lxc/recipes-platform/images/guest-image-cluster-demo.bb11
-rw-r--r--meta-agl-lxc/recipes-platform/images/guest-image-minimal.bb7
-rw-r--r--meta-agl-lxc/recipes-platform/images/lxc-host-image-demo.bb12
-rw-r--r--meta-agl-lxc/recipes-platform/images/lxc-host-image-minimal.bb57
4 files changed, 87 insertions, 0 deletions
diff --git a/meta-agl-lxc/recipes-platform/images/guest-image-cluster-demo.bb b/meta-agl-lxc/recipes-platform/images/guest-image-cluster-demo.bb
new file mode 100644
index 00000000..c07b8f7d
--- /dev/null
+++ b/meta-agl-lxc/recipes-platform/images/guest-image-cluster-demo.bb
@@ -0,0 +1,11 @@
+SUMMARY = "LXC cluster demo guest image"
+LICENSE = "MIT"
+
+require guest-image-minimal.bb
+
+IMAGE_INSTALL += " \
+ weston \
+ weston-init \
+ weston-ini-conf-landscape \
+ refgui \
+"
diff --git a/meta-agl-lxc/recipes-platform/images/guest-image-minimal.bb b/meta-agl-lxc/recipes-platform/images/guest-image-minimal.bb
new file mode 100644
index 00000000..7b6af7ee
--- /dev/null
+++ b/meta-agl-lxc/recipes-platform/images/guest-image-minimal.bb
@@ -0,0 +1,7 @@
+SUMMARY = "A minimal container guest image"
+
+require recipes-platform/images/agl-image-boot.inc
+
+IMAGE_LINGUAS = " "
+
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"
diff --git a/meta-agl-lxc/recipes-platform/images/lxc-host-image-demo.bb b/meta-agl-lxc/recipes-platform/images/lxc-host-image-demo.bb
new file mode 100644
index 00000000..59bda426
--- /dev/null
+++ b/meta-agl-lxc/recipes-platform/images/lxc-host-image-demo.bb
@@ -0,0 +1,12 @@
+SUMMARY = "LXC host demo image"
+LICENSE = "MIT"
+
+require lxc-host-image-minimal.bb
+
+CONTAINER_IMAGES ?= "agl-container-guest:guest-image-cluster-demo"
+
+IMAGE_INSTALL += " \
+ kernel-modules \
+ pipewire pipewire-alsa alsa-utils \
+ ${@bb.utils.contains('AGL_FEATURES', 'agl-drm-lease', 'drm-lease-manager', '', d)} \
+"
diff --git a/meta-agl-lxc/recipes-platform/images/lxc-host-image-minimal.bb b/meta-agl-lxc/recipes-platform/images/lxc-host-image-minimal.bb
new file mode 100644
index 00000000..f702da18
--- /dev/null
+++ b/meta-agl-lxc/recipes-platform/images/lxc-host-image-minimal.bb
@@ -0,0 +1,57 @@
+SUMMARY = "A minimal container host image"
+
+require recipes-platform/images/agl-image-boot.inc
+
+IMAGE_INSTALL += " \
+ lxc \
+ ${LXC_CONTAINER_CONFIGS} \
+"
+
+CONTAINER_IMAGES ??= ""
+
+LXC_CONTAINER_CONFIGS ?= ""
+
+IMAGE_LINGUAS = " "
+
+NO_RECOMMENDATIONS = "1"
+
+python __anonymous() {
+ for c in (d.getVar('CONTAINER_IMAGES') or "").split():
+ (mc, image) = c.split(':')
+ dependency = 'mc::' + mc + ':' + image + ':do_image_complete'
+ d.setVarFlag('do_rootfs', 'mcdepends', dependency)
+
+ # Assume there is a X-lxc-config package for guest-image-X
+ config = image
+ if config.startswith('guest-image-'):
+ config = config[len('guest-image-'):]
+ d.appendVar('LXC_CONTAINER_CONFIGS', 'lxc-config-' + config)
+}
+
+install_container_images() {
+ for c in ${CONTAINER_IMAGES}; do
+ config=${c%:*}
+ image=${c#*:}
+ name=${image#guest-image-}
+ rm -rf ${IMAGE_ROOTFS}/var/lib/machines/${name}
+ install -m 0755 -d ${IMAGE_ROOTFS}/var/lib/machines/${name}
+ src="${TOPDIR}/tmp-${config}/deploy/images/${MACHINE}/${image}-${MACHINE}.tar.bz2"
+ bbnote "Installing ${src}"
+ tar -C ${IMAGE_ROOTFS}/var/lib/machines/${name} -xf ${src}
+ done
+}
+
+#
+# Force rebuild of rootfs on every build to work around mcdepends issue
+#
+# NOTE:
+# This is currently required as bitbake fails to trigger do_rootfs
+# sometimes even when the guest image has in fact rebuilt. This is
+# being investigated with upstream.
+#
+do_rootfs[nostamp] = "1"
+
+ROOTFS_POSTPROCESS_COMMAND += "install_container_images; "
+
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"
+