summaryrefslogtreecommitdiffstats
path: root/external/meta-virtualization/recipes-extended/kvmtool
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-virtualization/recipes-extended/kvmtool')
-rw-r--r--external/meta-virtualization/recipes-extended/kvmtool/files/0001-Avoid-pointers-for-address-of-packed-members.patch39
-rw-r--r--external/meta-virtualization/recipes-extended/kvmtool/files/0001-kvmtool-9p-fixed-compilation-error.patch27
-rw-r--r--external/meta-virtualization/recipes-extended/kvmtool/files/0002-kvmtool-add-EXTRA_CFLAGS-variable.patch29
-rw-r--r--external/meta-virtualization/recipes-extended/kvmtool/files/external-crosscompiler.patch31
-rw-r--r--external/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb29
5 files changed, 155 insertions, 0 deletions
diff --git a/external/meta-virtualization/recipes-extended/kvmtool/files/0001-Avoid-pointers-for-address-of-packed-members.patch b/external/meta-virtualization/recipes-extended/kvmtool/files/0001-Avoid-pointers-for-address-of-packed-members.patch
new file mode 100644
index 00000000..863e86a8
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/kvmtool/files/0001-Avoid-pointers-for-address-of-packed-members.patch
@@ -0,0 +1,39 @@
+From 2e22df7c24dadf5e16004cd832cabca76a699d4d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 21 Mar 2017 23:32:39 -0700
+Subject: [PATCH] Avoid pointers for address of packed members
+
+Fixes Clang warning due to -Waddress-of-packed-member
+
+virtio/blk.c:161:37: error: taking address of packed member 'geometry' of class or structure 'virtio_blk_config' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
+ struct virtio_blk_geometry *geo = &conf->geometry;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ virtio/blk.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/virtio/blk.c b/virtio/blk.c
+index c485e4f..1f7365d 100644
+--- a/virtio/blk.c
++++ b/virtio/blk.c
+@@ -158,7 +158,6 @@ static void set_guest_features(struct kvm *kvm, void *dev, u32 features)
+ {
+ struct blk_dev *bdev = dev;
+ struct virtio_blk_config *conf = &bdev->blk_config;
+- struct virtio_blk_geometry *geo = &conf->geometry;
+
+ bdev->features = features;
+
+@@ -167,7 +166,7 @@ static void set_guest_features(struct kvm *kvm, void *dev, u32 features)
+ conf->seg_max = virtio_host_to_guest_u32(&bdev->vdev, conf->seg_max);
+
+ /* Geometry */
+- geo->cylinders = virtio_host_to_guest_u16(&bdev->vdev, geo->cylinders);
++ conf->geometry.cylinders = virtio_host_to_guest_u16(&bdev->vdev, conf->geometry.cylinders);
+
+ conf->blk_size = virtio_host_to_guest_u32(&bdev->vdev, conf->blk_size);
+ conf->min_io_size = virtio_host_to_guest_u16(&bdev->vdev, conf->min_io_size);
+--
+2.12.0
+
diff --git a/external/meta-virtualization/recipes-extended/kvmtool/files/0001-kvmtool-9p-fixed-compilation-error.patch b/external/meta-virtualization/recipes-extended/kvmtool/files/0001-kvmtool-9p-fixed-compilation-error.patch
new file mode 100644
index 00000000..63911fc2
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/kvmtool/files/0001-kvmtool-9p-fixed-compilation-error.patch
@@ -0,0 +1,27 @@
+From bcd954ffdb9383030e02d356b51e09e4e2a7105a Mon Sep 17 00:00:00 2001
+From: Dariusz Pelowski <dariusz.pelowski@gmail.com>
+Date: Sun, 5 Nov 2017 12:39:52 +0100
+Subject: [PATCH 1/2] kvmtool: 9p: fixed compilation error
+
+makedev is defined in sys/sysmacros.h
+
+Signed-off-by: Dariusz Pelowski <dariusz.pelowski@gmail.com>
+---
+ virtio/9p.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/virtio/9p.c b/virtio/9p.c
+index 6acbfdd..1dee2c2 100644
+--- a/virtio/9p.c
++++ b/virtio/9p.c
+@@ -15,6 +15,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <sys/vfs.h>
++#include <sys/sysmacros.h>
+
+ #include <linux/virtio_ring.h>
+ #include <linux/virtio_9p.h>
+--
+2.15.0
+
diff --git a/external/meta-virtualization/recipes-extended/kvmtool/files/0002-kvmtool-add-EXTRA_CFLAGS-variable.patch b/external/meta-virtualization/recipes-extended/kvmtool/files/0002-kvmtool-add-EXTRA_CFLAGS-variable.patch
new file mode 100644
index 00000000..262531ca
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/kvmtool/files/0002-kvmtool-add-EXTRA_CFLAGS-variable.patch
@@ -0,0 +1,29 @@
+From 977a4d41012d1814f5a5330cacc2e4944de387cc Mon Sep 17 00:00:00 2001
+From: Dariusz Pelowski <dariusz.pelowski@gmail.com>
+Date: Sun, 5 Nov 2017 12:39:21 +0100
+Subject: [PATCH 2/2] kvmtool: add EXTRA_CFLAGS variable
+
+to avoid CFLAGS overriding introduce new EXTRA_CFLAGS variable
+for setting via command argument
+
+Signed-off-by: Dariusz Pelowski <dariusz.pelowski@gmail.com>
+---
+ Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 64a0a16..bca1b26 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,6 +2,8 @@
+ # Define WERROR=0 to disable -Werror.
+ #
+
++CFLAGS += $(EXTRA_CFLAGS)
++
+ ifeq ($(strip $(V)),)
+ E = @echo
+ Q = @
+--
+2.15.0
+
diff --git a/external/meta-virtualization/recipes-extended/kvmtool/files/external-crosscompiler.patch b/external/meta-virtualization/recipes-extended/kvmtool/files/external-crosscompiler.patch
new file mode 100644
index 00000000..75cef3b1
--- /dev/null
+++ b/external/meta-virtualization/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/external/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb b/external/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb
new file mode 100644
index 00000000..d487ee27
--- /dev/null
+++ b/external/meta-virtualization/recipes-extended/kvmtool/kvmtool.bb
@@ -0,0 +1,29 @@
+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"
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+inherit kernel-arch
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git \
+ file://external-crosscompiler.patch \
+ file://0001-Avoid-pointers-for-address-of-packed-members.patch \
+ file://0001-kvmtool-9p-fixed-compilation-error.patch \
+ file://0002-kvmtool-add-EXTRA_CFLAGS-variable.patch \
+ "
+
+SRCREV = "0e1882a49f81cb15d328ef83a78849c0ea26eecc"
+PV = "4.14.0+git${SRCREV}"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE='V=1 EXTRA_CFLAGS="-I${STAGING_KERNEL_BUILDDIR}/include/generated -I${STAGING_KERNEL_BUILDDIR}/arch/${ARCH}/include/generated"'
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/lkvm ${D}${bindir}/
+}