@ -1,29 +1,26 @@
#
# Copyright (C) 2013 Julius Schulz-Zander <julius@net.t-labs.tu-berlin.de>
# Copyright (C) 2014-2017 OpenWrt.org
# Copyright (C) 2018 Yousong Zhou <yszhou4tech@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile $
i n c l u d e $( TOPDIR ) / r u l e s . m k
i n c l u d e $( INCLUDE_DIR ) / k e r n e l . m k
PKG_NAME := openvswitch
PKG_VERSION := 2.8.2
PKG_RELEASE := 1
PKG_LICENSE := Apache-2.0
PKG_LICENSE_FILES := COPYING
PKG_USE_MIPS16 := 0
PKG_RELEASE := 2
PKG_SOURCE := $( PKG_NAME) -$( PKG_VERSION) .tar.gz
PKG_SOURCE_URL := https://www.openvswitch.org/releases/
PKG_HASH := 87b4a7e7134a44ce1f808d3415a2244b4518c2b0b2a42fa2f8231e592f13103d
PKG_BUILD_DEPENDS := python/host python-six/host
PKG_LICENSE := Apache-2.0
PKG_LICENSE_FILES := LICENSE
PKG_BUILD_DEPENDS := python/host python-six/host
PKG_USE_MIPS16 := 0
PKG_BUILD_PARALLEL := 1
PKG_FIXUP := autoreconf
PKG_INSTALL := 1
@ -34,94 +31,22 @@ include $(INCLUDE_DIR)/package.mk
i n c l u d e . . / . . / l a n g / p y t h o n / p y t h o n - h o s t . m k
i n c l u d e . . / . . / l a n g / p y t h o n / p y t h o n - p a c k a g e . m k
d e f i n e P a c k a g e / o p e n v s w i t c h / D e f a u l t
SECTION:= net
SUBMENU:= Open vSwitch
CATEGORY:= Network
URL:= http://openvswitch.org/
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h / D e f a u l t / d e s c r i p t i o n
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.
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - b a s e
$( call Package/openvswitch/Default)
TITLE:= Open vSwitch Userspace Package ( base)
DEPENDS:= +libpcap +libopenssl +librt +kmod-openvswitch
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - b a s e / d e s c r i p t i o n
Provides the main userspace components required for Open vSwitch to function .
The main OVS tools ( ovs-vsctl, ovs-ofctl, etc) are packaged separately
to conserve some room and allow more configurability.
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - o v n - b a s e
$( call Package/openvswitch/Default)
TITLE:= Open Virtual Networking ( base)
DEPENDS:= +openvswitch-base
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - o v n - b a s e / d e s c r i p t i o n
Provides the main userspace components required for Open Virtual Networking
over Open vSwitch.
e n d e f
CONFIGURE_ARGS += \
--enable-ndebug \
--enable-shared \
--disable-libcapng \
OVN_BIN_TOOLS := ovn-controller ovn-controller-vtep ovn-detrace \
ovn-nbctl ovn-sbctl ovn-trace
d e f i n e P a c k a g e / o p e n v s w i t c h - o v n
$( call Package/openvswitch/Default)
TITLE:= Open Virtual Networking ( base)
DEPENDS:= +openvswitch-ovn-base $( foreach t,$( OVN_BIN_TOOLS) ,+openvswitch-$( t) )
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - o v n / d e s c r i p t i o n
Provides all the components required for Open Virtual Networking
( including the tools)
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - v t e p
$( call Package/openvswitch/Default)
TITLE:= Open vSwitch VXLAN Tunnel End Point
DEPENDS:= +openvswitch-base
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - v t e p / d e s c r i p t i o n
This schema specifies relations that a VTEP can use to integrate physi‐
cal ports into logical switches maintained by a network virtualization
controller such as NSX.
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - p y t h o n
$( call Package/openvswitch/Default)
TITLE:= Open vSwitch Python Support
DEPENDS:= +PACKAGE_openvswitch-python:python +PACKAGE_openvswitch-python:python-six
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - p y t h o n / d e s c r i p t i o n
Provides bindings and libraries for using Python to manipulate/work with Open vSwitch.
e n d e f
CONFIGURE_VARS += \
ovs_cv_flake8 = no \
ovs_cv_python3 = no \
ovs_cv_sphinx = no \
ovs_cv_python = $( PYTHON) \
ovs_cv_python_host = $( HOST_PYTHON_BIN) \
OVS_BIN_TOOLS := \
ovsdb-client ovs-l3ping ovs-dpctl-top \
ovs-tcpdump ovs-tcpundump ovs-pcap
d e f i n e P a c k a g e / o p e n v s w i t c h
$( call Package/openvswitch/Default)
TITLE:= Open vSwitch Userspace Package
DEPENDS:= +openvswitch-base $( foreach t,$( OVS_BIN_TOOLS) ,+openvswitch-$( t) )
e n d e f
TARGET_CFLAGS += -flto -std= gnu99
MAKE_VARS += PYTHONPATH = " $( HOST_PYTHONPATH) "
d e f i n e P a c k a g e / o p e n v s w i t c h / d e s c r i p t i o n
Provides the main userspace components required for Open vSwitch to function .
Includes also most of OVS utilities.
e n d e f
d e f i n e K e r n e l P a c k a g e / o p e n v s w i t c h
SECTION:= kernel
@ -169,129 +94,157 @@ define KernelPackage/openvswitch-geneve
AUTOLOAD:= $( call AutoProbe,vport-geneve)
e n d e f
CONFIGURE_ARGS += --enable-ndebug
CONFIGURE_ARGS += --enable-shared
TARGET_CFLAGS += -flto -std= gnu99
CONFIGURE_VARS += \
ovs_cv_flake8 = no \
ovs_cv_python3 = no \
ovs_cv_sphinx = no \
ovs_cv_python = $( PYTHON) \
ovs_cv_python_host = $( HOST_PYTHON_BIN) \
KARCH = $( LINUX_KARCH)
MAKE_VARS += PYTHONPATH = " $( HOST_PYTHONPATH) "
MAKE_FLAGS += ARCH = " $( LINUX_KARCH) "
d e f i n e O v s B i n U t i l i t y
define Package/openvswitch-$( 2)
$( call Package/openvswitch/Default)
TITLE:= $( 3)
DEPENDS:= +$( 1) $( 4)
ovs_packages :=
ovs_package_name = $( if $( filter openvswitch,$( 1) ) ,openvswitch,openvswitch-$( 1) )
d e f i n e O v s P a c k a g e T e m p l a t e
define Package/$( call ovs_package_name,$( 1) )
SECTION:= net
SUBMENU:= Open vSwitch
CATEGORY:= Network
URL:= https://www.openvswitch.org
TITLE:= $( ovs_$( 1) _title)
HIDDEN:= $( ovs_$( 1) _hidden)
DEPENDS:= $( ovs_$( 1) _depends)
endef
define Package/openvswitch-$( 2) /description
$( 3)
define Package/$( call ovs_package_name,$( 1) ) /install
$( foreach f,$( ovs_$( 1) _files) ,
$( INSTALL_DIR) $$ ( 1) /$( dir $( f) )
$( CP) $( PKG_INSTALL_DIR) /$( f) $$ ( 1) /$( dir $( f) )
)
$( ovs_$( 1) _install)
endef
define Package/openvswitch-$( 2) /install
$( INSTALL_DIR) $$ ( 1) /usr/bin/ ; \
$( INSTALL_BIN) $( PKG_INSTALL_DIR) /usr/bin/$( 2) $$ ( 1) /usr/bin/
endef
ovs_packages += $( call ovs_package_name,$( 1) )
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - b a s e / i n s t a l l
$( 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_INSTALL_DIR) /usr/lib/libofproto*.so* $( 1) /usr/lib/
$( CP) $( PKG_INSTALL_DIR) /usr/lib/libopenvswitch*.so* $( 1) /usr/lib/
$( CP) $( PKG_INSTALL_DIR) /usr/lib/libovsdb*.so* $( 1) /usr/lib/
$( CP) $( PKG_INSTALL_DIR) /usr/lib/libsflow*.so* $( 1) /usr/lib/
$( INSTALL_DIR) $( 1) /usr/bin/
$( foreach bin,ovsdb-tool ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovs-pki, \
$( INSTALL_BIN) $( PKG_INSTALL_DIR) /usr/bin/$( bin) $( 1) /usr/bin/ ; )
$( INSTALL_DIR) $( 1) /usr/sbin/
$( INSTALL_BIN) $( PKG_INSTALL_DIR) /usr/sbin/ovs-vswitchd $( 1) /usr/sbin/
$( INSTALL_BIN) $( PKG_INSTALL_DIR) /usr/sbin/ovsdb-server $( 1) /usr/sbin/
$( INSTALL_DIR) $( 1) /usr/share/openvswitch/scripts
$( INSTALL_CONF) \
$( PKG_INSTALL_DIR) /usr/share/openvswitch/vswitch.ovsschema \
$( 1) /usr/share/openvswitch/
$( INSTALL_DATA) \
$( PKG_INSTALL_DIR) /usr/share/openvswitch/scripts/ovs-lib \
$( 1) /usr/share/openvswitch/scripts
$( INSTALL_BIN) \
$( PKG_INSTALL_DIR) /usr/share/openvswitch/scripts/ovs-ctl \
$( 1) /usr/share/openvswitch/scripts
e n d e f
# Dependency review
#
# for f in sbin/*; do echo $f; readelf -d $f | grep -i shared; done
# for f in bin/*; do echo $f; readelf -d $f | grep -i shared; done
# for f in lib/*.so; do echo $f; readelf -d $f | grep -i shared; done
#
ovs_libopenvswitch_title := Open vSwitch ( libopenvswitch.so)
ovs_libopenvswitch_hidden := 1
ovs_libopenvswitch_depends := +libopenssl +librt
ovs_libopenvswitch_files := usr/lib/libopenvswitch*.so*
$( eval $ ( call OvsPackageTemplate ,libopenvswitch ) )
d e f i n e P a c k a g e / o p e n v s w i t c h - o v n - b a s e / i n s t a l l
$( INSTALL_DIR) $( 1) /usr/lib/ $( 1) /usr/bin/ $( 1) /usr/share/openvswitch/
$( CP) $( PKG_INSTALL_DIR) /usr/lib/libovn*.so* $( 1) /usr/lib/
$( INSTALL_BIN) $( PKG_INSTALL_DIR) /usr/bin/ovn-northd $( 1) /usr/bin/
ovs_libofproto_title := Open vSwitch ( libofproto.so libsflow.so)
ovs_libofproto_hidden := 1
ovs_libofproto_depends := +librt
ovs_libofproto_files := usr/lib/libofproto*.so* usr/lib/libsflow*.so*
$( eval $ ( call OvsPackageTemplate ,libofproto ) )
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /usr/share/openvswitch/ovn-nb.ovsschema $( 1) /usr/share/openvswitch/
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /usr/share/openvswitch/ovn-sb.ovsschema $( 1) /usr/share/openvswitch/
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - v t e p / i n s t a l l
$( INSTALL_DIR) $( 1) /usr/lib/ $( 1) /usr/bin/ $( 1) /usr/share/openvswitch/
$( INSTALL_BIN) $( PKG_INSTALL_DIR) /usr/bin/vtep-ctl $( 1) /usr/bin/
$( CP) $( PKG_INSTALL_DIR) /usr/lib/libvtep*.so* $( 1) /usr/lib/
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /usr/share/openvswitch/vtep.ovsschema $( 1) /usr/share/openvswitch/
e n d e f
ovs_libovsdb_title := Open vSwitch ( libovsdb.so)
ovs_libovsdb_hidden := 1
ovs_libovsdb_depends := +librt
ovs_libovsdb_files := usr/lib/libovsdb*.so*
$( eval $ ( call OvsPackageTemplate ,libovsdb ) )
d e f i n e P a c k a g e / o p e n v s w i t c h - p y t h o n / i n s t a l l
$( INSTALL_DIR) $( 1) /usr/lib/python$( PYTHON_VERSION) /ovs
$( CP) $( PKG_INSTALL_DIR) /usr/share/openvswitch/python/ovs/* $( 1) /usr/lib/python$( PYTHON_VERSION) /ovs
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - o v n / i n s t a l l
:
e n d e f
ovs_libovn_title := Open vSwitch ( libovn.so)
ovs_libovn_hidden := 1
ovs_libovn_depends := +librt
ovs_libovn_files := usr/lib/libovn*.so*
$( eval $ ( call OvsPackageTemplate ,libovn ) )
d e f i n e P a c k a g e / o p e n v s w i t c h / i n s t a l l
:
ovs_vswitchd_title := Open vSwitch ( ovs-vswitchd)
ovs_vswitchd_hidden := 1
ovs_vswitchd_depends := +librt +openvswitch-libopenvswitch +openvswitch-libofproto
ovs_vswitchd_files := usr/sbin/ovs-vswitchd
$( eval $ ( call OvsPackageTemplate ,vswitchd ) )
ovs_ovsdb_title := Open vSwitch ( ovsdb-server)
ovs_ovsdb_hidden := 1
ovs_ovsdb_depends := +librt +openvswitch-libopenvswitch +openvswitch-libovsdb
ovs_ovsdb_files := usr/sbin/ovsdb-server
$( eval $ ( call OvsPackageTemplate ,ovsdb ) )
ovs_common_title := Open vSwitch ( common files)
ovs_common_hidden := 1
ovs_common_depends := +librt +openvswitch-libopenvswitch +openvswitch-libofproto +openvswitch-libovsdb
ovs_common_files := \
usr/share/openvswitch/scripts/ovs-lib \
usr/share/openvswitch/scripts/ovs-ctl \
usr/share/openvswitch/scripts/ovs-save \
$( foreach b,ovs-appctl ovs-dpctl ovs-ofctl ovs-vsctl ovsdb-client ovsdb-tool,usr/bin/$( b) )
d e f i n e o v s _ c o m m o n _ i n s t a l l
$$ ( INSTALL_DIR) $$ ( 1) /etc/openvswitch
$$ ( INSTALL_DIR) $$ ( 1) /etc/init.d
$$ ( INSTALL_BIN) ./files/openvswitch.init $$ ( 1) /etc/init.d/openvswitch
$$ ( INSTALL_DIR) $$ ( 1) /etc/config
$$ ( INSTALL_DATA) ./files/openvswitch.config $$ ( 1) /etc/config/openvswitch
$$ ( INSTALL_DIR) $$ ( 1) /usr/share/openvswitch/scripts
$$ ( INSTALL_BIN) ./files/ovs-ctl-wrapper $$ ( 1) /usr/share/openvswitch/scripts/
$$ ( LN) /usr/share/openvswitch/scripts/ovs-ctl-wrapper $$ ( 1) /usr/bin/ovs-ctl
e n d e f
d e f i n e P a c k a g e / o p e n v s w i t c h - c o m m o n / c o n f f i l e s
/ e t c / o p e n v s w i t c h
e n d e f
$( eval $ ( call OvsPackageTemplate ,common ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -appctl ,Open vSwitch app control utility ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -ofctl ,Open vSwitch OpenFlow control utility ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -dpctl ,Open vSwitch datapath management utility ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -vsctl ,Open vSwitch ovs -vswitchd management utility ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovsdb -client ,Open vSwitch database JSON -RPC client ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -l 3ping ,Check network deployment for L 3 tunneling problems ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -dpctl -top ,Top like behavior for ovs -dpctl dump -flows ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -pki ,OpenFlow public key infrastructure management utility ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -tcpdump ,Dump traffic from an Open vSwitch port using tcpdump ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -tcpundump ,Convert ``tcpdump -xx `` output to hex strings ) )
$( eval $ ( call OvsBinUtility ,openvswitch -base ,ovs -pcap ,Print packets from a pcap file as hex ) )
$( eval $ ( call OvsBinUtility ,openvswitch -ovn -base ,ovn -controller ,Open Virtual Network local controller ) )
$( eval $ ( call OvsBinUtility ,openvswitch -ovn -base ,ovn -controller -vtep ,Open Virtual Network local controller for vtep enabled physical switches ,+openvswitch -vtep ) )
$( eval $ ( call OvsBinUtility ,openvswitch -ovn -base ,ovn -detrace ,Convert ``ovs -appctl ofproto /trace `` output to combine OVN logical flow information ) )
$( eval $ ( call OvsBinUtility ,openvswitch -ovn -base ,ovn -nbctl ,Open Virtual Network northbound db management utility ) )
$( eval $ ( call OvsBinUtility ,openvswitch -ovn -base ,ovn -sbctl ,Utility for querying and configuring OVN_Southbound data ‐base ) )
$( eval $ ( call OvsBinUtility ,openvswitch -ovn -base ,ovn -trace ,Open Virtual Network logical network tracing utility ) )
$( foreach t ,$ ( OVS_BIN_TOOLS ) ,$ ( eval $ ( call BuildPackage ,openvswitch -$ ( t ) ) ) )
$( foreach t ,$ ( OVN_BIN_TOOLS ) ,$ ( eval $ ( call BuildPackage ,openvswitch -$ ( t ) ) ) )
$( eval $ ( call BuildPackage ,openvswitch -base ) )
$( eval $ ( call BuildPackage ,openvswitch -ovn -base ) )
$( eval $ ( call BuildPackage ,openvswitch -ovn ) )
$( eval $ ( call BuildPackage ,openvswitch -vtep ) )
$( eval $ ( call BuildPackage ,openvswitch -python ) )
$( eval $ ( call BuildPackage ,openvswitch ) )
# coreutils-sleep is required by ovs-lib for sleeping a fraction of second
#
# uuidgen is required for generating system-id
ovs_openvswitch_title := Open vSwitch
ovs_openvswitch_hidden :=
ovs_openvswitch_depends := +librt +coreutils +coreutils-sleep +uuidgen \
+openvswitch-common +openvswitch-vswitchd +openvswitch-ovsdb +kmod-openvswitch
ovs_openvswitch_files := usr/share/openvswitch/vswitch.ovsschema
$( eval $ ( call OvsPackageTemplate ,openvswitch ) )
ovs_ovn-common_title := Open Virtual Network ( common files)
ovs_ovn-common_hidden := 1
ovs_ovn-common_depends := +librt +openvswitch-common +openvswitch-libopenvswitch +openvswitch-libovn +openvswitch-libovsdb
ovs_ovn-common_files := \
usr/share/openvswitch/scripts/ovn-ctl \
$( foreach b,ovn-nbctl ovn-sbctl ovn-trace ovn-detrace,usr/bin/$( b) )
d e f i n e o v s _ o v n - c o m m o n _ i n s t a l l
$$ ( INSTALL_DIR) $$ ( 1) /usr/share/openvswitch/scripts
$$ ( LN) /usr/share/openvswitch/scripts/ovs-ctl-wrapper $$ ( 1) /usr/bin/ovn-ctl
e n d e f
$( eval $ ( call OvsPackageTemplate ,ovn -common ) )
ovs_ovn-north_title := Open Virtual Network ( north package)
ovs_ovn-north_hidden :=
ovs_ovn-north_depends := +openvswitch-ovsdb +openvswitch-ovn-common
ovs_ovn-north_files := \
usr/share/openvswitch/ovn-nb.ovsschema \
usr/share/openvswitch/ovn-sb.ovsschema \
usr/bin/ovn-northd
$( eval $ ( call OvsPackageTemplate ,ovn -north ) )
ovs_ovn-host_title := Open Virtual Network ( chassis package)
ovs_ovn-host_hidden :=
ovs_ovn-host_depends := +openvswitch +openvswitch-ovn-common
ovs_ovn-host_files := usr/bin/ovn-controller
$( eval $ ( call OvsPackageTemplate ,ovn -host ) )
ovs_python_title := Open vSwitch ( Python library)
ovs_python_hidden :=
ovs_python_depends := +PACKAGE_openvswitch-python:python +PACKAGE_openvswitch-python:python-six
d e f i n e o v s _ p y t h o n _ i n s t a l l
$$ ( INSTALL_DIR) $$ ( 1) $$ ( PYTHON_PKG_DIR)
$$ ( CP) $$ ( PKG_INSTALL_DIR) /usr/share/openvswitch/python/ovs $$ ( 1) $$ ( PYTHON_PKG_DIR)
e n d e f
$( eval $ ( call OvsPackageTemplate ,python ) )
$( foreach p ,$ ( ovs_packages ) ,\
$( eval $( call BuildPackage,$( p) ) ) \
)
$( eval $ ( call KernelPackage ,openvswitch ) )
$( eval $ ( call KernelPackage ,openvswitch -gre ) )