summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Thode <prometheanfire@gentoo.org>2014-02-09 08:56:18 +0000
committerMatthew Thode <prometheanfire@gentoo.org>2014-02-09 08:56:18 +0000
commit0949d00d200571a3b5dc99a79c1d348a436b0c07 (patch)
tree720817edfa6d2d8c3a2775b57dd898c4c26aaaea /net-misc/openvswitch
parentalpha/amd64/hppa/ia64/ppc64/sparc/x86 stable wrt bug #495536; Drop old. (diff)
downloadgentoo-2-0949d00d200571a3b5dc99a79c1d348a436b0c07.tar.gz
gentoo-2-0949d00d200571a3b5dc99a79c1d348a436b0c07.tar.bz2
gentoo-2-0949d00d200571a3b5dc99a79c1d348a436b0c07.zip
fixing bugs 494152 498728 499500
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0x2471eb3e40ac5ac3)
Diffstat (limited to 'net-misc/openvswitch')
-rw-r--r--net-misc/openvswitch/ChangeLog12
-rw-r--r--net-misc/openvswitch/files/atomic-test.patch14
-rw-r--r--net-misc/openvswitch/files/configure.patch15
-rw-r--r--net-misc/openvswitch/files/kernel-3.11-support.patch68
-rw-r--r--net-misc/openvswitch/files/kernel-3.12-support.patch19
-rw-r--r--net-misc/openvswitch/files/xcp-interface-reconfigure.patch20
-rw-r--r--net-misc/openvswitch/openvswitch-2.0.0-r2.ebuild159
7 files changed, 305 insertions, 2 deletions
diff --git a/net-misc/openvswitch/ChangeLog b/net-misc/openvswitch/ChangeLog
index 3045459c4b1c..cd93373edfe5 100644
--- a/net-misc/openvswitch/ChangeLog
+++ b/net-misc/openvswitch/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-misc/openvswitch
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/ChangeLog,v 1.20 2013/12/14 13:06:53 pacho Exp $
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/ChangeLog,v 1.21 2014/02/09 08:56:18 prometheanfire Exp $
+
+*openvswitch-2.0.0-r2 (09 Feb 2014)
+
+ 09 Feb 2014; Matthew Thode <prometheanfire@gentoo.org>
+ +files/atomic-test.patch, +files/configure.patch,
+ +files/kernel-3.11-support.patch, +files/kernel-3.12-support.patch,
+ +files/xcp-interface-reconfigure.patch, +openvswitch-2.0.0-r2.ebuild:
+ fixing bugs 494152 498728 499500
*openvswitch-2.0.0-r1 (14 Dec 2013)
diff --git a/net-misc/openvswitch/files/atomic-test.patch b/net-misc/openvswitch/files/atomic-test.patch
new file mode 100644
index 000000000000..14de564de9cb
--- /dev/null
+++ b/net-misc/openvswitch/files/atomic-test.patch
@@ -0,0 +1,14 @@
+Description: Link atomic test with -latomic for powerpc.
+Author: Adam Conrad <adconrad@ubuntu.com>
+
+--- openvswitch-2.0.0.orig/tests/automake.mk
++++ openvswitch-2.0.0/tests/automake.mk
+@@ -181,7 +181,7 @@ tests_test_aes128_LDADD = lib/libopenvsw
+
+ noinst_PROGRAMS += tests/test-atomic
+ tests_test_atomic_SOURCES = tests/test-atomic.c
+-tests_test_atomic_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
++tests_test_atomic_LDADD = lib/libopenvswitch.a $(SSL_LIBS) -latomic
+
+ noinst_PROGRAMS += tests/test-bundle
+ tests_test_bundle_SOURCES = tests/test-bundle.c
diff --git a/net-misc/openvswitch/files/configure.patch b/net-misc/openvswitch/files/configure.patch
new file mode 100644
index 000000000000..47f5614d8eda
--- /dev/null
+++ b/net-misc/openvswitch/files/configure.patch
@@ -0,0 +1,15 @@
+--- configure.orig 2014-01-27 21:55:14.116272645 +0200
++++ configure 2014-01-27 21:55:40.687273108 +0200
+@@ -7949,10 +7949,10 @@
+ $as_echo "$kversion" >&6; }
+
+ if test "$version" -ge 3; then
+- if test "$version" = 3 && test "$patchlevel" -le 10; then
++ if test "$version" = 3 && test "$patchlevel" -le 12; then
+ : # Linux 3.x
+ else
+- as_fn_error $? "Linux kernel in $KBUILD is version $kversion, but version newer than 3.10.x is not supported" "$LINENO" 5
++ as_fn_error $? "Linux kernel in $KBUILD is version $kversion, but version newer than 3.12.x is not supported" "$LINENO" 5
+ fi
+ else
+ if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then
diff --git a/net-misc/openvswitch/files/kernel-3.11-support.patch b/net-misc/openvswitch/files/kernel-3.11-support.patch
new file mode 100644
index 000000000000..7ee53d83500f
--- /dev/null
+++ b/net-misc/openvswitch/files/kernel-3.11-support.patch
@@ -0,0 +1,68 @@
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -134,10 +134,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
+ AC_MSG_RESULT([$kversion])
+
+ if test "$version" -ge 3; then
+- if test "$version" = 3 && test "$patchlevel" -le 10; then
++ if test "$version" = 3 && test "$patchlevel" -le 11; then
+ : # Linux 3.x
+ else
+- AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.10.x is not supported])
++ AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.11.x is not supported])
+ fi
+ else
+ if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then
+--- a/datapath/dp_notify.c
++++ b/datapath/dp_notify.c
+@@ -79,7 +79,7 @@ static int dp_device_event(struct notifi
+ void *ptr)
+ {
+ struct ovs_net *ovs_net;
+- struct net_device *dev = ptr;
++ struct net_device *dev = netdev_notifier_info_to_dev(ptr);
+ struct vport *vport = NULL;
+
+ if (!ovs_is_internal_dev(dev))
+--- a/datapath/linux/compat/include/linux/netdevice.h
++++ b/datapath/linux/compat/include/linux/netdevice.h
+@@ -120,4 +120,11 @@ static inline void netdev_upper_dev_unli
+ }
+ #endif
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)
++static inline struct net_device *netdev_notifier_info_to_dev(void *info)
++{
++ return info;
++}
++#endif
++
+ #endif
+--- a/datapath/linux/compat/include/net/gre.h
++++ b/datapath/linux/compat/include/net/gre.h
+@@ -74,12 +74,17 @@ static inline __be16 tnl_flags_to_gre_fl
+ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */
+
+ #define MAX_GRE_PROTO_PRIORITY 255
++#define gre_cisco_protocol rpl_gre_cisco_protocol
++
+ struct gre_cisco_protocol {
+ int (*handler)(struct sk_buff *skb, const struct tnl_ptk_info *tpi);
+ u8 priority;
+ };
+
++#define gre_cisco_register rpl_gre_cisco_register
+ int gre_cisco_register(struct gre_cisco_protocol *proto);
++
++#define gre_cisco_unregister rpl_gre_cisco_unregister
+ int gre_cisco_unregister(struct gre_cisco_protocol *proto);
+
+ #define gre_build_header rpl_gre_build_header
+@@ -89,6 +94,7 @@ void gre_build_header(struct sk_buff *sk
+ #define gre_handle_offloads rpl_gre_handle_offloads
+ struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum);
+
++#define ip_gre_calc_hlen rpl_ip_gre_calc_hlen
+ static inline int ip_gre_calc_hlen(__be16 o_flags)
+ {
+ int addend = 4;
diff --git a/net-misc/openvswitch/files/kernel-3.12-support.patch b/net-misc/openvswitch/files/kernel-3.12-support.patch
new file mode 100644
index 000000000000..85f19ecc2ab2
--- /dev/null
+++ b/net-misc/openvswitch/files/kernel-3.12-support.patch
@@ -0,0 +1,19 @@
+Description: Enable support for 3.12 kernel
+Author: James Page <james.page@ubuntu.com>
+Forwarded: no
+
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -134,10 +134,10 @@ AC_DEFUN([OVS_CHECK_LINUX], [
+ AC_MSG_RESULT([$kversion])
+
+ if test "$version" -ge 3; then
+- if test "$version" = 3 && test "$patchlevel" -le 11; then
++ if test "$version" = 3 && test "$patchlevel" -le 12; then
+ : # Linux 3.x
+ else
+- AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.11.x is not supported])
++ AC_ERROR([Linux kernel in $KBUILD is version $kversion, but version newer than 3.12.x is not supported])
+ fi
+ else
+ if test "$version" -le 1 || test "$patchlevel" -le 5 || test "$sublevel" -le 31; then
diff --git a/net-misc/openvswitch/files/xcp-interface-reconfigure.patch b/net-misc/openvswitch/files/xcp-interface-reconfigure.patch
new file mode 100644
index 000000000000..8f685b8157f5
--- /dev/null
+++ b/net-misc/openvswitch/files/xcp-interface-reconfigure.patch
@@ -0,0 +1,20 @@
+Description: Use xcp-xapi interface-reconfigure if found
+ Ubuntu/Debian provide the XCP interface-reconfigure hook in
+ a FHS compliant location; use this if found.
+Author: James Page <james.page@ubuntu.com>
+Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/1195053
+Forwarded: no
+
+--- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
++++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
+@@ -43,6 +43,10 @@ def delete_cacert():
+ def update(session, args):
+ # Refresh bridge network UUIDs in case this host joined or left a pool.
+ script = "/opt/xensource/libexec/interface-reconfigure"
++ # NOTE(jamespage): Override with distro xcp xapi locations
++ # if present
++ if os.path.exists('/usr/lib/xcp/lib/interface-reconfigure'):
++ script = '/usr/lib/xcp/lib/interface-reconfigure'
+ try:
+ retval = subprocess.call([script, "rewrite"])
+ if retval != 0:
diff --git a/net-misc/openvswitch/openvswitch-2.0.0-r2.ebuild b/net-misc/openvswitch/openvswitch-2.0.0-r2.ebuild
new file mode 100644
index 000000000000..93d1c782a314
--- /dev/null
+++ b/net-misc/openvswitch/openvswitch-2.0.0-r2.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvswitch/openvswitch-2.0.0-r2.ebuild,v 1.1 2014/02/09 08:56:18 prometheanfire Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils linux-info linux-mod python-single-r1 systemd autotools
+
+DESCRIPTION="Production quality, multilayer virtual switch"
+HOMEPAGE="http://openvswitch.org"
+SRC_URI="http://openvswitch.org/releases/${P}.tar.gz"
+
+LICENSE="Apache-2.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug modules monitor +ssl"
+
+RDEPEND=">=sys-apps/openrc-0.10.5
+ ssl? ( dev-libs/openssl )
+ monitor? (
+ ${PYTHON_DEPS}
+ dev-python/twisted-core
+ dev-python/twisted-conch
+ dev-python/twisted-web
+ dev-python/PyQt4[${PYTHON_USEDEP}]
+ net-zope/zope-interface[${PYTHON_USEDEP}] )
+ debug? ( dev-lang/perl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+CONFIG_CHECK="~NET_CLS_ACT ~NET_CLS_U32 ~NET_SCH_INGRESS ~NET_ACT_POLICE ~IPV6 ~TUN"
+MODULE_NAMES="openvswitch(net:${S}/datapath/linux)"
+BUILD_TARGETS="all"
+
+pkg_setup() {
+ if use modules ; then
+ CONFIG_CHECK+=" ~!OPENVSWITCH"
+ kernel_is ge 2 6 32 || die "Linux >=2.6.32 and <3.10 required"
+ kernel_is lt 3 14 || die "Linux >=2.6.18 and <3.14 required"
+ linux-mod_pkg_setup
+ else
+ CONFIG_CHECK+=" ~OPENVSWITCH"
+ linux-info_pkg_setup
+ fi
+ use monitor && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Never build kernelmodules, doing this manually
+ sed -i \
+ -e '/^SUBDIRS/d' \
+ datapath/Makefile.in || die "sed failed"
+ epatch "${FILESDIR}/prevent-traceback.patch"
+ epatch "${FILESDIR}/kernel-3.11-support.patch"
+ epatch "${FILESDIR}/xcp-interface-reconfigure.patch"
+# epatch "${FILESDIR}/atomic-test.patch"
+ epatch "${FILESDIR}/kernel-3.12-support.patch"
+ epatch "${FILESDIR}/configure.patch"
+ eautoreconf
+}
+src_configure() {
+ set_arch_to_kernel
+ use monitor || export ovs_cv_python="no"
+ use pyside || export ovs_cv_pyuic4="no"
+
+ local linux_config
+ use modules && linux_config="--with-linux=${KV_OUT_DIR}"
+
+ econf ${linux_config} \
+ --with-rundir=/var/run/openvswitch \
+ --with-logdir=/var/log/openvswitch \
+ --with-pkidir=/etc/ssl/openvswitch \
+ --with-dbdir=/var/lib/openvswitch \
+ $(use_enable ssl) \
+ $(use_enable !debug ndebug)
+}
+
+src_compile() {
+ default
+
+ use monitor && python_fix_shebang \
+ utilities/ovs-{pcap,tcpundump,test,vlan-test} \
+ utilities/bugtool/ovs-bugtool \
+ ovsdb/ovsdbmonitor/ovsdbmonitor
+
+ use modules && linux-mod_src_compile
+}
+
+src_install() {
+ default
+
+ if use monitor ; then
+ python_domodule "${ED}"/usr/share/openvswitch/python/*
+ rm -r "${ED}/usr/share/openvswitch/python"
+ python_optimize "${ED}/usr/share/ovsdbmonitor"
+ fi
+ # not working without the brcompat_mod kernel module which did not get
+ # included in the kernel and we can't build it anymore
+ rm "${D}/usr/sbin/ovs-brcompatd" "${D}/usr/share/man/man8/ovs-brcompatd.8"
+
+ keepdir /var/{lib,log}/openvswitch
+ keepdir /etc/ssl/openvswitch
+ fperms 0750 /etc/ssl/openvswitch
+
+ rm -rf "${ED}/var/run"
+ use monitor || rmdir "${ED}/usr/share/ovsdbmonitor"
+ use debug || rm "${ED}/usr/bin/ovs-parse-leaks"
+
+ newconfd "${FILESDIR}/ovsdb-server_conf2" ovsdb-server
+ newconfd "${FILESDIR}/ovs-vswitchd_conf" ovs-vswitchd
+ newconfd "${FILESDIR}/ovs-controller_conf" ovs-controller
+ newinitd "${FILESDIR}/ovsdb-server-r1" ovsdb-server
+ newinitd "${FILESDIR}/ovs-vswitchd-r1" ovs-vswitchd
+ newinitd "${FILESDIR}/ovs-controller-r1" ovs-controller
+
+ systemd_dounit "${FILESDIR}/ovsdb-server.service"
+ systemd_dounit "${FILESDIR}/ovs-vswitchd.service"
+ systemd_dounit "${FILESDIR}/ovs-controller.service"
+ systemd_newtmpfilesd "${FILESDIR}/openvswitch.tmpfiles" openvswitch.conf
+
+ insinto /etc/logrotate.d
+ newins rhel/etc_logrotate.d_openvswitch openvswitch
+
+ use modules && linux-mod_src_install
+}
+
+pkg_postinst() {
+ use modules && linux-mod_pkg_postinst
+
+ for pv in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 1.9.0 ${pv} ; then
+ ewarn "The configuration database for Open vSwitch got moved in version 1.9.0 from"
+ ewarn " /etc/openvswitch"
+ ewarn "to"
+ ewarn " /var/lib/openvswitch"
+ ewarn "Please copy/move the database manually before running the schema upgrade."
+ ewarn "The PKI files are now supposed to go to /etc/ssl/openvswitch"
+ fi
+ done
+
+ elog "Use the following command to create an initial database for ovsdb-server:"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ elog "(will create a database in /var/lib/openvswitch/conf.db)"
+ elog "or to convert the database to the current schema after upgrading."
+}
+
+pkg_config() {
+ local db="${EPREFIX}/var/lib/openvswitch/conf.db"
+ if [ -e "${db}" ] ; then
+ einfo "Database '${db}' already exists, doing schema migration..."
+ einfo "(if the migration fails, make sure that ovsdb-server is not running)"
+ "${EPREFIX}/usr/bin/ovsdb-tool" convert "${db}" "${EPREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "converting database failed"
+ else
+ einfo "Creating new database '${db}'..."
+ "${EPREFIX}/usr/bin/ovsdb-tool" create "${db}" "${EPREFIX}/usr/share/openvswitch/vswitch.ovsschema" || die "creating database failed"
+ fi
+}