2 # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
3 # Copyright (C) 2014 OpenWrt.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
10 include $(TOPDIR
)/rules.mk
11 include $(INCLUDE_DIR
)/kernel.mk
17 PKG_RELEASE
=$(PKG_SOURCE_VERSION
)
18 PKG_LICENSE
:=Apache-2.0
19 PKG_LICENSE_FILES
:=COPYING
23 PKG_SOURCE_URL
:=https
://github.com
/openvswitch
/ovs
24 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
25 PKG_SOURCE_VERSION
:=22d4614ddf83988a3771fb379ea029e663b4455a
26 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.gz
32 # Upstream package supports kernels between 2.6.32 and 4.3
33 # see https://github.com/openvswitch/ovs/blob/master/FAQ.md
34 # This list is pruned to only those kernels used in OpenWRT
35 # Support for kernel 4.4 is backported
36 SUPPORTED_KERNELS
:=LINUX_3_18||LINUX_4_1||LINUX_4_3||LINUX_4_4
38 # If only kmod-openvswitch is enabled, then override default make path to only
39 # build and install the datapath/linux subdirectory which cuts down compilation
41 ifeq ($(CONFIG_PACKAGE_openvswitch-base
),)
42 ifneq ($(CONFIG_PACKAGE_kmod-openvswitch
),)
43 MAKE_PATH
:= datapath
/linux
47 # Additionally register PKG_CONFIG_DEPENDS to trigger a rebuild of the code
48 # base if the package selection changes.
49 PKG_CONFIG_DEPENDS
:= \
50 CONFIG_PACKAGE_openvswitch-base \
51 CONFIG_PACKAGE_kmod-openvswitch
53 include $(INCLUDE_DIR
)/package.mk
54 $(call include_mk
, python-package.mk
)
56 define Package
/openvswitch
/Default
60 URL
:=http
://openvswitch.org
/
61 MAINTAINER
:=Alexandru Ardelean
<ardeleanalex@gmail.com
>
64 define Package
/openvswitch
/Default
/description
65 Open vSwitch is a production quality
, multilayer
, software-based
, Ethernet
66 virtual switch. It is designed to enable massive network automation through
67 programmatic extension
, while still supporting standard management interfaces
68 and protocols
(e.g. NetFlow
, sFlow
, SPAN
, RSPAN
, CLI
, LACP
, 802.1ag
). In
69 addition
, it is designed to support distribution across multiple physical
70 servers similar to VMware
's vNetwork distributed vswitch or Cisco's Nexus
74 define Package
/openvswitch-base
75 $(call Package
/openvswitch
/Default
)
76 TITLE
:=Open vSwitch Userspace Package
(base
)
77 DEPENDS
:=+libpcap
+libopenssl
+librt
+kmod-openvswitch @
($(SUPPORTED_KERNELS
))
80 define Package
/openvswitch-base
/description
81 Provides the main userspace components required for Open vSwitch to function.
82 The main OVS tools
(ovs-vsctl
, ovs-ofctl
, etc
) are packaged separately
83 to conserve some room and allow more configurability.
86 define Package
/openvswitch-python
87 $(call Package
/openvswitch
/Default
)
88 TITLE
:=Open vSwitch Python Support
89 DEPENDS
:=+openvswitch
+PACKAGE_openvswitch-python
:python
92 define Package
/openvswitch-python
/description
93 Provides bindings and libraries for using Python to manipulate
/work with Open vSwitch.
96 define Package
/openvswitch-ipsec
97 $(call Package
/openvswitch
/Default
)
98 TITLE
:=Open vSwitch GRE through IPsec tool
99 DEPENDS
:=+openvswitch-python
102 define Package
/openvswitch-ipsec
/description
103 The ovs-monitor-ipsec script provides support for encrypting GRE tunnels with
107 define Package
/openvswitch-benchmark
108 $(call Package
/openvswitch
/Default
)
109 TITLE
:=Open vSwitch flow setup benchmark utility
110 DEPENDS
:=+openvswitch
113 define Package
/openvswitch-benchmark
/description
114 Utility for running OpenVSwitch benchmarking
117 OVS_BIN_TOOLS
:=ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovsdb-client
118 define Package
/openvswitch
119 $(call Package
/openvswitch
/Default
)
120 TITLE
:=Open vSwitch Userspace Package
121 DEPENDS
:=+openvswitch-base
$(foreach t
,$(OVS_BIN_TOOLS
),+openvswitch-
$(t
))
124 define Package
/openvswitch
/description
125 Provides the main userspace components required for Open vSwitch to function.
126 Includes also the main OVS utilities
(ovs-appctl
, ovs-vsctl
, etc
).
129 define KernelPackage
/openvswitch
131 CATEGORY
:=Kernel modules
132 SUBMENU
:=Network Support
133 TITLE
:=Open vSwitch Kernel Package
134 KCONFIG
:=CONFIG_BRIDGE
135 DEPENDS
:=+kmod-stp @IPV6
+kmod-gre
+kmod-lib-crc32c
+kmod-vxlan
+kmod-nf-conntrack
+kmod-nf-conntrack6 @
($(SUPPORTED_KERNELS
))
137 $(PKG_BUILD_DIR
)/datapath
/linux
/openvswitch.
$(LINUX_KMOD_SUFFIX
)
138 AUTOLOAD
:=$(call AutoLoad
,21,openvswitch
)
141 define KernelPackage
/openvswitch
/description
142 This package contains the Open vSwitch kernel moodule and bridge compat
143 module. Furthermore
, it supports OpenFlow.
146 CONFIGURE_ARGS
+= --with-linux
=$(LINUX_DIR
) --with-rundir
=/var
/run
147 CONFIGURE_ARGS
+= --enable-ndebug
148 CONFIGURE_ARGS
+= --disable-ssl
149 CONFIGURE_ARGS
+= --enable-shared
151 TARGET_CFLAGS
+= -flto
-std
=gnu99
153 CONFIGURE_VARS
+= KARCH
=$(LINUX_KARCH
)
154 MAKE_FLAGS
+= ARCH
="$(LINUX_KARCH)"
157 define Package
/openvswitch-
$(1)
158 $(call Package
/openvswitch
/Default
)
160 DEPENDS
:=+openvswitch-base
163 define Package
/openvswitch-
$(1)/description
167 define Package
/openvswitch-
$(1)/install
168 $(INSTALL_DIR
) $$(1)/usr
/bin
/ ;\
169 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/$(1) $$(1)/usr
/bin
/
173 define Package
/openvswitch-base
/install
174 $(INSTALL_DIR
) $(1)/etc
/openvswitch
176 $(INSTALL_DIR
) $(1)/etc
/init.d
177 $(INSTALL_BIN
) .
/files
/etc
/init.d
/openvswitch.init
$(1)/etc
/init.d
/openvswitch
179 $(INSTALL_DIR
) $(1)/usr
/lib
/
180 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libofproto.so
* $(1)/usr
/lib
/
181 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libopenvswitch.so
* $(1)/usr
/lib
/
182 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libovsdb.so
* $(1)/usr
/lib
/
183 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libsflow.so
* $(1)/usr
/lib
/
185 $(INSTALL_DIR
) $(1)/usr
/bin
/
186 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovsdb-tool
$(1)/usr
/bin
/
188 $(INSTALL_DIR
) $(1)/usr
/sbin
/
189 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ovs-vswitchd
$(1)/usr
/sbin
/
190 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ovsdb-server
$(1)/usr
/sbin
/
192 $(INSTALL_DIR
) $(1)/usr
/share
/openvswitch
/
193 $(INSTALL_CONF
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/vswitch.ovsschema
$(1)/usr
/share
/openvswitch
/
196 define Package
/openvswitch-python
/install
197 $(INSTALL_DIR
) $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/ovs
198 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/openvswitch
/python
/ovs
/* $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/ovs
201 define Package
/openvswitch-ipsec
/install
202 $(INSTALL_DIR
) $(1)/usr
/sbin
/
203 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/debian
/ovs-monitor-ipsec
$(1)/usr
/sbin
/
206 define Package
/openvswitch-benchmark
/install
207 $(INSTALL_DIR
) $(1)/usr
/bin
/
208 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/ovs-benchmark
$(1)/usr
/bin
/
211 define Package
/openvswitch
/install
215 $(eval
$(call OvsBinUtility
,ovs-appctl
,Open vSwitch app control utility
))
216 $(eval
$(call OvsBinUtility
,ovs-ofctl
,Open vSwitch OpenFlow control utility
))
217 $(eval
$(call OvsBinUtility
,ovs-dpctl
,Open vSwitch datapath management utility
))
218 $(eval
$(call OvsBinUtility
,ovs-vsctl
,Open vSwitch ovs-vswitchd management utility
))
219 $(eval
$(call OvsBinUtility
,ovsdb-client
,Open vSwitch database JSON-RPC client
))
221 $(foreach t
,$(OVS_BIN_TOOLS
),$(eval
$(call BuildPackage
,openvswitch-
$(t
))))
223 $(eval
$(call BuildPackage
,openvswitch-base
))
224 $(eval
$(call BuildPackage
,openvswitch-python
))
225 $(eval
$(call BuildPackage
,openvswitch-ipsec
))
226 $(eval
$(call BuildPackage
,openvswitch-benchmark
))
227 $(eval
$(call BuildPackage
,openvswitch
))
228 $(eval
$(call KernelPackage
,openvswitch
))