diff --git a/openwrt/uspd/Makefile b/openwrt/uspd/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..42b2ef252c83d183559768a593acf5cc258e1610 --- /dev/null +++ b/openwrt/uspd/Makefile @@ -0,0 +1,43 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=uspd +PKG_VERSION:=1.0.5 +PKG_RELEASE:=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git +PKG_SOURCE_VERSION=x +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_MAINTAINER:=IOPSYS Dev <dev@iopsys.eu> + +CONFIG_SRC_TREE_OVERRIDE:=y + +include $(INCLUDE_DIR)/package.mk + +define Package/uspd + SECTION:=iopsys + CATEGORY:=IOPSYS + TITLE:=USP ubus backend + DEPENDS:=+libubox +ubus +libbbfdm +endef + +define Package/uspd/description + Ubus based backend for TR-369/USP which can be used by other USP agents + running on top of it. +endef + +TARGET_CFLAGS += \ + -I$(STAGING_DIR)/usr/include \ + -D_GNU_SOURCE + +define Package/uspd/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_BIN) ./files/uspd.init $(1)/etc/init.d/uspd + $(INSTALL_CONF) ./files/uspd.config $(1)/etc/config/uspd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/uspd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,uspd)) diff --git a/openwrt/uspd/files/uspd.config b/openwrt/uspd/files/uspd.config new file mode 100644 index 0000000000000000000000000000000000000000..d8b3621c1dd8facfca451c02d9faff667cd34dec --- /dev/null +++ b/openwrt/uspd/files/uspd.config @@ -0,0 +1,2 @@ +config uspd 'usp' + option granularitylevel '0' diff --git a/openwrt/uspd/files/uspd.init b/openwrt/uspd/files/uspd.init new file mode 100644 index 0000000000000000000000000000000000000000..2f78897689e375749e94c2518b624b128c371811 --- /dev/null +++ b/openwrt/uspd/files/uspd.init @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common + +START=94 +STOP=10 + +USE_PROCD=1 +PROG=/usr/sbin/uspd + +start_service() { + procd_open_instance + procd_set_param command ${PROG} + procd_set_param respawn + procd_close_instance +} + +reload_service() { + stop + start +} + +service_triggers() +{ + procd_add_reload_trigger "cwmp" + procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart +} diff --git a/openwrt/uspd/git-src b/openwrt/uspd/git-src new file mode 120000 index 0000000000000000000000000000000000000000..a49c86c1b5493e1b9757f63c13782062e0a45a4c --- /dev/null +++ b/openwrt/uspd/git-src @@ -0,0 +1 @@ +../../.git/ \ No newline at end of file