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/irqbalance/irqbalance.inc b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance.inc
new file mode 100644
index 0000000..53275d1
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance.inc
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2013 Wind River Systems, Inc.
+#
+SUMMARY = "IRQ allocation daemon"
+DESCRIPTION = "A daemon to balance interrupts across multiple CPUs, \
+which can lead to better performance and IO balance on SMP systems."
+
+HOMEPAGE = "http://code.google.com/p/irqbalance/"
+BUGTRACKER = "http://code.google.com/p/irqbalance/issues/list"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+		    file://irqbalance.c;beginline=6;endline=8;md5=b94e153694672307b503b1bc87dc9e24 \
+		   "
+
+DEPENDS = "glib-2.0"
+
+INITSCRIPT_NAME = "irqbalanced"
+INITSCRIPT_PARAMS = "defaults"
+
+inherit autotools update-rc.d pkgconfig systemd
+
+SYSTEMD_PACKAGES = "irqbalance"
+SYSTEMD_SERVICE_irqbalance = "irqbalanced.service"
+
+EXTRA_OECONF = "--program-transform-name= \
+	       "
+
+# let the recipes or appends define options
+#
+PACKAGECONFIG ?= ""
+
+# enable,disable,depends,rdepends
+#
+PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl,"
+PACKAGECONFIG[libcap-ng] = "--with-libcap-ng,--without-libcap-ng,libcap-ng,"
+
+do_install () {
+        oe_runmake 'DESTDIR=${D}' install
+        install -d ${D}${sysconfdir}/init.d
+        cat ${S}/irqbalance.init | sed -e's,/usr/sbin,${sbindir},g' > ${D}${sysconfdir}/init.d/irqbalanced
+        chmod 755 ${D}${sysconfdir}/init.d/irqbalanced
+
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/irqbalanced.service ${D}${systemd_unitdir}/system
+        sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/irqbalanced.service
+}
diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/add-initscript.patch b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/add-initscript.patch
new file mode 100644
index 0000000..46a75a8
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/add-initscript.patch
@@ -0,0 +1,47 @@
+irqbalance: add basic init script
+
+The upstream irqbalance release package does not contain an
+init script so we create a basic one here.
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+Index: irqbalance-0.56/irqbalance.init
+===================================================================
+--- /dev/null
++++ irqbalance-0.56/irqbalance.init
+@@ -0,0 +1,35 @@
++#!/bin/sh
++#
++# Copyright (c) 2012 Wind River Systems, Inc.
++#
++### BEGIN INIT INFO
++# Provides:             irqbalance
++# Required-Start:
++# Required-Stop:
++# Default-Start:        2 3 4 5
++# Default-Stop:         0 1 6
++# Short-Description:    IRQ allocation daemon
++### END INIT INFO
++
++case "$1" in
++  start)
++	echo -n "Starting irqbalance: "
++	start-stop-daemon -S -b -n irqbalance -a /usr/sbin/irqbalance
++	echo "done"
++	;;
++  stop)
++	echo -n "Shutting down irqbalance: "
++	start-stop-daemon -K -n irqbalance
++	echo "done"
++	;;
++  restart)
++	$0 stop
++	$0 start
++	;;
++  *)
++	echo "Usage: $0 {start | stop | restart}" >&2
++	exit 1
++	;;
++esac
++
++exit 0
diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/fix-configure-libcap-ng.patch b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/fix-configure-libcap-ng.patch
new file mode 100644
index 0000000..5be5243
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/fix-configure-libcap-ng.patch
@@ -0,0 +1,24 @@
+Subject: [PATCH] grasp withval for libcap-ng
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ configure.ac |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff -urpN a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -61,7 +61,10 @@ AS_IF(
+ AM_CONDITIONAL([LOCAL_GLIB], [test "x$local_glib2" = "xyes"])
+ 
+ AC_ARG_WITH([libcap-ng],
+-  AS_HELP_STRING([libcap-ng], [Add libcap-ng-support @<:@default=auto@:>@]))
++  [AS_HELP_STRING([libcap-ng], [Add libcap-ng-support @<:@default=auto@:>@])],
++  [libcap_ng=$withval],
++  [libcap_ng=$withval]
++)
+ 
+ AS_IF(
+   [test "x$libcap_ng" != "xno"],
diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalance-Add-status-and-reload-commands.patch b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalance-Add-status-and-reload-commands.patch
new file mode 100644
index 0000000..d853d0b
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalance-Add-status-and-reload-commands.patch
@@ -0,0 +1,55 @@
+From dc7366896dd5a5bae82be4b11530bc9fdb7cbcdd Mon Sep 17 00:00:00 2001
+From: Yang Shi <yang.shi@windriver.com>
+Date: Mon, 26 Aug 2013 10:58:02 -0700
+Subject: [PATCH] irqbalance: Add status and reload commands
+
+Add status and reload commands for irqbalanced init script
+
+Signed-off-by: Yang Shi <yang.shi@windriver.com>
+---
+ irqbalance.init |   12 +++++++++---
+ 1 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/irqbalance.init b/irqbalance.init
+index d12d62c..f58bf55 100644
+--- a/irqbalance.init
++++ b/irqbalance.init
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ #
+-# Copyright (c) 2012 Wind River Systems, Inc.
++# Copyright (c) 2013 Wind River Systems, Inc.
+ #
+ ### BEGIN INIT INFO
+ # Provides:             irqbalance
+@@ -11,6 +11,8 @@
+ # Short-Description:    IRQ allocation daemon
+ ### END INIT INFO
+ 
++. /etc/init.d/functions
++
+ case "$1" in
+   start)
+ 	echo -n "Starting irqbalance: "
+@@ -22,12 +24,16 @@ case "$1" in
+ 	start-stop-daemon -K -n irqbalance
+ 	echo "done"
+ 	;;
+-  restart)
++  restart|reload)
+ 	$0 stop
+ 	$0 start
+ 	;;
++  status)
++	status irqbalance
++	echo "done"
++	;;
+   *)
+-	echo "Usage: $0 {start | stop | restart}" >&2
++	echo "Usage: $0 {start | stop | restart | reload | status}" >&2
+ 	exit 1
+ 	;;
+ esac
+-- 
+1.7.5.4
+
diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalanced.service b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalanced.service
new file mode 100644
index 0000000..5b284fa
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance/irqbalanced.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=irqbalance daemon
+After=syslog.target
+
+[Service]
+ExecStart=@SBINDIR@/irqbalance --foreground
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance_1.1.0.bb b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance_1.1.0.bb
new file mode 100644
index 0000000..16efa95
--- /dev/null
+++ b/import-layers/meta-virtualization/recipes-extended/irqbalance/irqbalance_1.1.0.bb
@@ -0,0 +1,15 @@
+#
+# Copyright (C) 2015 Wind River Systems, Inc.
+#
+
+require irqbalance.inc
+
+SRC_URI[md5sum] = "b15d975336080bcac4be0c1752d43cf3"
+SRC_URI[sha256sum] = "91506e638b03bf27cf5da7dc250d58a753ce8a0288a20265fc7ff0266040706b"
+
+SRC_URI = "https://github.com/Irqbalance/irqbalance/archive/v${PV}.tar.gz;downloadfilename=irqbalance-${PV}.tar.gz \
+           file://add-initscript.patch \
+           file://irqbalance-Add-status-and-reload-commands.patch \
+           file://fix-configure-libcap-ng.patch \
+           file://irqbalanced.service \
+          "