Squashed 'import-layers/meta-virtualization/' content from commit c4a1711
Change-Id: I42132e4f0aef12ec265e74d95f489a6409e22f46
git-subtree-dir: import-layers/meta-virtualization
git-subtree-split: c4a1711dd31659b027c70c07e4ef6da98591ac95
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/import-layers/meta-virtualization/recipes-extended/images/cloud-image-compute.bb b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-compute.bb
new file mode 100644
index 0000000..197624f
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-compute.bb
@@ -0,0 +1,14 @@
+IMAGE_FEATURES += "ssh-server-openssh"
+EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks"
+
+IMAGE_INSTALL = "\
+ ${CORE_IMAGE_BASE_INSTALL} \
+ packagegroup-core-basic \
+ openvswitch \
+ libvirt \
+ openflow \
+ "
+
+inherit core-image
+
+IMAGE_FSTYPES = "tar.gz"
diff --git a/import-layers/meta-virtualization/recipes-extended/images/cloud-image-controller.bb b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-controller.bb
new file mode 100644
index 0000000..0b2a67b
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-controller.bb
@@ -0,0 +1,34 @@
+IMAGE_FEATURES += "ssh-server-openssh package-management"
+EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks"
+
+IMAGE_INSTALL = "\
+ ${CORE_IMAGE_BASE_INSTALL} \
+ ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+ packagegroup-core-basic \
+ openvswitch \
+ openvswitch-controller \
+ openvswitch-switch \
+ openvswitch-brcompat \
+ criu \
+ libvirt \
+ libvirt-libvirtd \
+ libvirt-python \
+ libvirt-virsh \
+ openflow \
+ qemu \
+ kernel-modules \
+ dhcp-client \
+ perl-modules \
+ grub \
+ mysql5 \
+ python-twisted \
+ python-lxml \
+ "
+
+inherit core-image
+inherit image-vm
+
+IMAGE_FSTYPES = "vmdk tar.gz"
+
+# Ensure extra space for guest images
+#IMAGE_ROOTFS_EXTRA_SPACE = "41943040"
diff --git a/import-layers/meta-virtualization/recipes-extended/images/cloud-image-guest.bb b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-guest.bb
new file mode 100644
index 0000000..e24bf0d
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/images/cloud-image-guest.bb
@@ -0,0 +1,18 @@
+IMAGE_FEATURES += "ssh-server-openssh package-management"
+EXTRA_IMAGE_FEATURES = "tools-debug debug-tweaks"
+
+IMAGE_INSTALL = "\
+ ${CORE_IMAGE_BASE_INSTALL} \
+ ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+ packagegroup-core-basic \
+ openflow \
+ qemu \
+ kernel-modules \
+ tcpdump \
+ dhcp-client \
+ "
+
+inherit core-image
+inherit image-vm
+
+IMAGE_FSTYPES += "vmdk"
diff --git a/import-layers/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb b/import-layers/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb
new file mode 100644
index 0000000..c96edca
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/images/kvm-image-minimal.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "A minimal kvm image"
+
+IMAGE_INSTALL = " \
+ packagegroup-core-boot \
+ ${ROOTFS_PKGMANAGE_BOOTSTRAP} \
+ qemu \
+ libvirt \
+ libvirt-libvirtd \
+ libvirt-virsh \
+ kernel-module-kvm \
+ kernel-module-kvm-intel \
+ kernel-module-kvm-amd \
+ "
+
+IMAGE_FEATURES += "ssh-server-openssh"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
diff --git a/import-layers/meta-virtualization/recipes-extended/images/xen-bootimg.inc b/import-layers/meta-virtualization/recipes-extended/images/xen-bootimg.inc
new file mode 100644
index 0000000..093aa68
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/images/xen-bootimg.inc
@@ -0,0 +1,35 @@
+SYSLINUX_TIMEOUT = "10"
+SYSLINUX_LABEL = "boot"
+SYSLINUX_XEN_APPEND = "dom0_mem=1048576"
+SYSLINUX_KERNEL_APPEND = "ramdisk_size=32768 root=/dev/ram0 rw console=tty0 console=ttyS0,115200n8"
+#LABELS_append = " ${SYSLINUX_LABEL} "
+
+INITRD = "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.cpio.lzma"
+
+do_bootimg[depends] += "${IMAGE_BASENAME}:do_rootfs"
+
+inherit bootimg
+
+syslinux_populate_append() {
+ install -m 0444 ${STAGING_LIBDIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR}/mboot.c32
+}
+
+grubefi_populate_append() {
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz
+}
+
+populate_append() {
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz
+}
+
+build_syslinux_cfg() {
+ echo ALLOWOPTIONS 1 > ${SYSLINUXCFG}
+ echo SERIAL 0 115200 > ${SYSLINUXCFG}
+ echo DEFAULT ${SYSLINUX_LABEL} >> ${SYSLINUXCFG}
+ echo TIMEOUT ${SYSLINUX_TIMEOUT} >> ${SYSLINUXCFG}
+ echo PROMPT 1 >> ${SYSLINUXCFG}
+ echo LABEL ${SYSLINUX_LABEL} >> ${SYSLINUXCFG}
+ echo KERNEL mboot.c32 >> ${SYSLINUXCFG}
+ echo APPEND xen.gz ${SYSLINUX_XEN_APPEND} --- vmlinuz ${SYSLINUX_KERNEL_APPEND} --- initrd >> ${SYSLINUXCFG}
+}
+
diff --git a/import-layers/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb b/import-layers/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb
new file mode 100644
index 0000000..f13940c
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "A Xen guest image."
+
+inherit core-image
+
+IMAGE_INSTALL += " \
+ packagegroup-core-boot \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'kernel-module-xen-acpi-processor', '', d)} \
+ "
+
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-fbdev', '', d)}"
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-vesa', '', d)}"
+
+LICENSE = "MIT"
+
+# Send console messages to xen console
+APPEND += "console=hvc0"
diff --git a/import-layers/meta-virtualization/recipes-extended/images/xen-image-minimal.bb b/import-layers/meta-virtualization/recipes-extended/images/xen-image-minimal.bb
new file mode 100644
index 0000000..26b6d06
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/images/xen-image-minimal.bb
@@ -0,0 +1,53 @@
+DESCRIPTION = "A minimal xen image"
+
+INITRD_IMAGE = "core-image-minimal-initramfs"
+
+IMAGE_INSTALL += " \
+ packagegroup-core-boot \
+ packagegroup-core-ssh-openssh \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'kernel-module-xen-acpi-processor', '', d)} \
+ kernel-module-xen-blkback \
+ kernel-module-xen-gntalloc \
+ kernel-module-xen-gntdev \
+ kernel-module-xen-netback \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'pci', 'kernel-module-xen-pciback', '', d)} \
+ kernel-module-xen-wdt \
+ xen-base \
+ qemu \
+ "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+syslinux_iso_populate_append() {
+ install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${ISODIR}${ISOLINUXDIR}
+ install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${ISODIR}${ISOLINUXDIR}
+}
+
+syslinux_hddimg_populate_append() {
+ install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${HDDDIR}${SYSLINUXDIR}
+ install -m 0444 ${STAGING_DATADIR}/syslinux/mboot.c32 ${HDDDIR}${SYSLINUXDIR}
+}
+
+grubefi_populate_append() {
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}${EFIDIR}/xen.gz
+}
+
+populate_append() {
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz
+}
+
+SYSLINUX_XEN_ARGS ?= "loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1"
+SYSLINUX_KERNEL_ARGS ?= "ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 LABEL=boot debugshell=5"
+
+build_syslinux_cfg () {
+ echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
+ echo "DEFAULT boot" >> ${SYSLINUXCFG}
+ echo "TIMEOUT 10" >> ${SYSLINUXCFG}
+ echo "PROMPT 1" >> ${SYSLINUXCFG}
+ echo "LABEL boot" >> ${SYSLINUXCFG}
+ echo " KERNEL mboot.c32" >> ${SYSLINUXCFG}
+ echo " APPEND /xen.gz ${SYSLINUX_XEN_ARGS} --- /vmlinuz ${SYSLINUX_KERNEL_ARGS} --- /initrd" >> ${SYSLINUXCFG}
+}
+