Skip to content

Instantly share code, notes, and snippets.

@anatol
Created April 16, 2015 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anatol/87e4c6b0cf620cc2dae7 to your computer and use it in GitHub Desktop.
Save anatol/87e4c6b0cf620cc2dae7 to your computer and use it in GitHub Desktop.
Index: PKGBUILD
===================================================================
--- PKGBUILD (revision 237257)
+++ PKGBUILD (working copy)
@@ -8,17 +8,20 @@
arch=('i686' 'x86_64')
url="http://www.kernel.org/pub/software/network/tftp/tftp-hpa/"
license=('BSD')
+backup=('etc/tftpd.conf')
depends=('readline>=6.0.00')
conflicts=('netkit-tftp')
source=(http://www.kernel.org/pub/software/network/tftp/tftp-hpa/$pkgname-$pkgver.tar.gz
LICENSE
+ tftpd.conf
tftpd.service
tftpd.socket
tftp-hpa-0.49-fortify-strcpy-crash.patch)
md5sums=('3de3038e7c2bf6fc5d496825893ac8e7'
'6ce21e27b6fdc1a1adf85c81e42aeecf'
- 'ffeac33192eac4c526657b6789cace21'
- 'a23369ea33be8b4a5427ec2cfc5373dd'
+ 'b372088e550683df5ea8528ca6bbed1f'
+ 'd521dc085670f98278400eb1e75802df'
+ 'b04b9eb0bd049fa59dd518587a26d1c4'
'22e8629ef19bc276a102c5d4d284c1bd')
prepare() {
@@ -36,9 +39,10 @@
package() {
cd ${pkgname}-${pkgver}
make INSTALLROOT="${pkgdir}" install
+ install -D -m644 "${srcdir}/tftpd.conf" "$pkgdir/etc/tftpd.conf"
install -d "${pkgdir}/srv/tftp"
- install -D -m655 "${srcdir}/tftpd.service" "${pkgdir}/usr/lib/systemd/system/tftpd.service"
- install -D -m655 "${srcdir}/tftpd.socket" "${pkgdir}/usr/lib/systemd/system/tftpd.socket"
+ install -D -m644 "${srcdir}/tftpd.service" "${pkgdir}/usr/lib/systemd/system/tftpd.service"
+ install -D -m644 "${srcdir}/tftpd.socket" "${pkgdir}/usr/lib/systemd/system/tftpd.socket"
install -D -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
# Remove conflict with iputils
rm "${pkgdir}/usr/share/man/man8/tftpd.8"
Index: tftpd.conf
===================================================================
--- tftpd.conf (revision 0)
+++ tftpd.conf (working copy)
@@ -0,0 +1 @@
+TFTPD_ARGS="--secure /srv/tftp/"
Index: tftpd.service
===================================================================
--- tftpd.service (revision 237257)
+++ tftpd.service (working copy)
@@ -1,8 +1,11 @@
[Unit]
Description=hpa's original TFTP daemon
+After=network.target
[Service]
-ExecStart=/usr/bin/in.tftpd -s /srv/tftp/
-StandardInput=socket
-StandardOutput=inherit
-StandardError=journal
+Type=forking
+EnvironmentFile=/etc/tftpd.conf
+ExecStart=/usr/bin/in.tftpd --listen $TFTPD_ARGS
+
+[Install]
+WantedBy=multi-user.target
Index: tftpd.socket
===================================================================
--- tftpd.socket (revision 237257)
+++ tftpd.socket (working copy)
@@ -1,3 +1,7 @@
+[Unit]
+Description=hpa's original TFTP daemon
+Conflicts=tftpd.service
+
[Socket]
ListenDatagram=69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment