ovsd: add package
authorDaniel Golle <daniel@makrotopia.org>
Wed, 31 Mar 2021 00:31:32 +0000 (01:31 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 31 Mar 2021 23:14:26 +0000 (00:14 +0100)
Add Open vSwtich configuration daemon for netifd.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
net/ovsd/Makefile [new file with mode: 0644]
net/ovsd/files/etc/init.d/ovsd [new file with mode: 0755]
net/ovsd/files/lib/netifd/ubusdev-config/ovsd.json [new file with mode: 0644]

diff --git a/net/ovsd/Makefile b/net/ovsd/Makefile
new file mode 100644 (file)
index 0000000..72c7e5d
--- /dev/null
@@ -0,0 +1,43 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ovsd
+PKG_VERSION:=2020-10-12
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://gitlab.hhi.fraunhofer.de/wn-ina/ovsd.git
+PKG_SOURCE_VERSION:=e6a07f27dd8a5893eb6110c69922077995b9b26a
+PKG_MIRROR_HASH:=9d903b3fecd8a3e102e1477efe479fc3851b1814ea0852e1dae39065b88cd157
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_MAINTAINER:=Arne Kappen <akappen@inet.tu-berlin.de>
+PKG_LICENSE:=GPL-2.0
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+
+define Package/ovsd
+  SECTION:=net
+  SUBMENU:=Open vSwitch
+  CATEGORY:=Network
+  DEPENDS:=+openvswitch +libubox +libubus +netifd
+  TITLE:=Open vSwtich configuration daemon for netifd
+  MAINTAINER:=Arne Kappen <akappen@inet.tu-berlin.de>
+endef
+
+define Package/ovsd/description
+  External device handler adding Open vSwitch support to netifd.
+endef
+
+define Package/ovsd/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ovsd $(1)/sbin/
+       $(CP) ./files/* $(1)/
+endef
+
+$(eval $(call BuildPackage,ovsd))
diff --git a/net/ovsd/files/etc/init.d/ovsd b/net/ovsd/files/etc/init.d/ovsd
new file mode 100755 (executable)
index 0000000..f273e4e
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh /etc/rc.common
+
+START=19
+USE_PROCD=1
+
+start_service() {
+        procd_open_instance
+        procd_set_param command /sbin/ovsd
+        procd_set_param respawn
+       procd_set_param watch ovs
+
+        procd_close_instance
+}
\ No newline at end of file
diff --git a/net/ovsd/files/lib/netifd/ubusdev-config/ovsd.json b/net/ovsd/files/lib/netifd/ubusdev-config/ovsd.json
new file mode 100644 (file)
index 0000000..0867632
--- /dev/null
@@ -0,0 +1 @@
+{ "name" : "Open vSwitch", "ubus_name" : "ovs", "bridge" : "1", "br-prefix" : "ovs",  "config" : [ ["name", 3], ["ifname", 1], ["empty", 7], ["parent", 3], ["vlan", 5], ["ofcontrollers", 1], ["controller_fail_mode", 3], ["ssl_private_key", 3], ["ssl_cert", 3], ["ssl_ca_cert", 3], ["ssl_bootstrap", 7] ], "info" : [ ["ofcontrollers", 1], ["fail_mode", 3], ["ports", 1], ["parent", 3], ["vlan", 5], ["ssl", 2] ] }