From 424ee762abbd5f5dcb86f0d15051700324c320a2 Mon Sep 17 00:00:00 2001 From: Ulrich Weber Date: Thu, 19 Nov 2015 17:19:19 +0100 Subject: [PATCH 1/5] openvswitch: depend on kernel so ovs gets rebuild on kernel changes Signed-off-by: Ulrich Weber --- net/openvswitch/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 3e8d6f600..f3ab47096 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -8,6 +8,7 @@ # $Id: Makefile $ include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=openvswitch @@ -34,7 +35,6 @@ PKG_INSTALL:=1 SUPPORTED_KERNELS:=LINUX_3_18||LINUX_4_1||LINUX_4_3 include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/kernel.mk $(call include_mk, python-package.mk) define Package/openvswitch/Default From 851d7d2cec9ec9a9cf7e15acf9d25864e7226368 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 27 Dec 2015 21:45:02 +0200 Subject: [PATCH 2/5] openvswitch: fix source paths for the install rule I guess these were left since some initial OVS package versions. They were fine up until recently. Some of the build artifacts got a little messy and thus the OpenWRT OVS package got a little messy. This cleans it up a bit. Signed-off-by: Alexandru Ardelean --- net/openvswitch/Makefile | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index f3ab47096..a8af356d2 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=openvswitch -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_VERSION:=2.5.0 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_LICENSE:=Apache-2.0 @@ -129,31 +129,30 @@ define Package/openvswitch/install $(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/ + $(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_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/ovs-appctl $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-ofctl $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-client $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-dpctl $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-vsctl $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/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_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_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 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 define Package/openvswitch-ipsec/install @@ -163,7 +162,7 @@ endef define Package/openvswitch-benchmark/install $(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 define Package/openvswitch/postinst From 43e68fac39707da8f108f9f8f6d525cf5f14a97b Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 29 Dec 2015 13:42:16 +0200 Subject: [PATCH 3/5] openvswitch: remove redundant postint rule Signed-off-by: Alexandru Ardelean --- net/openvswitch/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index a8af356d2..546ad86e1 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -165,11 +165,6 @@ define Package/openvswitch-benchmark/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/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)) From 959d5eaf1a5f02c1578690dfe2cd1764e2070fdd Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 29 Dec 2015 14:00:43 +0200 Subject: [PATCH 4/5] openvswitch: update titles for ovs-benchmark and ovs-monitor-ipsec packages Signed-off-by: Alexandru Ardelean --- net/openvswitch/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 546ad86e1..88b3829e6 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -76,7 +76,7 @@ endef define Package/openvswitch-ipsec $(call Package/openvswitch/Default) - TITLE:=Open vSwitch Userspace Package + TITLE:=Open vSwitch GRE through IPsec tool DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python endef @@ -87,7 +87,7 @@ endef define Package/openvswitch-benchmark $(call Package/openvswitch/Default) - TITLE:=Open vSwitch Userspace Package + TITLE:=Open vSwitch flow setup benchmark utility DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch endef From 0600bf728c8cc1a7bffdfa640febcee44fd3bf6c Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 4 Jan 2016 14:06:25 +0200 Subject: [PATCH 5/5] openvswitch: split bin tools into separate packages And move them under an "Open vSwitch" submenu. It's cleaner this way. Signed-off-by: Alexandru Ardelean --- net/openvswitch/Makefile | 66 ++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 88b3829e6..fbefbdc25 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -39,6 +39,7 @@ $(call include_mk, python-package.mk) define Package/openvswitch/Default SECTION:=net + SUBMENU:=Open vSwitch CATEGORY:=Network URL:=http://openvswitch.org/ MAINTAINER:=Alexandru Ardelean @@ -54,20 +55,22 @@ define Package/openvswitch/Default/description 1000V. endef -define Package/openvswitch +define Package/openvswitch-base $(call Package/openvswitch/Default) - TITLE:=Open vSwitch Userspace Package + TITLE:=Open vSwitch Userspace Package (base) DEPENDS:=+libpcap +libopenssl +librt +kmod-openvswitch @($(SUPPORTED_KERNELS)) endef -define Package/openvswitch/description +define Package/openvswitch-base/description 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 define Package/openvswitch-python $(call Package/openvswitch/Default) TITLE:=Open vSwitch Python Support - DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch +python + DEPENDS:=+openvswitch +python endef define Package/openvswitch-python/description @@ -77,7 +80,7 @@ endef define Package/openvswitch-ipsec $(call Package/openvswitch/Default) TITLE:=Open vSwitch GRE through IPsec tool - DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch-python + DEPENDS:=+openvswitch-python endef define Package/openvswitch-ipsec/description @@ -88,13 +91,25 @@ endef define Package/openvswitch-benchmark $(call Package/openvswitch/Default) TITLE:=Open vSwitch flow setup benchmark utility - DEPENDS:=@PACKAGE_openvswitch +PACKAGE_openvswitch:openvswitch + DEPENDS:=+openvswitch endef define Package/openvswitch-benchmark/description Utility for running OpenVSwitch benchmarking 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 SECTION:=kernel CATEGORY:=Kernel modules @@ -122,7 +137,24 @@ TARGET_CFLAGS += -flto -std=gnu99 CONFIGURE_VARS += KARCH=$(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/init.d @@ -135,11 +167,6 @@ define Package/openvswitch/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsflow.so* $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-appctl $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-ofctl $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-client $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-dpctl $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-vsctl $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovsdb-tool $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/sbin/ @@ -165,9 +192,22 @@ define Package/openvswitch-benchmark/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovs-benchmark $(1)/usr/bin/ endef -$(eval $(call BuildPackage,openvswitch)) +define Package/openvswitch/install + : +endef + +$(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-ipsec)) $(eval $(call BuildPackage,openvswitch-benchmark)) +$(eval $(call BuildPackage,openvswitch)) $(eval $(call KernelPackage,openvswitch))