diff options
-rw-r--r-- | meta-oe/recipes-extended/atftp/atftp_0.7.bb | 50 | ||||
-rw-r--r-- | meta-oe/recipes-extended/atftp/files/atftpd.init | 37 | ||||
-rw-r--r-- | meta-oe/recipes-extended/atftp/files/atftpd.service | 11 |
3 files changed, 98 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/atftp/atftp_0.7.bb b/meta-oe/recipes-extended/atftp/atftp_0.7.bb new file mode 100644 index 000000000..c5416341f --- /dev/null +++ b/meta-oe/recipes-extended/atftp/atftp_0.7.bb | |||
@@ -0,0 +1,50 @@ | |||
1 | DESCRIPTION = "Advanced TFTP server and client" | ||
2 | SECTION = "network" | ||
3 | HOMEPAGE = "http://packages.debian.org/atftp" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | SRC_URI = "${DEBIAN_MIRROR}/main/a/atftp/atftp_${PV}.dfsg.orig.tar.gz;name=archive \ | ||
8 | ${DEBIAN_MIRROR}/main/a/atftp/atftp_${PV}.dfsg-11.diff.gz;name=patch \ | ||
9 | file://atftpd.init \ | ||
10 | file://atftpd.service" | ||
11 | |||
12 | S = "${WORKDIR}/atftp-${PV}.dfsg" | ||
13 | |||
14 | inherit autotools update-rc.d systemd useradd | ||
15 | |||
16 | SYSTEMD_PACKAGES = "atftpd-systemd" | ||
17 | SYSTEMD_SERVICE_atftpd-systemd = "atftpd.service" | ||
18 | |||
19 | INITSCRIPT_NAME = "atftpd" | ||
20 | INITSCRIPT_PARAMS = "defaults 80" | ||
21 | |||
22 | USERADD_PACKAGES = "atftpd" | ||
23 | USERADD_PARAM_atftpd = "--system --no-create-home --shell /bin/false \ | ||
24 | --user-group nobody" | ||
25 | |||
26 | do_install_append() { | ||
27 | install -d ${D}${sysconfdir}/init.d | ||
28 | install -m 0755 ${WORKDIR}/atftpd.init ${D}${sysconfdir}/init.d/atftpd | ||
29 | |||
30 | install -d ${D}${base_libdir}/systemd/system | ||
31 | install -m 644 ${WORKDIR}/atftpd.service ${D}${base_libdir}/systemd/system | ||
32 | |||
33 | install -d ${D}/srv/tftp | ||
34 | |||
35 | rm ${D}${sbindir}/in.tftpd | ||
36 | } | ||
37 | |||
38 | PACKAGES =+ "atftpd-systemd atftpd" | ||
39 | |||
40 | FILES_${PN} = "${bindir}/*" | ||
41 | |||
42 | FILES_${PN}d = "${sbindir}/* ${sysconfdir}/init.d/* /srv/tftp" | ||
43 | |||
44 | FILES_atftpd-systemd += "${base_libdir}/systemd" | ||
45 | RDEPENDS_atftpd-systemd += "atftpd" | ||
46 | |||
47 | SRC_URI[archive.md5sum] = "aa269044a6f992eca78fee2f6119643c" | ||
48 | SRC_URI[archive.sha256sum] = "18815f5b67290fac087c6b9da28dfa5e0feb722096f5c5de52e59b46026da559" | ||
49 | SRC_URI[patch.md5sum] = "1636f199bf32c754a7bf34a5c647d138" | ||
50 | SRC_URI[patch.sha256sum] = "0df33f6c09c2b2de58a84d7bb757844fc9538cd4d6c8d9c463da5270ebc2e41d" | ||
diff --git a/meta-oe/recipes-extended/atftp/files/atftpd.init b/meta-oe/recipes-extended/atftp/files/atftpd.init new file mode 100644 index 000000000..161d97aca --- /dev/null +++ b/meta-oe/recipes-extended/atftp/files/atftpd.init | |||
@@ -0,0 +1,37 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/atftpd and type | ||
5 | # > update-rc.d atftpd defaults 60 | ||
6 | # | ||
7 | |||
8 | |||
9 | test -f /usr/sbin/atftpd || exit 0 | ||
10 | |||
11 | test -d /srv/tftp || mkdir -p /srv/tftp | ||
12 | |||
13 | case "$1" in | ||
14 | start) | ||
15 | echo -n "Starting tftp daemon: atftpd" | ||
16 | start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69 | ||
17 | echo "." | ||
18 | ;; | ||
19 | stop) | ||
20 | echo -n "Stopping tftp daemon: atftpd" | ||
21 | start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd | ||
22 | echo "." | ||
23 | ;; | ||
24 | reload|force-reload) | ||
25 | start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd | ||
26 | ;; | ||
27 | restart) | ||
28 | $0 stop | ||
29 | sleep 1 | ||
30 | $0 start | ||
31 | ;; | ||
32 | *) | ||
33 | echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}" | ||
34 | exit 1 | ||
35 | esac | ||
36 | |||
37 | exit 0 | ||
diff --git a/meta-oe/recipes-extended/atftp/files/atftpd.service b/meta-oe/recipes-extended/atftp/files/atftpd.service new file mode 100644 index 000000000..c7aa29c09 --- /dev/null +++ b/meta-oe/recipes-extended/atftp/files/atftpd.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Advanced TFTP Server | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/var/run/atftpd.pid | ||
8 | ExecStart=/usr/sbin/atftpd --daemon --port 69 | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||