From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- .../recipes-extended/uxen/README.md | 48 ++++++++++++++++++++++ .../fix-Makefile-for-OE-kernel-build.patch | 36 ++++++++++++++++ .../uxen/uxen-guest-tools_4.1.7.bb | 22 ++++++++++ 3 files changed, 106 insertions(+) create mode 100644 external/meta-virtualization/recipes-extended/uxen/README.md create mode 100644 external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools/fix-Makefile-for-OE-kernel-build.patch create mode 100644 external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb (limited to 'external/meta-virtualization/recipes-extended/uxen') diff --git a/external/meta-virtualization/recipes-extended/uxen/README.md b/external/meta-virtualization/recipes-extended/uxen/README.md new file mode 100644 index 00000000..09733833 --- /dev/null +++ b/external/meta-virtualization/recipes-extended/uxen/README.md @@ -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/ diff --git a/external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools/fix-Makefile-for-OE-kernel-build.patch b/external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools/fix-Makefile-for-OE-kernel-build.patch new file mode 100644 index 00000000..db4c53f5 --- /dev/null +++ b/external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools/fix-Makefile-for-OE-kernel-build.patch @@ -0,0 +1,36 @@ +# OpenEmbedded uses KERNEL_SRC instead of KDIR +# and enable the modules_install target. +# Signed-off-by: Christopher Clark +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 diff --git a/external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb b/external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb new file mode 100644 index 00000000..757f1e3b --- /dev/null +++ b/external/meta-virtualization/recipes-extended/uxen/uxen-guest-tools_4.1.7.bb @@ -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 -- cgit 1.2.3-korg