diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2017-08-23 17:14:53 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2017-09-12 10:37:19 -0400 |
commit | 1cd795164638dc79ec8e707052aa8f3a5aeb3a3d (patch) | |
tree | ba1c62a35a37e093c24a683f9121dccce6f09979 /meta-networking | |
parent | 986a0247804905a049f3a94474a4e0d285f8291a (diff) | |
download | meta-openembedded-1cd795164638dc79ec8e707052aa8f3a5aeb3a3d.tar.gz |
tftp-hpa: add systemd unit files
Add systemd unit files for tftp-hpa.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking')
3 files changed, 29 insertions, 1 deletions
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service b/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service new file mode 100644 index 000000000..97d56586b --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Tftp Server | ||
3 | Requires=tftpd-hpa.socket | ||
4 | |||
5 | [Service] | ||
6 | ExecStart=@SBINDIR@/in.tftpd-hpa -s /var/lib/tftpboot | ||
7 | StandardInput=socket | ||
8 | |||
9 | [Install] | ||
10 | Also=tftpd-hpa.socket | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket b/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket new file mode 100644 index 000000000..8764c1de3 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket | |||
@@ -0,0 +1,8 @@ | |||
1 | [Unit] | ||
2 | Description=Tftp Server Activation Socket | ||
3 | |||
4 | [Socket] | ||
5 | ListenDatagram=69 | ||
6 | |||
7 | [Install] | ||
8 | WantedBy=sockets.target | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb index 7f567133b..0a418b97f 100644 --- a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb +++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | |||
@@ -26,12 +26,14 @@ SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.t | |||
26 | file://add-error-check-for-disk-filled-up.patch \ | 26 | file://add-error-check-for-disk-filled-up.patch \ |
27 | file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ | 27 | file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ |
28 | file://fix-writing-emtpy-file.patch \ | 28 | file://fix-writing-emtpy-file.patch \ |
29 | file://tftpd-hpa.socket \ | ||
30 | file://tftpd-hpa.service \ | ||
29 | " | 31 | " |
30 | 32 | ||
31 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" | 33 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" |
32 | SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269" | 34 | SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269" |
33 | 35 | ||
34 | inherit autotools-brokensep update-rc.d update-alternatives | 36 | inherit autotools-brokensep update-rc.d update-alternatives systemd |
35 | 37 | ||
36 | export AR = "${HOST_PREFIX}ar cq" | 38 | export AR = "${HOST_PREFIX}ar cq" |
37 | 39 | ||
@@ -60,6 +62,11 @@ do_install() { | |||
60 | 62 | ||
61 | install -d ${D}${sysconfdir}/default | 63 | install -d ${D}${sysconfdir}/default |
62 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa | 64 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa |
65 | |||
66 | install -d ${D}${systemd_unitdir}/system | ||
67 | install -m 0644 ${WORKDIR}/tftpd-hpa.socket ${D}${systemd_unitdir}/system | ||
68 | install -m 0644 ${WORKDIR}/tftpd-hpa.service ${D}${systemd_unitdir}/system | ||
69 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tftpd-hpa.service | ||
63 | } | 70 | } |
64 | 71 | ||
65 | FILES_${PN} = "${bindir}" | 72 | FILES_${PN} = "${bindir}" |
@@ -77,3 +84,6 @@ ALTERNATIVE_${PN} = "tftp" | |||
77 | ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa" | 84 | ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa" |
78 | ALTERNATIVE_PRIORITY = "60" | 85 | ALTERNATIVE_PRIORITY = "60" |
79 | 86 | ||
87 | SYSTEMD_PACKAGES = "tftp-hpa-server" | ||
88 | SYSTEMD_SERVICE_tftp-hpa-server = "tftpd-hpa.socket tftpd-hpa.service" | ||
89 | SYSTEMD_AUTO_ENABLE_tftp-hpa-server = "enable" | ||