Browse Source

Merge pull request #2238 from commodo/ovs-reduce-size-part1

openvswitch: reduce some package bloat
lilik-openwrt-22.03
Hannu Nyman 9 years ago
parent
commit
408e36cfa0
1 changed files with 66 additions and 32 deletions
  1. +66
    -32
      net/openvswitch/Makefile

+ 66
- 32
net/openvswitch/Makefile View File

@ -8,10 +8,11 @@
# $Id: Makefile $ # $Id: Makefile $
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=openvswitch PKG_NAME:=openvswitch
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_VERSION:=2.5.0 PKG_VERSION:=2.5.0
PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_LICENSE:=Apache-2.0 PKG_LICENSE:=Apache-2.0
@ -34,11 +35,11 @@ PKG_INSTALL:=1
SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3 SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
$(call include_mk, python-package.mk) $(call include_mk, python-package.mk)
define Package/openvswitch/Default define Package/openvswitch/Default
SECTION:=net SECTION:=net
SUBMENU:=Open vSwitch
CATEGORY:=Network CATEGORY:=Network
URL:=http://openvswitch.org/ URL:=http://openvswitch.org/
MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com> MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
@ -54,20 +55,22 @@ define Package/openvswitch/Default/description
1000V. 1000V.
endef endef
define Package/openvswitch
define Package/openvswitch-base
$(call Package/openvswitch/Default) $(call Package/openvswitch/Default)
TITLE:=Open vSwitch Userspace Package
TITLE:=Open vSwitch Userspace Package (base)
DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS)) DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS))
endef endef
define Package/openvswitch/description
define Package/openvswitch-base/description
Provides the main userspace components required for Open vSwitch to function. 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.
endef endef
define Package/openvswitch-python define Package/openvswitch-python
$(call Package/openvswitch/Default) $(call Package/openvswitch/Default)
TITLE:=Open vSwitch Python Support TITLE:=Open vSwitch Python Support
DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python
DEPENDS:=+openvswitch +python
endef endef
define Package/openvswitch-python/description define Package/openvswitch-python/description
@ -76,8 +79,8 @@ endef
define Package/openvswitch-ipsec define Package/openvswitch-ipsec
$(call Package/openvswitch/Default) $(call Package/openvswitch/Default)
TITLE:=Open vSwitch Userspace Package
DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python
TITLE:=Open vSwitch GRE through IPsec tool
DEPENDS:=+openvswitch-python
endef endef
define Package/openvswitch-ipsec/description define Package/openvswitch-ipsec/description
@ -87,14 +90,26 @@ endef
define Package/openvswitch-benchmark define Package/openvswitch-benchmark
$(call Package/openvswitch/Default) $(call Package/openvswitch/Default)
TITLE:=Open vSwitch Userspace Package
DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch
TITLE:=Open vSwitch flow setup benchmark utility
DEPENDS:=+openvswitch
endef endef
define Package/openvswitch-benchmark/description define Package/openvswitch-benchmark/description
Utility for running OpenVSwitch benchmarking Utility for running OpenVSwitch benchmarking
endef endef
OVS_BIN_TOOLS:=ovs-appctl ovs-ofctl ovs-dpctl ovs-vsctl ovsdb-client
define Package/openvswitch
$(call Package/openvswitch/Default)
TITLE:=Open vSwitch Userspace Package
DEPENDS:=+openvswitch-base $(foreach t,$(OVS_BIN_TOOLS),+openvswitch-$(t))
endef
define Package/openvswitch/description
Provides the main userspace components required for Open vSwitch to function.
Includes also the main OVS utilities (ovs-appctl, ovs-vsctl, etc).
endef
define KernelPackage/openvswitch define KernelPackage/openvswitch
SECTION:=kernel SECTION:=kernel
CATEGORY:=Kernel modules CATEGORY:=Kernel modules
@ -122,38 +137,49 @@ TARGET_CFLAGS += -flto -std=gnu99
CONFIGURE_VARS += KARCH=$(LINUX_KARCH) CONFIGURE_VARS += KARCH=$(LINUX_KARCH)
MAKE_FLAGS += ARCH="$(LINUX_KARCH)" MAKE_FLAGS += ARCH="$(LINUX_KARCH)"
define Package/openvswitch/install
define OvsBinUtility
define Package/openvswitch-$(1)
$(call Package/openvswitch/Default)
TITLE:=$(2)
DEPENDS:=+openvswitch-base
endef
define Package/openvswitch-$(1)/description
$(2)
endef
define Package/openvswitch-$(1)/install
$(INSTALL_DIR) $$(1)/usr/bin/ ;\
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
endef
endef
define Package/openvswitch-base/install
$(INSTALL_DIR) $(1)/etc/openvswitch $(INSTALL_DIR) $(1)/etc/openvswitch
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch $(INSTALL_BIN) ./files/etc/init.d/openvswitch.init $(1)/etc/init.d/openvswitch
$(INSTALL_DIR) $(1)/usr/lib/ $(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/
$(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/ $(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_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-tool $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/sbin/ $(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_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/ $(INSTALL_DIR) $(1)/usr/share/openvswitch/
$(INSTALL_CONF) $(PKG_BUILD_DIR)/vswitchd/vswitch.ovsschema $(1)/usr/share/openvswitch/
$(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/openvswitch/vswitch.ovsschema $(1)/usr/share/openvswitch/
endef endef
define Package/openvswitch-python/install 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)/
$(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
endef endef
define Package/openvswitch-ipsec/install define Package/openvswitch-ipsec/install
@ -163,17 +189,25 @@ endef
define Package/openvswitch-benchmark/install define Package/openvswitch-benchmark/install
$(INSTALL_DIR) $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/.libs/ovs-benchmark $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-benchmark $(1)/usr/bin/
endef endef
define Package/openvswitch/postinst
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/openvswitch enable || true
define Package/openvswitch/install
:
endef endef
$(eval $(call BuildPackage,openvswitch))
$(eval $(call OvsBinUtility,ovs-appctl,Open vSwitch app control utility))
$(eval $(call OvsBinUtility,ovs-ofctl,Open vSwitch OpenFlow control utility))
$(eval $(call OvsBinUtility,ovs-dpctl,Open vSwitch datapath management utility))
$(eval $(call OvsBinUtility,ovs-vsctl,Open vSwitch ovs-vswitchd management utility))
$(eval $(call OvsBinUtility,ovsdb-client,Open vSwitch database JSON-RPC client))
$(foreach t,$(OVS_BIN_TOOLS),$(eval $(call BuildPackage,openvswitch-$(t))))
$(eval $(call BuildPackage,openvswitch-base))
$(eval $(call BuildPackage,openvswitch-python)) $(eval $(call BuildPackage,openvswitch-python))
$(eval $(call BuildPackage,openvswitch-ipsec)) $(eval $(call BuildPackage,openvswitch-ipsec))
$(eval $(call BuildPackage,openvswitch-benchmark)) $(eval $(call BuildPackage,openvswitch-benchmark))
$(eval $(call BuildPackage,openvswitch))
$(eval $(call KernelPackage,openvswitch)) $(eval $(call KernelPackage,openvswitch))

Loading…
Cancel
Save