summaryrefslogtreecommitdiffstats
path: root/recipes-networking/openvswitch
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2015-01-29 13:28:08 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2015-02-03 14:10:55 -0500
commit32158754790dfdd32a404aa609f4709a0753c9d5 (patch)
treebed5c39888d3d51ce43402350d75e09144833a93 /recipes-networking/openvswitch
parent2905d87e7e4f11573e9c12ed85ff70e4aefc701f (diff)
downloadmeta-virtualization-32158754790dfdd32a404aa609f4709a0753c9d5.tar.gz
openvswitch: restructure recipes
Add openvswitch.inc, removing common parts out of openvswitch*.bb Signed-off-by: Amy Fong <amy.fong@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-networking/openvswitch')
-rw-r--r--recipes-networking/openvswitch/openvswitch.inc127
-rw-r--r--recipes-networking/openvswitch/openvswitch_1.10.0.bb110
-rw-r--r--recipes-networking/openvswitch/openvswitch_2.1.3.bb119
-rw-r--r--recipes-networking/openvswitch/openvswitch_git.bb115
4 files changed, 151 insertions, 320 deletions
diff --git a/recipes-networking/openvswitch/openvswitch.inc b/recipes-networking/openvswitch/openvswitch.inc
new file mode 100644
index 00000000..ed979200
--- /dev/null
+++ b/recipes-networking/openvswitch/openvswitch.inc
@@ -0,0 +1,127 @@
1SUMMARY = "OpenvSwitch"
2DESCRIPTION = "\
3 Open vSwitch is a production quality, multilayer virtual switch \
4 licensed under the open source Apache 2.0 license. It is designed \
5 to enable massive network automation through programmatic extension, \
6 while still supporting standard management interfaces and protocols \
7 (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag) \
8 "
9
10HOMEPAGE = "http://openvswitch.org/"
11SECTION = "networking"
12LICENSE = "Apache-2"
13
14DEPENDS += "bridge-utils openssl python perl"
15
16RDEPENDS_${PN} += "util-linux-uuidgen util-linux-libuuid coreutils \
17 python perl perl-module-strict ${PN}-switch ${PN}-controller"
18RDEPENDS_${PN}-controller = "${PN} lsb ${PN}-pki"
19RDEPENDS_${PN}-switch = "${PN} openssl procps util-linux-uuidgen"
20RDEPENDS_${PN}-pki = "${PN}"
21RDEPENDS_${PN}-brcompat = "${PN} ${PN}-switch"
22
23# Some installers will fail because of an install order based on
24# rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be
25# queued for install later.
26RDEPENDS_${PN} += "sed gawk grep"
27
28SRC_URI = "\
29 file://openvswitch-switch \
30 file://openvswitch-switch-setup \
31 file://openvswitch-controller \
32 file://openvswitch-controller-setup \
33 file://openvswitch-add-target-python-handling.patch \
34 file://openvswitch-add-target-perl-handling.patch \
35 "
36
37EXTRA_OECONF += "\
38 TARGET_PYTHON=${bindir}/python \
39 TARGET_PERL=${bindir}/perl \
40 "
41
42# Don't compile kernel modules by default since it heavily depends on
43# kernel version. Use the in-kernel module for now.
44# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
45# EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}"
46
47ALLOW_EMPTY_${PN}-pki = "1"
48PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki"
49
50FILES_${PN}-controller = "\
51 ${sysconfdir}/init.d/openvswitch-controller \
52 ${sysconfdir}/default/openvswitch-controller \
53 ${sysconfdir}/openvswitch-controller \
54 ${bindir}/ovs-controller \
55 "
56
57FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd"
58
59FILES_${PN}-switch = "\
60 ${sysconfdir}/init.d/openvswitch-switch \
61 ${sysconfdir}/default/openvswitch-switch \
62 "
63
64# silence a warning
65FILES_${PN} += "${datadir}/ovsdbmonitor"
66FILES_${PN} += "/run"
67
68inherit autotools update-rc.d
69
70INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller"
71INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch"
72INITSCRIPT_PARAMS_${PN}-switch = "defaults 71"
73
74INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller"
75INITSCRIPT_PARAMS_${PN}-controller = "defaults 72"
76
77do_install_append() {
78 install -d ${D}/${sysconfdir}/default/
79 install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch
80 install -d ${D}/${sysconfdir}/openvswitch-controller
81 install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller
82
83 install -d ${D}/${sysconfdir}/init.d/
84 install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller
85 install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch
86 true || rm -fr ${D}/${datadir}/${PN}/pki
87
88 install -d ${D}/${sysconfdir}/init.d/
89
90 oe_runmake modules_install INSTALL_MOD_PATH=${D}
91}
92
93pkg_postinst_${PN}-pki () {
94 # can't do this offline
95 if [ "x$D" != "x" ]; then
96 exit 1
97 fi
98 if test ! -d $D/${datadir}/${PN}/pki; then
99 ovs-pki init --dir=$D/${datadir}/${PN}/pki
100 fi
101}
102
103pkg_postinst_${PN}-controller () {
104 # can't do this offline
105 if [ "x$D" != "x" ]; then
106 exit 1
107 fi
108
109 if test ! -d $D/${datadir}/${PN}/pki; then
110 ovs-pki init --dir=$D/${datadir}/${PN}/pki
111 fi
112
113 cd $D/${sysconfdir}/openvswitch-controller
114 if ! test -e cacert.pem; then
115 ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem
116 fi
117 if ! test -e privkey.pem || ! test -e cert.pem; then
118 oldumask=$(umask)
119 umask 077
120 ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null
121 mv tmp-privkey.pem privkey.pem
122 mv tmp-cert.pem cert.pem
123 mv tmp-req.pem req.pem
124 chmod go+r cert.pem req.pem
125 umask $oldumask
126 fi
127}
diff --git a/recipes-networking/openvswitch/openvswitch_1.10.0.bb b/recipes-networking/openvswitch/openvswitch_1.10.0.bb
index 42d4bc44..85b2709c 100644
--- a/recipes-networking/openvswitch/openvswitch_1.10.0.bb
+++ b/recipes-networking/openvswitch/openvswitch_1.10.0.bb
@@ -1,32 +1,11 @@
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"
6 2
7DEPENDS += "bridge-utils openssl python perl"
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" 3RRECOMMENDS_${PN} += "kernel-module-openvswitch"
16 4
17# Some installers will fail because of an install order based on
18# rdeps. E.g. ovs-pki calls sed in the postinstall. sed may be
19# queued for install later.
20RDEPENDS_${PN} += "sed gawk grep"
21PR = "r4" 5PR = "r4"
22 6
23SRC_URI = "http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \ 7SRC_URI += "\
24 file://openvswitch-switch \ 8 http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \
25 file://openvswitch-switch-setup \
26 file://openvswitch-controller \
27 file://openvswitch-controller-setup \
28 file://openvswitch-add-target-python-handling.patch \
29 file://openvswitch-add-target-perl-handling.patch \
30 file://configure-Only-link-against-libpcap-on-FreeBSD.patch \ 9 file://configure-Only-link-against-libpcap-on-FreeBSD.patch \
31 " 10 "
32 11
@@ -34,85 +13,4 @@ SRC_URI[md5sum] = "fe8b49efe9f86b57abab00166b971106"
34SRC_URI[sha256sum] = "803966c89d6a5de6d710a2cb4ed73ac8d8111a2c44b12b846dcef8e91ffab167" 13SRC_URI[sha256sum] = "803966c89d6a5de6d710a2cb4ed73ac8d8111a2c44b12b846dcef8e91ffab167"
35LIC_FILES_CHKSUM = "file://COPYING;md5=49eeb5acb1f5e510f12c44f176c42253" 14LIC_FILES_CHKSUM = "file://COPYING;md5=49eeb5acb1f5e510f12c44f176c42253"
36 15
37# Don't compile kernel modules by default since it heavily depends on 16inherit pkgconfig
38# kernel version. Use the in-kernel module for now.
39# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
40# EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}"
41
42EXTRA_OECONF += "TARGET_PYTHON=${bindir}/python \
43 TARGET_PERL=${bindir}/perl \
44 "
45
46ALLOW_EMPTY_${PN}-pki = "1"
47PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki"
48
49FILES_${PN}-controller = "${sysconfdir}/init.d/openvswitch-controller \
50 ${sysconfdir}/default/openvswitch-controller \
51 ${sysconfdir}/openvswitch-controller \
52 ${bindir}/ovs-controller"
53
54FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd"
55
56FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \
57 ${sysconfdir}/default/openvswitch-switch \
58 "
59# silence a warning
60FILES_${PN} += "${datadir}/ovsdbmonitor"
61FILES_${PN} += "/run"
62
63inherit autotools update-rc.d pkgconfig
64
65INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller"
66INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch"
67INITSCRIPT_PARAMS_${PN}-switch = "defaults 71"
68
69INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller"
70INITSCRIPT_PARAMS_${PN}-controller = "defaults 72"
71
72do_install_append() {
73 install -d ${D}/${sysconfdir}/default/
74 install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch
75 install -d ${D}/${sysconfdir}/openvswitch-controller
76 install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller
77
78 install -d ${D}/${sysconfdir}/init.d/
79 install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller
80 install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch
81 true || rm -fr ${D}/${datadir}/${PN}/pki
82}
83
84pkg_postinst_${PN}-pki () {
85 # can't do this offline
86 if [ "x$D" != "x" ]; then
87 exit 1
88 fi
89 if test ! -d $D/${datadir}/${PN}/pki; then
90 ovs-pki init --dir=$D/${datadir}/${PN}/pki
91 fi
92}
93
94pkg_postinst_${PN}-controller () {
95 # can't do this offline
96 if [ "x$D" != "x" ]; then
97 exit 1
98 fi
99
100 if test ! -d $D/${datadir}/${PN}/pki; then
101 ovs-pki init --dir=$D/${datadir}/${PN}/pki
102 fi
103
104 cd $D/${sysconfdir}/openvswitch-controller
105 if ! test -e cacert.pem; then
106 ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem
107 fi
108 if ! test -e privkey.pem || ! test -e cert.pem; then
109 oldumask=$(umask)
110 umask 077
111 ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null
112 mv tmp-privkey.pem privkey.pem
113 mv tmp-cert.pem cert.pem
114 mv tmp-req.pem req.pem
115 chmod go+r cert.pem req.pem
116 umask $oldumask
117 fi
118}
diff --git a/recipes-networking/openvswitch/openvswitch_2.1.3.bb b/recipes-networking/openvswitch/openvswitch_2.1.3.bb
index c3a29aa4..dc6c7e3d 100644
--- a/recipes-networking/openvswitch/openvswitch_2.1.3.bb
+++ b/recipes-networking/openvswitch/openvswitch_2.1.3.bb
@@ -1,35 +1,15 @@
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"
6 2
7DEPENDS += "bridge-utils openssl python perl"
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" 3RRECOMMENDS_${PN} += "kernel-module-openvswitch"
16 4
17RDEPENDS_${PN}-ptest += "python-logging python-syslog python-argparse python-io \ 5RDEPENDS_${PN}-ptest += "\
18 python-fcntl python-shell python-lang python-xml python-math \ 6 python-logging python-syslog python-argparse python-io \
19 python-datetime python-netclient python sed" 7 python-fcntl python-shell python-lang python-xml python-math \
20 8 python-datetime python-netclient python sed \
21# Some installers will fail because of an install order based on 9 "
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
26SRC_URI = "http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \ 11SRC_URI += "\
27 file://openvswitch-switch \ 12 http://openvswitch.org/releases/openvswitch-${PV}.tar.gz \
28 file://openvswitch-switch-setup \
29 file://openvswitch-controller \
30 file://openvswitch-controller-setup \
31 file://openvswitch-add-target-python-handling.patch \
32 file://openvswitch-add-target-perl-handling.patch \
33 file://openvswitch-add-more-target-python-substitutions.patch \ 13 file://openvswitch-add-more-target-python-substitutions.patch \
34 file://openvswitch-add-ptest.patch \ 14 file://openvswitch-add-ptest.patch \
35 file://run-ptest \ 15 file://run-ptest \
@@ -40,91 +20,10 @@ SRC_URI[sha256sum] = "43a2562fe5e8e48e997bfdb04691ffaaaefe73069b5699654538bf2f16
40 20
41LIC_FILES_CHKSUM = "file://COPYING;md5=e03b0d9c4115c44518594e5618e653f8" 21LIC_FILES_CHKSUM = "file://COPYING;md5=e03b0d9c4115c44518594e5618e653f8"
42 22
43# Don't compile kernel modules by default since it heavily depends on 23inherit ptest
44# kernel version. Use the in-kernel module for now.
45# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
46# EXTRA_OECONF = "--with-linux=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}"
47
48EXTRA_OECONF += "TARGET_PYTHON=${bindir}/python \
49 TARGET_PERL=${bindir}/perl \
50 "
51
52ALLOW_EMPTY_${PN}-pki = "1"
53PACKAGES =+ "${PN}-controller ${PN}-switch ${PN}-brcompat ${PN}-pki"
54
55FILES_${PN}-controller = "${sysconfdir}/init.d/openvswitch-controller \
56 ${sysconfdir}/default/openvswitch-controller \
57 ${sysconfdir}/openvswitch-controller \
58 ${bindir}/ovs-controller"
59
60FILES_${PN}-brcompat = "${sbindir}/ovs-brcompatd"
61
62FILES_${PN}-switch = "${sysconfdir}/init.d/openvswitch-switch \
63 ${sysconfdir}/default/openvswitch-switch \
64 "
65# silence a warning
66FILES_${PN} += "${datadir}/ovsdbmonitor"
67FILES_${PN} += "/run"
68
69inherit autotools update-rc.d ptest
70 24
71EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" 25EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}"
72 26
73do_install_ptest() { 27do_install_ptest() {
74 oe_runmake test-install 28 oe_runmake test-install
75} 29}
76
77INITSCRIPT_PACKAGES = "${PN}-switch ${PN}-controller"
78INITSCRIPT_NAME_${PN}-switch = "openvswitch-switch"
79INITSCRIPT_PARAMS_${PN}-switch = "defaults 71"
80
81INITSCRIPT_NAME_${PN}-controller = "openvswitch-controller"
82INITSCRIPT_PARAMS_${PN}-controller = "defaults 72"
83
84do_install_append() {
85 install -d ${D}/${sysconfdir}/default/
86 install -m 660 ${WORKDIR}/openvswitch-switch-setup ${D}/${sysconfdir}/default/openvswitch-switch
87 install -d ${D}/${sysconfdir}/openvswitch-controller
88 install -m 660 ${WORKDIR}/openvswitch-controller-setup ${D}/${sysconfdir}/default/openvswitch-controller
89
90 install -d ${D}/${sysconfdir}/init.d/
91 install -m 755 ${WORKDIR}/openvswitch-controller ${D}/${sysconfdir}/init.d/openvswitch-controller
92 install -m 755 ${WORKDIR}/openvswitch-switch ${D}/${sysconfdir}/init.d/openvswitch-switch
93 true || rm -fr ${D}/${datadir}/${PN}/pki
94}
95
96pkg_postinst_${PN}-pki () {
97 # can't do this offline
98 if [ "x$D" != "x" ]; then
99 exit 1
100 fi
101 if test ! -d $D/${datadir}/${PN}/pki; then
102 ovs-pki init --dir=$D/${datadir}/${PN}/pki
103 fi
104}
105
106pkg_postinst_${PN}-controller () {
107 # can't do this offline
108 if [ "x$D" != "x" ]; then
109 exit 1
110 fi
111
112 if test ! -d $D/${datadir}/${PN}/pki; then
113 ovs-pki init --dir=$D/${datadir}/${PN}/pki
114 fi
115
116 cd $D/${sysconfdir}/openvswitch-controller
117 if ! test -e cacert.pem; then
118 ln -s $D/${datadir}/${PN}/pki/switchca/cacert.pem cacert.pem
119 fi
120 if ! test -e privkey.pem || ! test -e cert.pem; then
121 oldumask=$(umask)
122 umask 077
123 ovs-pki req+sign --dir=$D/${datadir}/${PN}/pki tmp controller >/dev/null
124 mv tmp-privkey.pem privkey.pem
125 mv tmp-cert.pem cert.pem
126 mv tmp-req.pem req.pem
127 chmod go+r cert.pem req.pem
128 umask $oldumask
129 fi
130}
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}