diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 14:59:38 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 16:43:32 +0000 |
commit | d849ec78de728ef9a2d383b92ccfeabf40f8f1d0 (patch) | |
tree | 3f856aa8d0f07fb207894822f4ba5db495ce0b1b /import-layers/meta-virtualization/recipes-networking/openvswitch | |
parent | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (diff) | |
download | talos-openbmc-d849ec78de728ef9a2d383b92ccfeabf40f8f1d0.tar.gz talos-openbmc-d849ec78de728ef9a2d383b92ccfeabf40f8f1d0.zip |
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>
Diffstat (limited to 'import-layers/meta-virtualization/recipes-networking/openvswitch')
17 files changed, 1263 insertions, 0 deletions
diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/configure-Only-link-against-libpcap-on-FreeBSD.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/configure-Only-link-against-libpcap-on-FreeBSD.patch new file mode 100644 index 000000000..0a44b85eb --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/configure-Only-link-against-libpcap-on-FreeBSD.patch @@ -0,0 +1,70 @@ +From d30e714ccb9d13caf39d14d5b2fc9523b678ed51 Mon Sep 17 00:00:00 2001 +From: Ben Pfaff <blp@nicira.com> +Date: Thu, 14 Mar 2013 15:20:55 -0700 +Subject: [PATCH] configure: Only link against libpcap on FreeBSD. + +commit d30e714ccb9d13caf39d14d5b2fc9523b678ed51 upstream +http://git.openvswitch.org/git/openvswitch + +On other platforms there is no benefit to linking against libpcap, because +it is not used. + +Signed-off-by: Ben Pfaff <blp@nicira.com> +CC: Ed Maste <emaste@freebsd.org> +--- + acinclude.m4 | 7 ++++++- + configure.ac | 3 +-- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index f0610c9..19a47dd 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -1,6 +1,6 @@ + # -*- autoconf -*- + +-# Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. ++# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. +@@ -295,6 +295,8 @@ AC_DEFUN([OVS_CHECK_IF_PACKET], + fi]) + + dnl Checks for net/if_dl.h. ++dnl ++dnl (We use this as a proxy for checking whether we're building on FreeBSD.) + AC_DEFUN([OVS_CHECK_IF_DL], + [AC_CHECK_HEADER([net/if_dl.h], + [HAVE_IF_DL=yes], +@@ -303,6 +305,9 @@ AC_DEFUN([OVS_CHECK_IF_DL], + if test "$HAVE_IF_DL" = yes; then + AC_DEFINE([HAVE_IF_DL], [1], + [Define to 1 if net/if_dl.h is available.]) ++ ++ # On FreeBSD we use libpcap to access network devices. ++ AC_SEARCH_LIBS([pcap_open_live], [pcap]) + fi]) + + dnl Checks for buggy strtok_r. +diff --git a/configure.ac b/configure.ac +index 1cacd29..bd49179 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,4 +1,4 @@ +-# Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. ++# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. +@@ -44,7 +44,6 @@ AC_SYS_LARGEFILE + AC_SEARCH_LIBS([pow], [m]) + AC_SEARCH_LIBS([clock_gettime], [rt]) + AC_SEARCH_LIBS([timer_create], [rt]) +-AC_SEARCH_LIBS([pcap_open_live], [pcap]) + + OVS_CHECK_ESX + OVS_CHECK_COVERAGE +-- +1.8.3.2 + diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-more-target-python-substitutions.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-more-target-python-substitutions.patch new file mode 100644 index 000000000..2b87a1161 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-more-target-python-substitutions.patch @@ -0,0 +1,50 @@ +From d1ab2f62a03c2c977de6fed5fca8de63e328a870 Mon Sep 17 00:00:00 2001 +Message-Id: <d1ab2f62a03c2c977de6fed5fca8de63e328a870.1391527986.git.Jim.Somerville@windriver.com> +From: Jim Somerville <Jim.Somerville@windriver.com> +Date: Tue, 4 Feb 2014 15:30:41 +0000 +Subject: [PATCH 1/1] openvswitch: add more target python substitutions + +The TARGET_PYTHON variable is used for script +substitutions to ensure the scripts will be able to properly execute +if the target system has a different path for the python. + +Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> +--- + ovsdb/ovsdb-dot.in | 2 +- + ovsdb/ovsdb-idlc.in | 2 +- + utilities/ovs-dpctl-top.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in +index 85c126d..402a77c 100755 +--- a/ovsdb/ovsdb-dot.in ++++ b/ovsdb/ovsdb-dot.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + + from datetime import date + import ovs.db.error +diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in +index ec1c655..f5c135f 100755 +--- a/ovsdb/ovsdb-idlc.in ++++ b/ovsdb/ovsdb-idlc.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + + import getopt + import os +diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in +index f43fdeb..8475118 100755 +--- a/utilities/ovs-dpctl-top.in ++++ b/utilities/ovs-dpctl-top.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + # + # Copyright (c) 2013 Nicira, Inc. + # +-- +1.8.3.4 + diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch new file mode 100644 index 000000000..cb708deae --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-ptest.patch @@ -0,0 +1,68 @@ +Add test-install rule to support ptest execution + +Signed-off-by: Radu Patriu <radu.patriu@enea.com> + +Index: openvswitch-2.1.2/Makefile.am +=================================================================== +--- openvswitch-2.1.2.orig/Makefile.am ++++ openvswitch-2.1.2/Makefile.am +@@ -300,3 +300,5 @@ + include python/compat/automake.mk + include tutorial/automake.mk + include vtep/automake.mk ++include test.mk ++ +Index: openvswitch-2.1.2/test.mk +=================================================================== +--- /dev/null ++++ openvswitch-2.1.2/test.mk +@@ -0,0 +1,49 @@ ++TEST_DEST ?= ${prefix}/lib/openvswitch ++TEST_ROOT ?= ${prefix}/lib/openvswitch ++TEST_DEPEND = ++ ++if HAVE_OPENSSL ++TEST_DEPEND += $(TESTPKI_FILES) ++endif ++ ++test-install: $(TEST_DEPEND) ++ @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\ ++ install -d $(TEST_DEST)/tests ;\ ++ install -d $(TEST_DEST)/python ;\ ++ install -d $(TEST_DEST)/python/ovs ;\ ++ install -d $(TEST_DEST)/python/ovs/db ;\ ++ install -d $(TEST_DEST)/python/ovs/unixctl ;\ ++ install -d $(TEST_DEST)/vswitchd ;\ ++ install vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\ ++ install -d $(TEST_DEST)/debian ;\ ++ install debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\ ++ install -d $(TEST_DEST)/build-aux ;\ ++ install build-aux/check-structs $(TEST_DEST)/build-aux ;\ ++ install -d $(TEST_DEST)/xenserver ;\ ++ install xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\ ++ install xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\ ++ install xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\ ++ install xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\ ++ install xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\ ++ install -d $(TEST_DEST)/vtep ;\ ++ install vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\ ++ for p in $$list ; do \ ++ echo $$p ;\ ++ p=$${p#./} ;\ ++ pre=$${p#tests\/} ;\ ++ if test $$pre != $$p ; then \ ++ echo installing $$p to $(TEST_DEST)/tests/$$pre ;\ ++ install $$p $(TEST_DEST)/tests/$$pre ;\ ++ continue ;\ ++ fi ;\ ++ pre=$${p#python\/ovs\/} ;\ ++ if test $$pre != $$p ; then \ ++ echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\ ++ install $$p $(TEST_DEST)/python/ovs/$$pre ;\ ++ continue ;\ ++ fi; \ ++ done ;\ ++ sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-perl-handling.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-perl-handling.patch new file mode 100644 index 000000000..98224b422 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-perl-handling.patch @@ -0,0 +1,48 @@ +From 569ac1066cd3046b8ac899153df9f07908d45145 Mon Sep 17 00:00:00 2001 +From: Mark Asselstine <mark.asselstine@windriver.com> +Date: Fri, 21 Jun 2013 11:16:00 -0400 +Subject: [PATCH] openvswitch: add target perl handling + +Allow the build to specify a path for the perl instead of reusing +the PERL variable which can lead to inconsistencies if we are cross +compiling. The TARGET_PERL variable will be used for script +substitutions to ensure the scripts will be able to properly execute +if the target system has a different path for the perl. + +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +--- + Makefile.am | 1 + + configure.ac | 7 +++++++ + utilities/ovs-parse-leaks.in | 2 +- + 3 files changed, 9 insertions(+), 1 deletion(-) + +Index: openvswitch-2.0.0/Makefile.am +=================================================================== +--- openvswitch-2.0.0.orig/Makefile.am ++++ openvswitch-2.0.0/Makefile.am +@@ -114,6 +114,7 @@ + -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ + -e 's,[@]DBDIR[@],$(DBDIR),g' \ + -e 's,[@]PERL[@],$(PERL),g' \ ++ -e 's,[@]TARGET_PERL[@],$(TARGET_PERL),g' \ + -e 's,[@]PYTHON[@],$(PYTHON),g' \ + -e 's,[@]TARGET_PYTHON[@],$(TARGET_PYTHON),g' \ + -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ +Index: openvswitch-2.0.0/configure.ac +=================================================================== +--- openvswitch-2.0.0.orig/configure.ac ++++ openvswitch-2.0.0/configure.ac +@@ -115,6 +115,13 @@ + AC_SUBST(KARCH) + OVS_CHECK_LINUX + ++if test "$TARGET_PERL"; then ++ TARGET_PERL=$TARGET_PERL ++else ++ TARGET_PERL=$PERL ++fi ++AC_SUBST(TARGET_PERL) ++ + if test "$TARGET_PYTHON"; then + TARGET_PYTHON=$TARGET_PYTHON + else diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-python-handling.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-python-handling.patch new file mode 100644 index 000000000..97b352cb5 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-add-target-python-handling.patch @@ -0,0 +1,136 @@ +From e8a5d34885c5fdba7d951fb1bb85131cbafca432 Mon Sep 17 00:00:00 2001 +From: Mark Asselstine <mark.asselstine@windriver.com> +Date: Wed, 19 Jun 2013 17:25:56 -0400 +Subject: [PATCH] openvswitch: add target python handling + +Allow the build to specify a path for the python instead of reusing +the PYTHON variable which can lead to inconsistencies if we are cross +compiling. The TARGET_PYTHON variable will be used for script +substitutions to ensure the scripts will be able to properly execute +if the target system has a different path for the python. + +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> +--- + Makefile.am | 1 + + configure.ac | 7 +++++++ + ovsdb/ovsdbmonitor/ovsdbmonitor.in | 2 +- + utilities/bugtool/ovs-bugtool.in | 2 +- + utilities/ovs-check-dead-ifs.in | 2 +- + utilities/ovs-l3ping.in | 2 +- + utilities/ovs-parse-backtrace.in | 2 +- + utilities/ovs-pcap.in | 2 +- + utilities/ovs-tcpundump.in | 2 +- + utilities/ovs-test.in | 2 +- + utilities/ovs-vlan-test.in | 2 +- + 11 files changed, 17 insertions(+), 9 deletions(-) + +Index: openvswitch-2.1.2/Makefile.am +=================================================================== +--- openvswitch-2.1.2.orig/Makefile.am ++++ openvswitch-2.1.2/Makefile.am +@@ -125,6 +125,7 @@ + -e 's,[@]DBDIR[@],$(DBDIR),g' \ + -e 's,[@]PERL[@],$(PERL),g' \ + -e 's,[@]PYTHON[@],$(PYTHON),g' \ ++ -e 's,[@]TARGET_PYTHON[@],$(TARGET_PYTHON),g' \ + -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ + -e 's,[@]VERSION[@],$(VERSION),g' \ + -e 's,[@]localstatedir[@],$(localstatedir),g' \ +Index: openvswitch-2.1.2/configure.ac +=================================================================== +--- openvswitch-2.1.2.orig/configure.ac ++++ openvswitch-2.1.2/configure.ac +@@ -118,6 +118,13 @@ + AC_SUBST(KARCH) + OVS_CHECK_LINUX + ++if test "$TARGET_PYTHON"; then ++ TARGET_PYTHON=$TARGET_PYTHON ++else ++ TARGET_PYTHON=$PYTHON ++fi ++AC_SUBST(TARGET_PYTHON) ++ + AC_CONFIG_FILES(Makefile) + AC_CONFIG_FILES(datapath/Makefile) + AC_CONFIG_FILES(datapath/linux/Kbuild) +Index: openvswitch-2.1.2/utilities/bugtool/ovs-bugtool.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/bugtool/ovs-bugtool.in ++++ openvswitch-2.1.2/utilities/bugtool/ovs-bugtool.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + + # This library is free software; you can redistribute it and/or + # modify it under the terms of version 2.1 of the GNU Lesser General Public +Index: openvswitch-2.1.2/utilities/ovs-check-dead-ifs.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/ovs-check-dead-ifs.in ++++ openvswitch-2.1.2/utilities/ovs-check-dead-ifs.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + + import os + import re +Index: openvswitch-2.1.2/utilities/ovs-l3ping.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/ovs-l3ping.in ++++ openvswitch-2.1.2/utilities/ovs-l3ping.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. +Index: openvswitch-2.1.2/utilities/ovs-parse-backtrace.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/ovs-parse-backtrace.in ++++ openvswitch-2.1.2/utilities/ovs-parse-backtrace.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + # + # Copyright (c) 2012 Nicira, Inc. + # +Index: openvswitch-2.1.2/utilities/ovs-pcap.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/ovs-pcap.in ++++ openvswitch-2.1.2/utilities/ovs-pcap.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + # + # Copyright (c) 2010 Nicira, Inc. + # +Index: openvswitch-2.1.2/utilities/ovs-tcpundump.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/ovs-tcpundump.in ++++ openvswitch-2.1.2/utilities/ovs-tcpundump.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + # + # Copyright (c) 2010 Nicira, Inc. + # +Index: openvswitch-2.1.2/utilities/ovs-test.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/ovs-test.in ++++ openvswitch-2.1.2/utilities/ovs-test.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. +Index: openvswitch-2.1.2/utilities/ovs-vlan-test.in +=================================================================== +--- openvswitch-2.1.2.orig/utilities/ovs-vlan-test.in ++++ openvswitch-2.1.2/utilities/ovs-vlan-test.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! @TARGET_PYTHON@ + # + # Copyright (c) 2010 Nicira, Inc. + # diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-example b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-example new file mode 100644 index 000000000..6f08c3fab --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-example @@ -0,0 +1,102 @@ +#! /bin/sh +# +# Copyright (C) 2011 Nicira Networks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +### BEGIN INIT INFO +# Provides: openvswitch-switch +# Required-Start: $network $named $remote_fs $syslog +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch switch +### END INIT INFO + +(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0 + +. /usr/share/openvswitch/scripts/ovs-lib +test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch + +if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then + BRCOMPAT=no + log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility" +fi + +ovs_ctl () { + set /usr/share/openvswitch/scripts/ovs-ctl "$@" + if test X"$BRCOMPAT" = Xyes; then + set "$@" --brcompat + fi + "$@" +} + +load_kmod () { + ovs_ctl load-kmod || exit $? +} + +start () { + if ovs_ctl load-kmod; then + : + else + echo "Module has probably not been built for this kernel." + if ! test -d /usr/share/doc/openvswitch-datapath-source; then + echo "Install the openvswitch-datapath-source package, then read" + else + echo "For instructions, read" + fi + echo "/usr/share/doc/openvswitch-datapath-source/README.Debian" + fi + set ovs_ctl ${1-start} --system-id=random + if test X"$FORCE_COREFILES" != X; then + set "$@" --force-corefiles="$FORCE_COREFILES" + fi + "$@" || exit $? + + ovs_ctl --protocol=gre enable-protocol +} + +stop () { + ovs_ctl stop +} + +case $1 in + start) + start + ;; + stop | force-stop) + stop + ;; + reload | force-reload) + # The OVS daemons keep up-to-date. + ;; + restart) + stop + start + ;; + status) + ovs_ctl status + ;; + force-reload-kmod) + start force-reload-kmod + ;; + load-kmod) + load_kmod + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch new file mode 100644 index 000000000..6f08c3fab --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch @@ -0,0 +1,102 @@ +#! /bin/sh +# +# Copyright (C) 2011 Nicira Networks, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +### BEGIN INIT INFO +# Provides: openvswitch-switch +# Required-Start: $network $named $remote_fs $syslog +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch switch +### END INIT INFO + +(test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0 + +. /usr/share/openvswitch/scripts/ovs-lib +test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch + +if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then + BRCOMPAT=no + log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility" +fi + +ovs_ctl () { + set /usr/share/openvswitch/scripts/ovs-ctl "$@" + if test X"$BRCOMPAT" = Xyes; then + set "$@" --brcompat + fi + "$@" +} + +load_kmod () { + ovs_ctl load-kmod || exit $? +} + +start () { + if ovs_ctl load-kmod; then + : + else + echo "Module has probably not been built for this kernel." + if ! test -d /usr/share/doc/openvswitch-datapath-source; then + echo "Install the openvswitch-datapath-source package, then read" + else + echo "For instructions, read" + fi + echo "/usr/share/doc/openvswitch-datapath-source/README.Debian" + fi + set ovs_ctl ${1-start} --system-id=random + if test X"$FORCE_COREFILES" != X; then + set "$@" --force-corefiles="$FORCE_COREFILES" + fi + "$@" || exit $? + + ovs_ctl --protocol=gre enable-protocol +} + +stop () { + ovs_ctl stop +} + +case $1 in + start) + start + ;; + stop | force-stop) + stop + ;; + reload | force-reload) + # The OVS daemons keep up-to-date. + ;; + restart) + stop + start + ;; + status) + ovs_ctl status + ;; + force-reload-kmod) + start force-reload-kmod + ;; + load-kmod) + load_kmod + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status|force-stop|force-reload-kmod|load-kmod}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch-setup b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch-setup new file mode 100644 index 000000000..73387fbc1 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-switch-setup @@ -0,0 +1,8 @@ +# This is a POSIX shell fragment -*- sh -*- + +# FORCE_COREFILES: If 'yes' then core files will be enabled. +# FORCE_COREFILES=yes + +# BRCOMPAT: If 'yes' and the openvswitch-brcompat package is installed, then +# Linux bridge compatibility will be enabled. +# BRCOMPAT=yes diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller new file mode 100755 index 000000000..aad5ad60e --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller @@ -0,0 +1,274 @@ +#!/bin/sh +# +# Copyright (c) 2011 Nicira Networks Inc. +# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org> +# +# This is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, +# or (at your option) any later version. +# +# This is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License with +# the Debian operating system, in /usr/share/common-licenses/GPL; if +# not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# +### BEGIN INIT INFO +# Provides: openvswitch-testcontroller +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $remote_fs +# Should-Start: $named +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Open vSwitch controller +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/bin/ovs-testcontroller # Introduce the server's location here +NAME=ovs-testcontroller # Introduce the short server's name here +DESC=ovs-testcontroller # Introduce a short description here +LOGDIR=/var/log/openvswitch # Log directory to use + +PIDFILE=/var/run/openvswitch/$NAME.pid + +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +# Default options, these can be overriden by the information +# at /etc/default/openvswitch-testcontroller +DAEMON_OPTS="" # Additional options given to the server + +DODTIME=10 # Time to wait for the server to die, in seconds + # If this value is set too low you might not + # let some servers to die gracefully and + # 'restart' will not work + +LOGFILE=$LOGDIR/$NAME.log # Server logfile +#DAEMONUSER= # User to run the daemons as. If this value + # is set start-stop-daemon will chuid the server + +# Include defaults if available +default=/etc/default/openvswitch-testcontroller +if [ -f $default ] ; then + . $default +fi + +# Check that the user exists (if we set a user) +# Does the user exist? +if [ -n "$DAEMONUSER" ] ; then + if getent passwd | grep -q "^$DAEMONUSER:"; then + # Obtain the uid and gid + DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` + DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` + else + log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." + exit 1 + fi +fi + + +set -e + +running_pid() { +# Check if a given process pid's cmdline matches a given name + pid=$1 + name=$2 + [ -z "$pid" ] && return 1 + [ ! -d /proc/$pid ] && return 1 + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` + # Is this the expected server + [ "$cmd" != "$name" ] && return 1 + return 0 +} + +running() { +# Check if the process is running looking at /proc +# (works for all users) + + # No pidfile, probably no daemon present + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` + running_pid $pid $DAEMON || return 1 + return 0 +} + +start_server() { + if [ -z "$LISTEN" ]; then + echo "$default: No connection methods configured, controller disabled" >&2 + exit 0 + fi + + if [ ! -d /var/run/openvswitch ]; then + install -d -m 755 -o root -g root /var/run/openvswitch + fi + + SSL_OPTS= + case $LISTEN in + *ssl*) + : ${PRIVKEY:=/etc/openvswitch-testcontroller/privkey.pem} + : ${CERT:=/etc/openvswitch-testcontroller/cert.pem} + : ${CACERT:=/etc/openvswitch-testcontroller/cacert.pem} + if test ! -e "$PRIVKEY" || test ! -e "$CERT" || + test ! -e "$CACERT"; then + if test ! -e "$PRIVKEY"; then + echo "$PRIVKEY: private key missing" >&2 + fi + if test ! -e "$CERT"; then + echo "$CERT: certificate for private key missing" >&2 + fi + if test ! -e "$CACERT"; then + echo "$CACERT: CA certificate missing" >&2 + fi + exit 1 + fi + SSL_OPTS="--private-key=$PRIVKEY --certificate=$CERT --ca-cert=$CACERT" + ;; + esac + +# Start the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + start-stop-daemon --start --pidfile $PIDFILE \ + --exec $DAEMON -- --detach --pidfile=$PIDFILE \ + $LISTEN $DAEMON_OPTS $SSL_OPTS + errcode=$? + else +# if we are using a daemonuser then change the user id + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --chuid $DAEMONUSER --exec $DAEMON -- \ + --detach --pidfile=$PIDFILE $LISTEN $DAEMON_OPTS \ + $SSL_OPTS + errcode=$? + fi + return $errcode +} + +stop_server() { +# Stop the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + errcode=$? + else +# if we are using a daemonuser then look for process that match + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER --exec $DAEMON + errcode=$? + fi + + return $errcode +} + +reload_server() { + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` # This is the daemon's pid + # Send a SIGHUP + kill -1 $pid + return $? +} + +force_stop() { +# Force the process to die killing it manually + [ ! -e "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + sleep "$DODTIME" + if running ; then + kill -9 $pid + sleep "$DODTIME" + if running ; then + echo "Cannot kill $NAME (pid=$pid)!" + exit 1 + fi + fi + fi + rm -f $PIDFILE +} + + +case "$1" in + start) + log_begin_msg "Starting $DESC " "$NAME" + # Check if it's running first + if running ; then + log_warning_msg "apparently already running" + log_end_msg 0 + exit 0 + fi + if start_server && running ; then + # It's ok, the server started and is running + log_end_msg 0 + else + # Either we could not start it or it is not running + # after we did + # NOTE: Some servers might die some time after they start, + # this code does not try to detect this and might give + # a false positive (use 'status' for that) + log_end_msg 1 + fi + ;; + stop) + log_begin_msg "Stopping $DESC" "$NAME" + if running ; then + # Only stop the server if we see it running + stop_server + log_end_msg $? + else + # If it's not running don't do anything + log_warning_msg "apparently not running" + log_end_msg 0 + exit 0 + fi + ;; + force-stop) + # First try to stop gracefully the program + $0 stop + if running; then + # If it's still running try to kill it more forcefully + log_begin_msg "Stopping (force) $DESC" "$NAME" + force_stop + log_end_msg $? + fi + ;; + restart|force-reload) + log_begin_msg "Restarting $DESC" "$NAME" + stop_server + # Wait some sensible amount, some server need this + [ -n "$DODTIME" ] && sleep $DODTIME + start_server + running + log_end_msg $? + ;; + status) + + log_begin_msg "Checking status of $DESC" "$NAME" + if running ; then + log_begin_msg "running" + log_end_msg 0 + else + log_warning_msg "apparently not running" + log_end_msg 1 + exit 1 + fi + ;; + # Use this if the daemon cannot reload + reload) + log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" + log_warning_msg "cannot re-read the config file (use restart)." + ;; + *) + N=/etc/init.d/openvswitch-testcontroller + echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller-setup b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller-setup new file mode 100644 index 000000000..b431ece51 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/openvswitch-testcontroller-setup @@ -0,0 +1,29 @@ +# This is a POSIX shell fragment -*- sh -*- + +# LISTEN: What OpenFlow connection methods should the controller listen on? +# +# This is a space-delimited list of connection methods: +# +# * "pssl:[PORT]": Listen for SSL connections on the specified PORT +# (default: 6633). The private key, certificate, and CA certificate +# must be specified below. +# +# * "pctp:[PORT]": Listen for TCP connections on the specified PORT +# (default: 6633). Not recommended for security reasons. +# +LISTEN="pssl:" + +# PRIVKEY: Name of file containing controller's private key. +# Required if SSL enabled. +PRIVKEY=/etc/openvswitch-testcontroller/privkey.pem + +# CERT: Name of file containing certificate for private key. +# Required if SSL enabled. +CERT=/etc/openvswitch-testcontroller/cert.pem + +# CACERT: Name of file containing switch CA certificate. +# Required if SSL enabled. +CACERT=/etc/openvswitch-testcontroller/cacert.pem + +# Additional options to pass to controller, e.g. "--hub" +DAEMON_OPTS="" diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/files/run-ptest b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/run-ptest new file mode 100644 index 000000000..dd0670762 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/files/run-ptest @@ -0,0 +1,4 @@ +#!/bin/sh + +./tests/testsuite --am-fmt -C tests AUTOTEST_PATH=utilities:vswitchd:ovsdb:tests + diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch new file mode 100644 index 000000000..1ad5d6f4c --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch @@ -0,0 +1,18 @@ +Disable m4 file test where sources are built from git. + +Signed-off-by: Amy Fong <amy.fong@windriver.com> +--- + Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Makefile.am ++++ b/Makefile.am +@@ -185,7 +185,7 @@ + # Makefile in datapath/linux, needed to get the list of files to + # distribute, requires GNU make extensions. + if GNU_MAKE +-ALL_LOCAL += dist-hook-git ++# ALL_LOCAL += dist-hook-git + dist-hook-git: distfiles + @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ + (cd datapath && $(MAKE) distfiles); \ diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch new file mode 100644 index 000000000..033cfb8a0 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch @@ -0,0 +1,20 @@ +Specify install path for kernel module + +Signed-off-by: Amy Fong <amy.fong@windriver.com> +--- + datapath/linux/Makefile.main.in | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +--- a/datapath/linux/Makefile.main.in ++++ b/datapath/linux/Makefile.main.in +@@ -71,8 +71,8 @@ + $(MAKE) -C $(KSRC) M=$(builddir) modules + + modules_install: +- $(MAKE) -C $(KSRC) M=$(builddir) modules_install +- depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h` ++ $(MAKE) -C $(KSRC) M=$(builddir) modules_install INSTALL_MOD_PATH=${INSTALL_MOD_PATH} ++ # depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h` + endif + + # Much of the kernel build system in this file is derived from Intel's diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-8c0b419a0b9ac0141d6973dcc80306dfc6a83d31.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-8c0b419a0b9ac0141d6973dcc80306dfc6a83d31.patch new file mode 100644 index 000000000..7e7404412 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-8c0b419a0b9ac0141d6973dcc80306dfc6a83d31.patch @@ -0,0 +1,110 @@ +From e20556d7cf0fc8258db77c1f3e0a160cf9fd4514 Mon Sep 17 00:00:00 2001 +From: He Zhe <zhe.he@windriver.com> +Date: Wed, 30 Mar 2016 06:23:45 -0400 +Subject: [PATCH] openvswitch: Add test-install rule to support ptest execution + +Signed-off-by: Radu Patriu <radu.patriu@enea.com> + +Fix ptest for v2.5 + - Copy certain files from srcdir since it has been different from + build directory. + - Copy more necessary files for new added test cases. + - Modify config files for running on target. + +Signed-off-by: He Zhe <zhe.he@windriver.com> +--- + Makefile.am | 1 + + test.mk | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 73 insertions(+) + create mode 100644 test.mk + +diff --git a/Makefile.am b/Makefile.am +index ed43c2f..f38d278 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -401,3 +401,4 @@ include datapath-windows/include/automake.mk + include windows/automake.mk + include ovn/automake.mk + include selinux/automake.mk ++include test.mk +diff --git a/test.mk b/test.mk +new file mode 100644 +index 0000000..b10a581 +--- /dev/null ++++ b/test.mk +@@ -0,0 +1,72 @@ ++TEST_DEST ?= ${prefix}/lib/openvswitch ++TEST_ROOT ?= ${prefix}/lib/openvswitch ++TEST_DEPEND = ++ ++if HAVE_OPENSSL ++TEST_DEPEND += $(TESTPKI_FILES) ++endif ++ ++test-install: $(TEST_DEPEND) ++ @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\ ++ install -d $(TEST_DEST)/tests ;\ ++ install $(srcdir)/vtep/ovs-vtep $(TEST_DEST)/tests ;\ ++ install -d $(TEST_DEST)/python ;\ ++ install -d $(TEST_DEST)/python/ovs ;\ ++ install -d $(TEST_DEST)/python/ovs/db ;\ ++ install -d $(TEST_DEST)/python/ovs/unixctl ;\ ++ install -d $(TEST_DEST)/vswitchd ;\ ++ install $(srcdir)/vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\ ++ install vswitchd/ovs-vswitchd $(TEST_DEST)/vswitchd ;\ ++ install -d $(TEST_DEST)/debian ;\ ++ install $(srcdir)/debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\ ++ install -d $(TEST_DEST)/build-aux ;\ ++ install $(srcdir)/build-aux/check-structs $(TEST_DEST)/build-aux ;\ ++ install -d $(TEST_DEST)/xenserver ;\ ++ install $(srcdir)/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\ ++ install $(srcdir)/xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\ ++ install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\ ++ install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\ ++ install $(srcdir)/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\ ++ install -d $(TEST_DEST)/vtep ;\ ++ install $(srcdir)/vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\ ++ install -d $(TEST_DEST)/ovn ;\ ++ install $(srcdir)/ovn/ovn-nb.ovsschema $(TEST_DEST)/ovn ;\ ++ install $(srcdir)/ovn/ovn-sb.ovsschema $(TEST_DEST)/ovn ;\ ++ install -d $(TEST_DEST)/utilities ;\ ++ install $(srcdir)/utilities/ovs-pcap.in $(TEST_DEST)/utilities ;\ ++ install $(srcdir)/utilities/ovs-pki.in $(TEST_DEST)/utilities ;\ ++ for p in $$list ; do \ ++ echo $$p ;\ ++ p=$${p#../git/} ;\ ++ pre=$${p#tests\/} ;\ ++ if test $$pre != $$p ; then \ ++ echo installing $$p to $(TEST_DEST)/tests/$$pre ;\ ++ if test -f $$p ; then \ ++ install $$p $(TEST_DEST)/tests/$$pre ;\ ++ else \ ++ install $(srcdir)/$$p $(TEST_DEST)/tests/$$pre ;\ ++ fi ;\ ++ continue ;\ ++ fi ;\ ++ pre=$${p#python\/ovs\/} ;\ ++ if test $$pre != $$p ; then \ ++ echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\ ++ if test -f $$p ; then \ ++ install $$p $(TEST_DEST)/python/ovs/$$pre ;\ ++ else \ ++ install $(srcdir)/$$p $(TEST_DEST)/python/ovs/$$pre ;\ ++ fi ;\ ++ continue ;\ ++ fi; \ ++ done ;\ ++ sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|at_srcdir=.*|at_srcdir='"'"'.'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|at_top_srcdir=.*|at_top_srcdir='"'"'..'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|at_top_build_prefix=.*|at_top_build_prefix='"'"'../'"'"'|g' $(TEST_DEST)/tests/atconfig ++ sed -i 's|^\(.*config\.log.*\)|#\1|g' $(TEST_DEST)/tests/testsuite ++ sed -i 's|$$srcdir|$$abs_srcdir|g' $(TEST_DEST)/tests/testsuite ++ sed -i 's|ovs-appctl-bashcomp\.bash|/etc/bash_completion.d/ovs-appctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite ++ sed -i 's|ovs-vsctl-bashcomp\.bash|/etc/bash_completion.d/ovs-vsctl-bashcomp\.bash|g' $(TEST_DEST)/tests/testsuite +-- +1.9.1 + diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-ptest-Fix-python-path.patch b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-ptest-Fix-python-path.patch new file mode 100644 index 000000000..c75ebc50d --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch-git/openvswitch-ptest-Fix-python-path.patch @@ -0,0 +1,30 @@ +From 2a78bddb865e0d3377f437428ed6825195af0a14 Mon Sep 17 00:00:00 2001 +From: He Zhe <zhe.he@windriver.com> +Date: Wed, 13 Apr 2016 03:13:01 -0400 +Subject: [PATCH] openvswitch: ptest: Fix python path + +For now PYTHON just happens to be the same as TARGET_PYTHON so we get the right +python binary. This patch sets PYTHON to TARGET_PYTHON since ptest is going to +be run on target. + +Signed-off-by: He Zhe <zhe.he@windriver.com> +--- + tests/atlocal.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/atlocal.in b/tests/atlocal.in +index 5815c6c..db2d2c9 100644 +--- a/tests/atlocal.in ++++ b/tests/atlocal.in +@@ -5,7 +5,7 @@ EGREP='@EGREP@' + PERL='@PERL@' + + if test x"$PYTHON" = x; then +- PYTHON='@PYTHON@' ++ PYTHON='@TARGET_PYTHON@' + fi + + PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH +-- +1.9.1 + diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc new file mode 100644 index 000000000..fc515e908 --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch.inc @@ -0,0 +1,141 @@ +SUMMARY = "OpenvSwitch" +DESCRIPTION = "\ + Open vSwitch is a production quality, multilayer virtual switch \ + licensed under the open source Apache 2.0 license. It is designed \ + to enable massive network automation through programmatic extension, \ + while still supporting standard management interfaces and protocols \ + (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag) \ + " + +HOMEPAGE = "http://openvswitch.org/" +SECTION = "networking" +LICENSE = "Apache-2" + +DEPENDS += "bridge-utils openssl python perl" + +RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \ + python perl perl-module-strict ${PN}-switch \ + bash" +RDEPENDS_${PN}-testcontroller = "${PN} lsb ${PN}-pki" +RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen" +RDEPENDS_${PN}-pki = "${PN}" +RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch" + +# Some installers will fail because of an install order based on +# rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be +# queued for install later. +RDEPENDS_${PN} += "sed gawk grep" + +SRC_URI = "\ + file://openvswitch-switch \ + file://openvswitch-switch-setup \ + file://openvswitch-testcontroller \ + file://openvswitch-testcontroller-setup \ + file://openvswitch-add-target-python-handling.patch \ + file://openvswitch-add-target-perl-handling.patch \ + " + +EXTRA_OECONF += "\ + TARGET_PYTHON=${bindir}/python \ + TARGET_PERL=${bindir}/perl \ + " +CONFIGUREOPT_DEPTRACK = "" + +# Don't compile kernel modules by default since it heavily depends on +# kernel version. Use the in-kernel module for now. +# distro layers can enable with EXTRA_OECONF_pn_openvswitch += "" +# EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}" + +ALLOW_EMPTY_${PN}-pki = "1" +PACKAGES =+ "${PN}-testcontroller ${PN}-switch ${PN}-brcompat ${PN}-pki" + +FILES_${PN}-testcontroller = "\ + ${sysconfdir}/init.d/openvswitch-testcontroller \ + ${sysconfdir}/default/openvswitch-testcontroller \ + ${sysconfdir}/openvswitch-testcontroller \ + ${bindir}/ovs-testcontroller \ + " + +FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd" + +FILES_${PN}-switch = "\ + ${sysconfdir}/init.d/openvswitch-switch \ + ${sysconfdir}/default/openvswitch-switch \ + ${systemd_unitdir}/system/openvswitch.service \ + ${systemd_unitdir}/system/openvswitch-nonetwork.service \ + " + +# silence a warning +FILES_${PN} += "${datadir}/ovsdbmonitor" +FILES_${PN} += "/run" + +inherit autotools update-rc.d systemd + +SYSTEMD_PACKAGES = "${PN}-switch" +SYSTEMD_SERVICE_${PN}-switch = " \ + openvswitch-nonetwork.service \ + openvswitch-switch.service \ +" + +INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-testcontroller" +INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch" +INITSCRIPT_PARAMS_${PN}-switch = "defaults 71" + +INITSCRIPT_NAME_${PN}-testcontroller = "openvswitch-testcontroller" +INITSCRIPT_PARAMS_${PN}-testcontroller = "defaults 72" + +do_install_append() { + install -d ${D}/${sysconfdir}/default/ + install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch + install -d ${D}/${sysconfdir}/openvswitch-testcontroller + install -m 660 ${WORKDIR}/openvswitch-testcontroller-setup ${D}/${sysconfdir}/default/openvswitch-testcontroller + + install -d ${D}/${sysconfdir}/init.d/ + install -m 755 ${WORKDIR}/openvswitch-testcontroller ${D}/${sysconfdir}/init.d/openvswitch-testcontroller + install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch + true || rm -fr ${D}/${datadir}/${PN}/pki + + install -d ${D}/${systemd_unitdir}/system/ + install -m 644 ${S}/rhel/usr_lib_systemd_system_openvswitch.service \ + ${D}/${systemd_unitdir}/system/openvswitch-switch.service + install -m 644 ${S}/rhel/usr_lib_systemd_system_openvswitch-nonetwork.service \ + ${D}/${systemd_unitdir}/system/openvswitch-nonetwork.service + + oe_runmake modules_install INSTALL_MOD_PATH=${D} +} + +pkg_postinst_${PN}-pki () { + # can't do this offline + if [ "x$D" != "x" ]; then + exit 1 + fi + if test ! -d $D/${datadir}/${PN}/pki; then + ovs-pki init --dir=$D/${datadir}/${PN}/pki + fi +} + +pkg_postinst_${PN}-testcontroller () { + # can't do this offline + if [ "x$D" != "x" ]; then + exit 1 + fi + + if test ! -d $D/${datadir}/${PN}/pki; then + ovs-pki init --dir=$D/${datadir}/${PN}/pki + fi + + cd $D/${sysconfdir}/openvswitch-testcontroller + if ! test -e cacert.pem; then + ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem + fi + if ! test -e privkey.pem || ! test -e cert.pem; then + oldumask=$(umask) + umask 077 + ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null + mv tmp-privkey.pem privkey.pem + mv tmp-cert.pem cert.pem + mv tmp-req.pem req.pem + chmod go+r cert.pem req.pem + umask $oldumask + fi +} diff --git a/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb new file mode 100644 index 000000000..b46d5af4e --- /dev/null +++ b/import-layers/meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb @@ -0,0 +1,53 @@ +require openvswitch.inc + +DEPENDS += "virtual/kernel" + +RDEPENDS_${PN}-ptest += "\ + python-logging python-syslog python-argparse python-io \ + python-fcntl python-shell python-lang python-xml python-math \ + python-datetime python-netclient python sed \ + ldd perl-module-socket perl-module-carp perl-module-exporter \ + perl-module-xsloader python-netserver python-threading \ + python-resource python-subprocess \ + " + +S = "${WORKDIR}/git" +PV = "2.5.0+${SRCREV}" + +FILESEXTRAPATHS_append := "${THISDIR}/${PN}-git:" + +SRCREV = "8c0b419a0b9ac0141d6973dcc80306dfc6a83d31" +SRC_URI += "\ + git://github.com/openvswitch/ovs.git;protocol=git;branch=branch-2.5 \ + file://openvswitch-add-more-target-python-substitutions.patch \ + file://openvswitch-add-ptest-${SRCREV}.patch \ + file://run-ptest \ + file://disable_m4_check.patch \ + file://kernel_module.patch \ + file://openvswitch-ptest-Fix-python-path.patch \ + " + +LIC_FILES_CHKSUM = "file://COPYING;md5=247d8817aece26b21a8cd6791b3ea994" + +PACKAGECONFIG ?= "" +PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}/opt/dpdk/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk," + +# Don't compile kernel modules by default since it heavily depends on +# kernel version. Use the in-kernel module for now. +# distro layers can enable with EXTRA_OECONF_pn_openvswitch += "" +# EXTRA_OECONF += "--with-linux=${STAGING_KERNEL_BUILDDIR} --with-linux-source=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}" + +# silence a warning +FILES_${PN} += "/lib/modules" + +inherit ptest + +EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" + +do_install_ptest() { + oe_runmake test-install +} + +do_install_append() { + oe_runmake modules_install INSTALL_MOD_PATH=${D} +} |