uxen-guest-tools, image: package the Linux VM tools for uXen hypervisor

uXen is a type-2 Open Source hypervisor from Bromium/HP.
    https://www.bromium.com/opensource/

This adds packaging for the Linux guest support software, enabling OE
to produce VM images to run on the uXen hypervisor.

    uxen-guest-tools: in-guest software device drivers
    uxen-guest-image-minimal : minimal core image with uXen drivers

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Christopher Clark 2020-02-24 16:37:00 -08:00 committed by Bruce Ashfield
parent 5591f772fe
commit 62afe452c2
4 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,9 @@
DESCRIPTION = "A Linux guest image for the uXen type-2 hypervisor."
LICENSE = "MIT"
inherit core-image
IMAGE_INSTALL += " \
packagegroup-core-boot \
uxen-guest-tools \
"

View File

@ -0,0 +1,48 @@
# uXen : Open Source type-2 hypervisor support
For any issues with the uXen recipes please make sure you CC:
christopher.w.clark@gmail.com
## uxen-guest-tools : software for within guest VMs, kernel modules
* uxenhc : hypercall driver
* uxenfb : framebuffer driver
* uxenhid : Human Input Device driver
* uxennet : virtual network device driver
* uxenplatform : uXen platform device driver
* uxenstor : virtual storage device driver
* uxenv4vlib : v4v, Hypervisor-Mediated data eXchange
* v4vvsock : v4v vsock virtual network device driver
* v4vtest : basic v4v vsock test
To produce a bootable VM disk image file:
wic create directdisk -e uxen-guest-image-minimal
To test, copy the .direct file that wic produces to the host with uXen installed and write the following to a new file: `linux-vm.json`. Update the file path within it to point to your wic-generated disk image:
{
"name" : "Linux Virtual Machine",
"boot-order" : "c",
"block" :
{ "id": "ich0", "proto" : "raw", "xsnapshot" : true,
"path" : "c:/Users/Yocto/directdisk-202001010100-sda.direct" },
"memory" : 768,
"net" : { "type" : "nic", "model" : "e1000" },
"hpet" : 1,
"vcpus" : 1,
"use-v4v-net" : 1,
"v4v-storage" : true,
"" : ""
}
and then boot it:
uxendm -F linux-vm.json
References:
https://www.bromium.com/opensource
https://github.com/uxen-virt
https://www.platformsecuritysummit.com/2018/speaker/pratt/

View File

@ -0,0 +1,36 @@
# OpenEmbedded uses KERNEL_SRC instead of KDIR
# and enable the modules_install target.
# Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
diff --git a/Makefile b/Makefile
index 3fd3075..80cf0fe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,13 @@
ifneq ($(KERNELRELEASE),)
# kbuild part of makefile
-else
+include Kbuild
-KVERSION ?= $(shell uname -r)
-KDIR := /lib/modules/${KVERSION}/build
+else
+#normal makefile
+KERNEL_VERSION ?= $(shell uname -r)
+KERNEL_SRC ?= /lib/modules/${KERNEL_VERSION}/build
UXENDIR ?= $(shell pwd)/include/uxen
+INSTALL_HDR_PATH ?= /usr
LX_TARGET_FLAGS= -DLX_TARGET_STANDARDVM
LX_TARGET_ATTOVM=n
@@ -19,7 +22,9 @@ EXTRA_CFLAGS=$(LX_TARGET_FLAGS) -g -Wall
NOSTDINC_FLAGS=-I$(shell pwd)/include/ -I$(UXENDIR) -I$(UXENDIR)/xen
all:
- make -C $(KDIR) $(LX_TARGET) M=$(shell pwd) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)"
+ make -C $(KERNEL_SRC) $(LX_TARGET) M=$(shell pwd) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)"
clean:
- make -C $(KDIR) $(LX_TARGET) M=$(shell pwd) clean
+ make -C $(KERNEL_SRC) $(LX_TARGET) M=$(shell pwd) clean
+modules_install:
+ make -C $(KERNEL_SRC) $(LX_TARGET) M=$(shell pwd) modules_install
endif

View File

@ -0,0 +1,22 @@
SUMMARY = "uXen type-2 Open Source hypervisor Linux guest tools"
DESCRIPTION = "Linux guest virtual machine tools for the uXen hypervisor"
HOMEPAGE = "https://www.bromium.com/opensource"
LICENSE = "GPLv2"
COMPATIBLE_HOST = '(x86_64.*).*-linux'
SRC_URI = " \
https://www.bromium.com/wp-content/uploads/2019/06/uxen-vmsupport-linux-${PV}.zip;name=uxen \
https://www.bromium.com/wp-content/uploads/2019/11/Bromium-4.1.8-Open-Source-Software.pdf;name=license \
file://fix-Makefile-for-OE-kernel-build.patch \
"
SRC_URI[uxen.sha384sum] = "d9d7a1fa5c44ac77eea3d8d4756f9e07fc02acfe12606325ff0bb8a60c07abc3e9ddb80c2039797fb2122d750219722f"
SRC_URI[license.sha384sum] = "92e48c614df3094cb52321d4c4e01f6df5526d46aee5c6fa36c43ee23d4c33f03baa1fc5f6f29efafff636b6d13bc92c"
# The software license is GPLv2: please see page 199 of the pdf document
LIC_FILES_CHKSUM = "file://../Bromium-4.1.8-Open-Source-Software.pdf;md5=cf120df6ffa417b36f870a9997650049"
S = "${WORKDIR}/uxen-vmsupport-linux-${PV}"
inherit module