summaryrefslogtreecommitdiffstats
path: root/recipes-networking/openvswitch/openvswitch_1.10.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-networking/openvswitch/openvswitch_1.10.0.bb')
-rw-r--r--recipes-networking/openvswitch/openvswitch_1.10.0.bb102
1 files changed, 102 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/openvswitch_1.10.0.bb b/recipes-networking/openvswitch/openvswitch_1.10.0.bb
new file mode 100644
index 00000000..2e894540
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch_1.10.0.bb
@@ -0,0 +1,102 @@
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"
6
7DEPENDS += "bridge-utils openssl python perl"
8
9RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid \
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
17PR = "r0"
18
19SRC_URI = "http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \
20 file://openvswitch-switch \
21 file://openvswitch-switch-setup \
22 file://openvswitch-controller \
23 file://openvswitch-controller-setup \
24 "
25
26SRC_URI[md5sum] = "e9004202b0e10c0de9870f19d2044f11"
27SRC_URI[sha256sum] = "825730db82c7b46a142f057a43345590c299e66704ef7a88d9ed4ffd0c3d6b64"
28LIC_FILES_CHKSUM = "file://COPYING;md5=49eeb5acb1f5e510f12c44f176c42253"
29
30# Don't compile kernel modules by default since it heavily depends on
31# kernel version. Use the in-kernel module for now.
32# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
33# EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}"
34
35ALLOW_EMPTY_${PN}-pki = "1"
36PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki"
37
38FILES_${PN}-controller = "${sysconfdir}/init.d/openvswitch-controller \
39 ${sysconfdir}/default/openvswitch-controller \
40 ${sysconfdir}/openvswitch-controller \
41 ${bindir}/ovs-controller"
42
43FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd"
44
45FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \
46 ${sysconfdir}/default/openvswitch-switch \
47 "
48# silence a warning
49FILES_${PN} += "${datadir}/ovsdbmonitor"
50
51inherit autotools update-rc.d
52
53INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller"
54INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch"
55INITSCRIPT_PARAMS_${PN}-switch = "defaults 71"
56
57INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller"
58INITSCRIPT_PARAMS_${PN}-controller = "defaults 72"
59
60do_install_append() {
61 install -d ${D}/${sysconfdir}/default/
62 install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch
63 install -d ${D}/${sysconfdir}/openvswitch-controller
64 install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller
65
66 install -d ${D}/${sysconfdir}/init.d/
67 install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller
68 install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch
69 true || rm -fr ${D}/${datadir}/${PN}/pki
70}
71
72pkg_postinst_${PN}-pki () {
73 # can't do this offline
74 if [ "x$D" != "x" ]; then
75 exit 1
76 fi
77 if test ! -d $D/${datadir}/${PN}/pki; then
78 ovs-pki init --dir=$D/${datadir}/${PN}/pki
79 fi
80}
81
82pkg_postinst_${PN}-controller () {
83 # can't do this offline
84 if [ "x$D" != "x" ]; then
85 exit 1
86 fi
87
88 cd $D/${sysconfdir}/openvswitch-controller
89 if ! test -e cacert.pem; then
90 ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem
91 fi
92 if ! test -e privkey.pem || ! test -e cert.pem; then
93 oldumask=$(umask)
94 umask 077
95 ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null
96 mv tmp-privkey.pem privkey.pem
97 mv tmp-cert.pem cert.pem
98 mv tmp-req.pem req.pem
99 chmod go+r cert.pem req.pem
100 umask $oldumask
101 fi
102}