net/mmfd: add experimental mmfd package

This commit is contained in:
Christof Schulze 2017-02-13 19:24:18 +01:00
parent cef5afaac4
commit 4c84a04360
3 changed files with 65 additions and 0 deletions

27
net/mmfd/Makefile Normal file
View File

@ -0,0 +1,27 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mmfd
PKG_SOURCE_DATE:=2017-02-15
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/freifunk-gluon/mmfd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=2aa515ec81efdbeccfd7543f0ee63232da09d399
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/mmfd
SECTION:=net
CATEGORY:=Network
TITLE:=mesh multicast forwarding daemon
DEPENDS:= +kmod-tun
endef
define Package/mmfd/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mmfd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,mmfd))

26
net/mmfd/files/etc/init.d/mmfd Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=50
DAEMON=/usr/sbin/mmfd
start_service() {
procd_open_instance
procd_set_param command $DAEMON
procd_append_param command -v
procd_set_param respawn ${respawn_threshold:-60} ${respawn_timeout:-1} ${respawn_retry:-0}
procd_set_param stderr 1
procd_set_param stdout 1
procd_close_instance
}
service_triggers() {
local script=$(readlink "$initscript")
local name=$(basename "${script:-$initscript}")
procd_open_trigger
procd_add_raw_trigger "interface.*" 0 "/etc/init.d/$name" reload
procd_close_trigger
}

View File

@ -0,0 +1,12 @@
#!/usr/bin/lua
local uci = require('luci.model.uci').cursor()
uci:delete('network', 'mmfd')
uci:section('network', 'interface', 'mmfd', {
proto = 'static',
ifname = 'mmfd0',
ip6addr = 'fe80::1/64'
}
)
uci:save('network')