1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
#
# Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile $
include $(TOPDIR)/rules.mk
PKG_NAME:=openvswitch
PKG_RELEASE:=1
PKG_VERSION:=2.4.0
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=COPYING
PKG_USE_MIPS16:=0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/openvswitch/ovs
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=1b05a9d3298f92525d1c2d91bec11abf0766fdf1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
SUPPORTED_KERNELS:=LINUX_3_8||LINUX_3_10||LINUX_3_13||LINUX_3_14||LINUX_3_18||LINUX_4_0||LINUX_4_1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
$(call include_mk, python-package.mk)
define Package/openvswitch/Default
SECTION:=net
CATEGORY:=Network
URL:=http://openvswitch.org/
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
endef
define Package/openvswitch/Default/description
Open vSwitch is a production quality, multilayer, software-based, Ethernet
virtual switch. 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). In
addition, it is designed to support distribution across multiple physical
servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus
1000V.
endef
define Package/openvswitch
$(call Package/openvswitch/Default)
TITLE:=Open vSwitch Userspace Package
DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
endef
define Package/openvswitch/description
Provides the main userspace components required for Open vSwitch to function.
endef
define Package/openvswitch-python
$(call Package/openvswitch/Default)
TITLE:=Open vSwitch Python Support
DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python
endef
define Package/openvswitch-python/description
Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
endef
define Package/openvswitch-ipsec
$(call Package/openvswitch/Default)
TITLE:=Open vSwitch Userspace Package
DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python
endef
define Package/openvswitch-ipsec/description
The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
IPsec.
endef
define Package/openvswitch-benchmark
$(call Package/openvswitch/Default)
TITLE:=Open vSwitch Userspace Package
DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch
endef
define Package/openvswitch-benchmark/description
Utility for running OpenVSwitch benchmarking
endef
define KernelPackage/openvswitch
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Support
TITLE:=Open vSwitch Kernel Package
KCONFIG:=CONFIG_BRIDGE
DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan @($(SUPPORTED_KERNELS))
FILES:= \
$(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,21,openvswitch)
endef
define KernelPackage/openvswitch/description
This package contains the Open vSwitch kernel moodule and bridge compat
module. Furthermore, it supports OpenFlow.
endef
CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) --with-rundir=/var/run
CONFIGURE_ARGS += --enable-ndebug
CONFIGURE_ARGS += --disable-ssl
CONFIGURE_ARGS += --enable-shared
TARGET_CFLAGS += -flto -std=gnu99
define Package/openvswitch/install
$(INSTALL_DIR) $(1)/etc/openvswitch
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/lib/.libs/libsflow.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/lib/.libs/libopenvswitch.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/ofproto/.libs/libofproto.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/ovsdb/.libs/libovsdb.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-appctl $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-ofctl $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-client $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-dpctl $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-vsctl $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-tool $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/vswitchd/.libs/ovs-vswitchd $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsdb/.libs/ovsdb-server $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/usr/share/openvswitch/
$(INSTALL_CONF) $(PKG_BUILD_DIR)/vswitchd/vswitch.ovsschema $(1)/usr/share/openvswitch/
endef
define Package/openvswitch-python/install
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
$(CP) $(PKG_BUILD_DIR)/python/ovs/ $(1)/usr/lib/python$(PYTHON_VERSION)/
endef
define Package/openvswitch-ipsec/install
$(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/debian/ovs-monitor-ipsec $(1)/usr/sbin/
endef
define Package/openvswitch-benchmark/install
$(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-benchmark $(1)/usr/bin/
endef
define Package/openvswitch/postinst
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/openvswitch enable || true
endef
$(eval $(call BuildPackage,openvswitch))
$(eval $(call BuildPackage,openvswitch-python))
$(eval $(call BuildPackage,openvswitch-ipsec))
$(eval $(call BuildPackage,openvswitch-benchmark))
$(eval $(call KernelPackage,openvswitch))
|