From 6258b32d7ccc40e5de1e7dcd6cdd8db34cca55ca Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Thu, 17 Sep 2020 21:35:18 -0700 Subject: [PATCH 1/2] atftp: add init script and config file Signed-off-by: Russell Senior --- net/atftp/Makefile | 7 ++++++- net/atftp/files/atftpd.conf | 3 +++ net/atftp/files/atftpd.init | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 net/atftp/files/atftpd.conf create mode 100755 net/atftp/files/atftpd.init diff --git a/net/atftp/Makefile b/net/atftp/Makefile index 72362c604..5f1d43401 100644 --- a/net/atftp/Makefile +++ b/net/atftp/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atftp PKG_VERSION:=0.7.2 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) @@ -53,6 +53,11 @@ endef define Package/atftpd/install $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/atftpd.init $(1)/etc/init.d/atftpd + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_BIN) ./files/atftpd.conf $(1)/etc/config/atftpd + $(INSTALL_DIR) $(1)/srv/tftp $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)//usr/sbin/atftpd $(1)/usr/sbin/ endef diff --git a/net/atftp/files/atftpd.conf b/net/atftp/files/atftpd.conf new file mode 100644 index 000000000..6bd66e94c --- /dev/null +++ b/net/atftp/files/atftpd.conf @@ -0,0 +1,3 @@ + +config service 'service' + option path '/srv/tftp' diff --git a/net/atftp/files/atftpd.init b/net/atftp/files/atftpd.init new file mode 100755 index 000000000..83573f998 --- /dev/null +++ b/net/atftp/files/atftpd.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2020 OpenWrt.org + +START=95 +PIDFILE=/tmp/run/atftpd.pid + +start() { + config_load atftpd + config_get SRV service path "/srv/tftp" + config_get PORT service port 69 + + atftpd --pidfile $PIDFILE --user root.root --port $PORT --daemon $SRV +} + +stop() { + kill $(cat $PIDFILE) +} From 885c054d57592843aa066a8b63bae10446b29c8c Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Fri, 18 Sep 2020 19:32:06 -0700 Subject: [PATCH 2/2] CI: add runtime test for atftp and atftpd Signed-off-by: Russell Senior --- net/atftp/test.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 net/atftp/test.sh diff --git a/net/atftp/test.sh b/net/atftp/test.sh new file mode 100644 index 000000000..68054b7b8 --- /dev/null +++ b/net/atftp/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +"$1" --version 2>&1 | grep "$2"