You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
10 KiB

  1. #
  2. # Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
  3. # Copyright (C) 2014-2017 OpenWrt.org
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. # $Id: Makefile $
  9. include $(TOPDIR)/rules.mk
  10. include $(INCLUDE_DIR)/kernel.mk
  11. PKG_NAME:=openvswitch
  12. PKG_RELEASE:=1
  13. PKG_VERSION:=2.8.1
  14. PKG_LICENSE:=Apache-2.0
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_USE_MIPS16:=0
  17. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  18. PKG_SOURCE_URL:=http://openvswitch.org/releases/
  19. PKG_HASH:=8d1c439e26d7044f0ec823c7fef1b00b7c6465da0b83a7d0cf3191ed1dc43893
  20. PKG_BUILD_DEPENDS:=python/host python-six/host
  21. PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_openvswitch-python
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_FIXUP:=autoreconf
  24. PKG_INSTALL:=1
  25. include $(INCLUDE_DIR)/package.mk
  26. include ../../lang/python/python-package.mk
  27. define Package/openvswitch/Default
  28. SECTION:=net
  29. SUBMENU:=Open vSwitch
  30. CATEGORY:=Network
  31. URL:=http://openvswitch.org/
  32. MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  33. endef
  34. define Package/openvswitch/Default/description
  35. Open vSwitch is a production quality, multilayer, software-based, Ethernet
  36. virtual switch. It is designed to enable massive network automation through
  37. programmatic extension, while still supporting standard management interfaces
  38. and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP, 802.1ag). In
  39. addition, it is designed to support distribution across multiple physical
  40. servers similar to VMware's vNetwork distributed vswitch or Cisco's Nexus
  41. 1000V.
  42. endef
  43. define Package/openvswitch-base
  44. $(call Package/openvswitch/Default)
  45. TITLE:=Open vSwitch Userspace Package (base)
  46. DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch
  47. endef
  48. define Package/openvswitch-base/description
  49. Provides the main userspace components required for Open vSwitch to function.
  50. The main OVS tools (ovs-vsctl, ovs-ofctl, etc) are packaged separately
  51. to conserve some room and allow more configurability.
  52. endef
  53. define Package/openvswitch-ovn-base
  54. $(call Package/openvswitch/Default)
  55. TITLE:=Open Virtual Networking (base)
  56. DEPENDS:=+openvswitch-base
  57. endef
  58. define Package/openvswitch-ovn-base/description
  59. Provides the main userspace components required for Open Virtual Networking
  60. over Open vSwitch.
  61. endef
  62. OVN_BIN_TOOLS:=ovn-controller ovn-controller-vtep ovn-detrace \
  63. ovn-docker-overlay-driver ovn-docker-underlay-driver \
  64. ovn-nbctl ovn-sbctl ovn-trace
  65. define Package/openvswitch-ovn
  66. $(call Package/openvswitch/Default)
  67. TITLE:=Open Virtual Networking (base)
  68. DEPENDS:=+openvswitch-ovn-base $(foreach t,$(OVN_BIN_TOOLS),+openvswitch-$(t))
  69. endef
  70. define Package/openvswitch-ovn/description
  71. Provides all the components required for Open Virtual Networking
  72. (including the tools)
  73. endef
  74. define Package/openvswitch-vtep
  75. $(call Package/openvswitch/Default)
  76. TITLE:=Open vSwitch VXLAN Tunnel End Point
  77. DEPENDS:=+openvswitch-base
  78. endef
  79. define Package/openvswitch-vtep/description
  80. This schema specifies relations that a VTEP can use to integrate physi‐
  81. cal ports into logical switches maintained by a network virtualization
  82. controller such as NSX.
  83. endef
  84. define Package/openvswitch-python
  85. $(call Package/openvswitch/Default)
  86. TITLE:=Open vSwitch Python Support
  87. DEPENDS:=+openvswitch +PACKAGE_openvswitch-python:python +PACKAGE_openvswitch-python:python-six
  88. endef
  89. define Package/openvswitch-python/description
  90. Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
  91. endef
  92. OVS_BIN_TOOLS:= \
  93. ovsdb-client ovs-l3ping ovs-dpctl-top \
  94. ovs-tcpdump ovs-tcpundump ovs-pcap ovs-parse-backtrace
  95. define Package/openvswitch
  96. $(call Package/openvswitch/Default)
  97. TITLE:=Open vSwitch Userspace Package
  98. DEPENDS:=+openvswitch-base $(foreach t,$(OVS_BIN_TOOLS),+openvswitch-$(t))
  99. endef
  100. define Package/openvswitch/description
  101. Provides the main userspace components required for Open vSwitch to function.
  102. Includes also most of OVS utilities.
  103. endef
  104. define KernelPackage/openvswitch
  105. SECTION:=kernel
  106. CATEGORY:=Kernel modules
  107. SUBMENU:=Network Support
  108. TITLE:=Open vSwitch Kernel Package
  109. KCONFIG:= \
  110. CONFIG_BRIDGE \
  111. CONFIG_OPENVSWITCH \
  112. CONFIG_OPENVSWITCH_GRE=n \
  113. CONFIG_OPENVSWITCH_VXLAN=n \
  114. CONFIG_OPENVSWITCH_GENEVE=n
  115. DEPENDS:= \
  116. @IPV6 +kmod-gre +kmod-lib-crc32c +kmod-mpls \
  117. +kmod-vxlan +kmod-nf-nat +kmod-nf-nat6
  118. FILES:= $(LINUX_DIR)/net/openvswitch/openvswitch.ko
  119. AUTOLOAD:=$(call AutoLoad,21,openvswitch)
  120. endef
  121. define KernelPackage/openvswitch/description
  122. This package contains the Open vSwitch kernel moodule and bridge compat
  123. module. Furthermore, it supports OpenFlow.
  124. endef
  125. CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) --with-rundir=/var/run
  126. CONFIGURE_ARGS += --enable-ndebug
  127. CONFIGURE_ARGS += --disable-ssl
  128. CONFIGURE_ARGS += --enable-shared
  129. TARGET_CFLAGS += -flto -std=gnu99
  130. CONFIGURE_VARS += \
  131. ovs_cv_flake8=no \
  132. ovs_cv_python3=no \
  133. ovs_cv_sphinx=no \
  134. KARCH=$(LINUX_KARCH)
  135. MAKE_FLAGS += \
  136. ARCH="$(LINUX_KARCH)" \
  137. PYTHONPATH="$(HOST_PYTHONPATH)" \
  138. PYTHON="$(HOST_PYTHON_BIN)"
  139. define OvsBinUtility
  140. define Package/openvswitch-$(2)
  141. $(call Package/openvswitch/Default)
  142. TITLE:=$(3)
  143. DEPENDS:=+$(1) $(4)
  144. endef
  145. define Package/openvswitch-$(2)/description
  146. $(3)
  147. endef
  148. define Package/openvswitch-$(2)/install
  149. $(INSTALL_DIR) $$(1)/usr/bin/ ;\
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
  151. endef
  152. endef
  153. define Package/openvswitch-base/install
  154. $(INSTALL_DIR) $(1)/etc/openvswitch
  155. $(INSTALL_DIR) $(1)/etc/init.d
  156. $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
  157. $(INSTALL_DIR) $(1)/usr/lib/
  158. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libofproto*.so* $(1)/usr/lib/
  159. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenvswitch*.so* $(1)/usr/lib/
  160. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libovsdb*.so* $(1)/usr/lib/
  161. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsflow*.so* $(1)/usr/lib/
  162. $(INSTALL_DIR) $(1)/usr/bin/
  163. $(foreach bin,ovsdb-tool ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovs-pki, \
  164. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(bin) $(1)/usr/bin/ ; )
  165. $(INSTALL_DIR) $(1)/usr/sbin/
  166. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovs-vswitchd $(1)/usr/sbin/
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ovsdb-server $(1)/usr/sbin/
  168. $(INSTALL_DIR) $(1)/usr/share/openvswitch/scripts
  169. $(INSTALL_CONF) \
  170. $(PKG_INSTALL_DIR)/usr/share/openvswitch/vswitch.ovsschema \
  171. $(1)/usr/share/openvswitch/
  172. $(INSTALL_DATA) \
  173. $(PKG_INSTALL_DIR)/usr/share/openvswitch/scripts/ovs-lib \
  174. $(1)/usr/share/openvswitch/scripts
  175. $(INSTALL_BIN) \
  176. $(PKG_INSTALL_DIR)/usr/share/openvswitch/scripts/ovs-ctl \
  177. $(1)/usr/share/openvswitch/scripts
  178. endef
  179. define Package/openvswitch-ovn-base/install
  180. $(INSTALL_DIR) $(1)/usr/lib/ $(1)/usr/bin/ $(1)/usr/share/openvswitch/
  181. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libovn*.so* $(1)/usr/lib/
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovn-northd $(1)/usr/bin/
  183. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/ovn-nb.ovsschema $(1)/usr/share/openvswitch/
  184. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/ovn-sb.ovsschema $(1)/usr/share/openvswitch/
  185. endef
  186. define Package/openvswitch-vtep/install
  187. $(INSTALL_DIR) $(1)/usr/lib/ $(1)/usr/bin/ $(1)/usr/share/openvswitch/
  188. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtep-ctl $(1)/usr/bin/
  189. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libvtep*.so* $(1)/usr/lib/
  190. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/vtep.ovsschema $(1)/usr/share/openvswitch/
  191. endef
  192. define Package/openvswitch-python/install
  193. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/ovs
  194. $(CP) $(PKG_INSTALL_DIR)/usr/share/openvswitch/python/ovs/* $(1)/usr/lib/python$(PYTHON_VERSION)/ovs
  195. endef
  196. define Package/openvswitch-ovn/install
  197. :
  198. endef
  199. define Package/openvswitch/install
  200. :
  201. endef
  202. $(eval $(call OvsBinUtility,openvswitch-base,ovs-appctl,Open vSwitch app control utility))
  203. $(eval $(call OvsBinUtility,openvswitch-base,ovs-ofctl,Open vSwitch OpenFlow control utility))
  204. $(eval $(call OvsBinUtility,openvswitch-base,ovs-dpctl,Open vSwitch datapath management utility))
  205. $(eval $(call OvsBinUtility,openvswitch-base,ovs-vsctl,Open vSwitch ovs-vswitchd management utility))
  206. $(eval $(call OvsBinUtility,openvswitch-base,ovsdb-client,Open vSwitch database JSON-RPC client))
  207. $(eval $(call OvsBinUtility,openvswitch-base,ovs-l3ping,Check network deployment for L3 tunneling problems))
  208. $(eval $(call OvsBinUtility,openvswitch-base,ovs-docker,Open vSwitch docker tool))
  209. $(eval $(call OvsBinUtility,openvswitch-base,ovs-dpctl-top,Top like behavior for ovs-dpctl dump-flows))
  210. $(eval $(call OvsBinUtility,openvswitch-base,ovs-pki,OpenFlow public key infrastructure management utility))
  211. $(eval $(call OvsBinUtility,openvswitch-base,ovs-tcpdump,Dump traffic from an Open vSwitch port using tcpdump))
  212. $(eval $(call OvsBinUtility,openvswitch-base,ovs-tcpundump,Convert ``tcpdump -xx`` output to hex strings))
  213. $(eval $(call OvsBinUtility,openvswitch-base,ovs-pcap,Print packets from a pcap file as hex))
  214. $(eval $(call OvsBinUtility,openvswitch-base,ovs-parse-backtrace,parses ovs-appctl backtrace output))
  215. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-controller,Open Virtual Network local controller))
  216. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-controller-vtep,Open Virtual Network local controller for vtep enabled physical switches,+openvswitch-vtep))
  217. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-detrace,Convert ``ovs-appctl ofproto/trace`` output to combine OVN logical flow information))
  218. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-docker-overlay-driver,OVN Docker overlay driver utility))
  219. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-docker-underlay-driver,OVN Docker underlay driver utility))
  220. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-nbctl,Open Virtual Network northbound db management utility))
  221. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-sbctl,Utility for querying and configuring OVN_Southbound database))
  222. $(eval $(call OvsBinUtility,openvswitch-ovn-base,ovn-trace,Open Virtual Network logical network tracing utility))
  223. $(foreach t,$(OVS_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
  224. $(foreach t,$(OVN_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
  225. $(eval $(call BuildPackage,openvswitch-base))
  226. $(eval $(call BuildPackage,openvswitch-ovn-base))
  227. $(eval $(call BuildPackage,openvswitch-ovn))
  228. $(eval $(call BuildPackage,openvswitch-vtep))
  229. $(eval $(call BuildPackage,openvswitch-python))
  230. $(eval $(call BuildPackage,openvswitch))
  231. $(eval $(call KernelPackage,openvswitch))