[meta-virtualization] [PATCH] kvmtool: add lightweight hypervisor native Linux KVM tool

Stefan Agner stefan at agner.ch
Tue Sep 6 11:51:40 PDT 2016


Add Native Linux KVM tool, a lightweight tool for hosting KVM guests
maintained by the Linux kernel community.

Signed-off-by: Stefan Agner <stefan at agner.ch>
---
 .../kvmtool/files/external-crosscompiler.patch     | 31 ++++++++++++++++++++++
 recipes-extended/kvmtool/kvmtool.bb                | 23 ++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 recipes-extended/kvmtool/files/external-crosscompiler.patch
 create mode 100644 recipes-extended/kvmtool/kvmtool.bb

diff --git a/recipes-extended/kvmtool/files/external-crosscompiler.patch b/recipes-extended/kvmtool/files/external-crosscompiler.patch
new file mode 100644
index 0000000..75cef3b
--- /dev/null
+++ b/recipes-extended/kvmtool/files/external-crosscompiler.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+This allows OpenEmbedded to pass in cross compiler configuration using
+the default envirnment variables. It is required so that kvmtool can
+be linked against the cross-compiled libfdt library.
+
+diff --git a/Makefile b/Makefile
+index 1f0196f..8bfb068 100644
+--- a/Makefile
++++ b/Makefile
+@@ -14,11 +14,6 @@ export E Q
+ include config/utilities.mak
+ include config/feature-tests.mak
+ 
+-CC	:= $(CROSS_COMPILE)gcc
+-CFLAGS	:=
+-LD	:= $(CROSS_COMPILE)ld
+-LDFLAGS	:=
+-
+ FIND	:= find
+ CSCOPE	:= cscope
+ TAGS	:= ctags
+@@ -297,7 +292,7 @@ $(warning No static libc found. Skipping guest init)
+ endif
+ 
+ ifeq (y,$(ARCH_WANT_LIBFDT))
+-	ifneq ($(call try-build,$(SOURCE_LIBFDT),$(CFLAGS),-lfdt),y)
++	ifneq ($(call try-build,$(SOURCE_LIBFDT),$(CPPFLAGS) $(CFLAGS),-lfdt),y)
+           $(error No libfdt found. Please install libfdt-dev package)
+ 	else
+ 		CFLAGS_DYNOPT	+= -DCONFIG_HAS_LIBFDT
diff --git a/recipes-extended/kvmtool/kvmtool.bb b/recipes-extended/kvmtool/kvmtool.bb
new file mode 100644
index 0000000..3f299dd
--- /dev/null
+++ b/recipes-extended/kvmtool/kvmtool.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Native Linux KVM tool"
+DESCRIPTION = "kvmtool is a lightweight tool for hosting KVM guests."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067"
+
+DEPENDS = "dtc libaio zlib"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git \
+           file://external-crosscompiler.patch \
+    "
+
+SRCREV = "0093df80d754e1a05b016e5a4ccd4b51a00c562c"
+PV = "3.18.0+git${SRCREV}"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE='ARCH="${TARGET_ARCH}" V=1'
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 ${S}/lkvm ${D}${bindir}/
+}
-- 
1.9.1



More information about the meta-virtualization mailing list