summaryrefslogtreecommitdiffstats
path: root/recipes-networking/openvswitch/openvswitch_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-networking/openvswitch/openvswitch_git.bb')
-rw-r--r--recipes-networking/openvswitch/openvswitch_git.bb115
1 files changed, 11 insertions, 104 deletions
diff --git a/recipes-networking/openvswitch/openvswitch_git.bb b/recipes-networking/openvswitch/openvswitch_git.bb
index 17bebae7..5580915f 100644
--- a/recipes-networking/openvswitch/openvswitch_git.bb
+++ b/recipes-networking/openvswitch/openvswitch_git.bb
@@ -1,27 +1,12 @@
1SUMMARY = "OpenvSwitch" 1require openvswitch.inc
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 2
7DEPENDS += "bridge-utils openssl python perl virtual/kernel" 3DEPENDS += "virtual/kernel"
8 4
9RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \ 5RDEPENDS_${PN}-ptest += "\
10 python perl perl-module-strict ${PN}-switch ${PN}-controller" 6 python-logging python-syslog python-argparse python-io \
11RDEPENDS_${PN}-controller = "${PN} lsb ${PN}-pki" 7 python-fcntl python-shell python-lang python-xml python-math \
12RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen" 8 python-datetime python-netclient python sed \
13RDEPENDS_${PN}-pki = "${PN}" 9 "
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 10
26S = "${WORKDIR}/git" 11S = "${WORKDIR}/git"
27PV = "2.3.90+${SRCREV}" 12PV = "2.3.90+${SRCREV}"
@@ -29,12 +14,8 @@ PV = "2.3.90+${SRCREV}"
29FILESEXTRAPATHS_append := "${THISDIR}/${PN}-git:" 14FILESEXTRAPATHS_append := "${THISDIR}/${PN}-git:"
30 15
31SRCREV = "1667bb34988358aaf1c92d0d21fad4b1c8698780" 16SRCREV = "1667bb34988358aaf1c92d0d21fad4b1c8698780"
32SRC_URI = "git://github.com/openvswitch/ovs.git;protocol=git \ 17SRC_URI += "\
33 file://openvswitch-switch \ 18 git://github.com/openvswitch/ovs.git;protocol=git \
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 \ 19 file://openvswitch-add-more-target-python-substitutions.patch \
39 file://openvswitch-add-ptest-${SRCREV}.patch \ 20 file://openvswitch-add-ptest-${SRCREV}.patch \
40 file://run-ptest \ 21 file://run-ptest \
@@ -51,31 +32,12 @@ PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}/opt/dpdk/${TARGET_ARCH}
51# Don't compile kernel modules by default since it heavily depends on 32# Don't compile kernel modules by default since it heavily depends on
52# kernel version. Use the in-kernel module for now. 33# kernel version. Use the in-kernel module for now.
53# distro layers can enable with EXTRA_OECONF_pn_openvswitch += "" 34# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
54EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}" 35EXTRA_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 36
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 37# silence a warning
74FILES_${PN} += "${datadir}/ovsdbmonitor"
75FILES_${PN} += "/run"
76FILES_${PN} += "/lib/modules" 38FILES_${PN} += "/lib/modules"
77 39
78inherit autotools update-rc.d ptest 40inherit ptest
79 41
80EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" 42EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}"
81 43
@@ -83,61 +45,6 @@ do_install_ptest() {
83 oe_runmake test-install 45 oe_runmake test-install
84} 46}
85 47
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() { 48do_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} 49 oe_runmake modules_install INSTALL_MOD_PATH=${D}
107} 50}
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}