summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2015-01-29 09:56:03 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2015-02-03 14:10:55 -0500
commit2905d87e7e4f11573e9c12ed85ff70e4aefc701f (patch)
treebcb2033089912d510b6e1f4d00b1a30e8973aca3
parentb327673b51002ac95a32b104a6029218984a3184 (diff)
downloadmeta-virtualization-2905d87e7e4f11573e9c12ed85ff70e4aefc701f.tar.gz
Package openvswitch git
This revision corresponds to git rev 1667bb34988358aaf1c92d0d21fad4b1c8698780 (based on 2.3.90) Signed-off-by: Amy Fong <amy.fong@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch18
-rw-r--r--recipes-networking/openvswitch/openvswitch-git/kernel_module.patch20
-rw-r--r--recipes-networking/openvswitch/openvswitch-git/non_reproducible_builds_cleanup.patch18
-rw-r--r--recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-1667bb34988358aaf1c92d0d21fad4b1c8698780.patch69
-rw-r--r--recipes-networking/openvswitch/openvswitch_git.bb143
5 files changed, 268 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch b/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch
new file mode 100644
index 00000000..1ad5d6f4
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch-git/disable_m4_check.patch
@@ -0,0 +1,18 @@
1Disable m4 file test where sources are built from git.
2
3Signed-off-by: Amy Fong <amy.fong@windriver.com>
4---
5 Makefile.am | 2 +-
6 1 file changed, 1 insertion(+), 1 deletion(-)
7
8--- a/Makefile.am
9+++ b/Makefile.am
10@@ -185,7 +185,7 @@
11 # Makefile in datapath/linux, needed to get the list of files to
12 # distribute, requires GNU make extensions.
13 if GNU_MAKE
14-ALL_LOCAL += dist-hook-git
15+# ALL_LOCAL += dist-hook-git
16 dist-hook-git: distfiles
17 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
18 (cd datapath && $(MAKE) distfiles); \
diff --git a/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch b/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch
new file mode 100644
index 00000000..033cfb8a
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch-git/kernel_module.patch
@@ -0,0 +1,20 @@
1Specify install path for kernel module
2
3Signed-off-by: Amy Fong <amy.fong@windriver.com>
4---
5 datapath/linux/Makefile.main.in | 4 ++--
6 1 files changed, 2 insertions(+), 2 deletions(-)
7
8--- a/datapath/linux/Makefile.main.in
9+++ b/datapath/linux/Makefile.main.in
10@@ -71,8 +71,8 @@
11 $(MAKE) -C $(KSRC) M=$(builddir) modules
12
13 modules_install:
14- $(MAKE) -C $(KSRC) M=$(builddir) modules_install
15- depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h`
16+ $(MAKE) -C $(KSRC) M=$(builddir) modules_install INSTALL_MOD_PATH=${INSTALL_MOD_PATH}
17+ # depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h`
18 endif
19
20 # Much of the kernel build system in this file is derived from Intel's
diff --git a/recipes-networking/openvswitch/openvswitch-git/non_reproducible_builds_cleanup.patch b/recipes-networking/openvswitch/openvswitch-git/non_reproducible_builds_cleanup.patch
new file mode 100644
index 00000000..999f2ea7
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch-git/non_reproducible_builds_cleanup.patch
@@ -0,0 +1,18 @@
1Remove __DATE__, __TIME__ - error messages on non-reproducible builds
2
3Signed-off-by: Amy Fong <amy.fong@windriver.com>
4---
5 datapath/datapath.c | 2 +-
6 1 files changed, 1 insertions(+), 1 deletions(-)
7
8--- a/datapath/datapath.c
9+++ b/datapath/datapath.c
10@@ -2142,7 +2142,7 @@
11
12 BUILD_BUG_ON(sizeof(struct ovs_skb_cb) > FIELD_SIZEOF(struct sk_buff, cb));
13
14- pr_info("Open vSwitch switching datapath %s, built "__DATE__" "__TIME__"\n",
15+ pr_info("Open vSwitch switching datapath %s\n",
16 VERSION);
17
18 err = action_fifos_init();
diff --git a/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-1667bb34988358aaf1c92d0d21fad4b1c8698780.patch b/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-1667bb34988358aaf1c92d0d21fad4b1c8698780.patch
new file mode 100644
index 00000000..76e312ca
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch-git/openvswitch-add-ptest-1667bb34988358aaf1c92d0d21fad4b1c8698780.patch
@@ -0,0 +1,69 @@
1Add test-install rule to support ptest execution
2
3Signed-off-by: Radu Patriu <radu.patriu@enea.com>
4
5---
6 Makefile.am | 2 ++
7 test.mk | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
8 2 files changed, 51 insertions(+)
9
10--- a/Makefile.am
11+++ b/Makefile.am
12@@ -369,3 +369,5 @@
13 include vtep/automake.mk
14 include datapath-windows/automake.mk
15 include datapath-windows/include/automake.mk
16+include test.mk
17+
18--- /dev/null
19+++ b/test.mk
20@@ -0,0 +1,49 @@
21+TEST_DEST ?= ${prefix}/lib/openvswitch
22+TEST_ROOT ?= ${prefix}/lib/openvswitch
23+TEST_DEPEND =
24+
25+if HAVE_OPENSSL
26+TEST_DEPEND += $(TESTPKI_FILES)
27+endif
28+
29+test-install: $(TEST_DEPEND)
30+ @list='$(noinst_PROGRAMS) $(EXTRA_DIST) $(dist_check_SCRIPTS) $(TEST_DEPEND) tests/atlocal tests/atconfig' ;\
31+ install -d $(TEST_DEST)/tests ;\
32+ install -d $(TEST_DEST)/python ;\
33+ install -d $(TEST_DEST)/python/ovs ;\
34+ install -d $(TEST_DEST)/python/ovs/db ;\
35+ install -d $(TEST_DEST)/python/ovs/unixctl ;\
36+ install -d $(TEST_DEST)/vswitchd ;\
37+ install vswitchd/vswitch.ovsschema $(TEST_DEST)/vswitchd ;\
38+ install -d $(TEST_DEST)/debian ;\
39+ install debian/ovs-monitor-ipsec $(TEST_DEST)/debian ;\
40+ install -d $(TEST_DEST)/build-aux ;\
41+ install build-aux/check-structs $(TEST_DEST)/build-aux ;\
42+ install -d $(TEST_DEST)/xenserver ;\
43+ install xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync $(TEST_DEST)/xenserver ;\
44+ install xenserver/opt_xensource_libexec_interface-reconfigure $(TEST_DEST)/xenserver ;\
45+ install xenserver/opt_xensource_libexec_InterfaceReconfigure.py $(TEST_DEST)/xenserver ;\
46+ install xenserver/opt_xensource_libexec_InterfaceReconfigureBridge.py $(TEST_DEST)/xenserver ;\
47+ install xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py $(TEST_DEST)/xenserver ;\
48+ install -d $(TEST_DEST)/vtep ;\
49+ install vtep/vtep.ovsschema $(TEST_DEST)/vtep ;\
50+ for p in $$list ; do \
51+ echo $$p ;\
52+ p=$${p#./} ;\
53+ pre=$${p#tests\/} ;\
54+ if test $$pre != $$p ; then \
55+ echo installing $$p to $(TEST_DEST)/tests/$$pre ;\
56+ install $$p $(TEST_DEST)/tests/$$pre ;\
57+ continue ;\
58+ fi ;\
59+ pre=$${p#python\/ovs\/} ;\
60+ if test $$pre != $$p ; then \
61+ echo installing $$p to $(TEST_DEST)/python/ovs/$$pre ;\
62+ install $$p $(TEST_DEST)/python/ovs/$$pre ;\
63+ continue ;\
64+ fi; \
65+ done ;\
66+ sed -i 's|abs_builddir=.*|abs_builddir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
67+ sed -i 's|abs_srcdir=.*|abs_srcdir='"'"'$(TEST_ROOT)/tests'"'"'|g' $(TEST_DEST)/tests/atconfig
68+ sed -i 's|abs_top_srcdir=.*|abs_top_srcdir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
69+ sed -i 's|abs_top_builddir=.*|abs_top_builddir='"'"'$(TEST_ROOT)'"'"'|g' $(TEST_DEST)/tests/atconfig
diff --git a/recipes-networking/openvswitch/openvswitch_git.bb b/recipes-networking/openvswitch/openvswitch_git.bb
new file mode 100644
index 00000000..17bebae7
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch_git.bb
@@ -0,0 +1,143 @@
1SUMMARY = "OpenvSwitch"
2DESCRIPTION = "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)"
3HOMEPAGE = "http://openvswitch.org/"
4SECTION = "networking"
5LICENSE = "Apache-2 & GPLv2 & PSF"
6
7DEPENDS += "bridge-utils openssl python perl virtual/kernel"
8
9RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \
10 python perl perl-module-strict ${PN}-switch ${PN}-controller"
11RDEPENDS_${PN}-controller = "${PN} lsb ${PN}-pki"
12RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen"
13RDEPENDS_${PN}-pki = "${PN}"
14RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch"
15RRECOMMENDS_${PN} += "kernel-module-openvswitch"
16
17RDEPENDS_${PN}-ptest += "python-logging python-syslog python-argparse python-io \
18 python-fcntl python-shell python-lang python-xml python-math \
19 python-datetime python-netclient python sed"
20
21# Some installers will fail because of an install order based on
22# rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be
23# queued for install later.
24RDEPENDS_${PN} += "sed gawk grep"
25
26S = "${WORKDIR}/git"
27PV = "2.3.90+${SRCREV}"
28
29FILESEXTRAPATHS_append := "${THISDIR}/${PN}-git:"
30
31SRCREV = "1667bb34988358aaf1c92d0d21fad4b1c8698780"
32SRC_URI = "git://github.com/openvswitch/ovs.git;protocol=git \
33 file://openvswitch-switch \
34 file://openvswitch-switch-setup \
35 file://openvswitch-controller \
36 file://openvswitch-controller-setup \
37 file://openvswitch-add-target-python-handling.patch \
38 file://openvswitch-add-more-target-python-substitutions.patch \
39 file://openvswitch-add-ptest-${SRCREV}.patch \
40 file://run-ptest \
41 file://disable_m4_check.patch \
42 file://kernel_module.patch \
43 file://non_reproducible_builds_cleanup.patch \
44 "
45
46LIC_FILES_CHKSUM = "file://COPYING;md5=5973c953e3c8a767cf0808ff8a0bac1b"
47
48PACKAGECONFIG ?= "dpdk"
49PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}/opt/dpdk/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,"
50
51# Don't compile kernel modules by default since it heavily depends on
52# kernel version. Use the in-kernel module for now.
53# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
54EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}"
55
56EXTRA_OECONF += "TARGET_PYTHON=${bindir}/python \
57 TARGET_PERL=${bindir}/perl \
58 "
59
60ALLOW_EMPTY_${PN}-pki = "1"
61PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki"
62
63FILES_${PN}-controller = "${sysconfdir}/init.d/openvswitch-controller \
64 ${sysconfdir}/default/openvswitch-controller \
65 ${sysconfdir}/openvswitch-controller \
66 ${bindir}/ovs-controller"
67
68FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd"
69
70FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \
71 ${sysconfdir}/default/openvswitch-switch \
72 "
73# silence a warning
74FILES_${PN} += "${datadir}/ovsdbmonitor"
75FILES_${PN} += "/run"
76FILES_${PN} += "/lib/modules"
77
78inherit autotools update-rc.d ptest
79
80EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}"
81
82do_install_ptest() {
83 oe_runmake test-install
84}
85
86INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller"
87INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch"
88INITSCRIPT_PARAMS_${PN}-switch = "defaults 71"
89
90INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller"
91INITSCRIPT_PARAMS_${PN}-controller = "defaults 72"
92
93do_install_append() {
94 install -d ${D}/${sysconfdir}/default/
95 install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch
96 install -d ${D}/${sysconfdir}/openvswitch-controller
97 install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller
98
99 install -d ${D}/${sysconfdir}/init.d/
100 install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller
101 install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch
102 true || rm -fr ${D}/${datadir}/${PN}/pki
103
104 install -d ${D}/${sysconfdir}/init.d/
105
106 oe_runmake modules_install INSTALL_MOD_PATH=${D}
107}
108
109pkg_postinst_${PN}-pki () {
110 # can't do this offline
111 if [ "x$D" != "x" ]; then
112 exit 1
113 fi
114 if test ! -d $D/${datadir}/${PN}/pki; then
115 ovs-pki init --dir=$D/${datadir}/${PN}/pki
116 fi
117}
118
119pkg_postinst_${PN}-controller () {
120 # can't do this offline
121 if [ "x$D" != "x" ]; then
122 exit 1
123 fi
124
125 if test ! -d $D/${datadir}/${PN}/pki; then
126 ovs-pki init --dir=$D/${datadir}/${PN}/pki
127 fi
128
129 cd $D/${sysconfdir}/openvswitch-controller
130 if ! test -e cacert.pem; then
131 ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem
132 fi
133 if ! test -e privkey.pem || ! test -e cert.pem; then
134 oldumask=$(umask)
135 umask 077
136 ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null
137 mv tmp-privkey.pem privkey.pem
138 mv tmp-cert.pem cert.pem
139 mv tmp-req.pem req.pem
140 chmod go+r cert.pem req.pem
141 umask $oldumask
142 fi
143}