From: alberand Date: Wed, 24 Feb 2021 17:16:06 +0000 (+0100) Subject: tftpd: Run with mapfile X-Git-Tag: 20211022~6^2~11 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/novaboot.git/commitdiff_plain/542767610030a1398c0767c1a2f4c256510266b9 tftpd: Run with mapfile This mapfile is needed as some pxeclient add zero byte \x00 to the end of the filename. This is a known bug. The mapfile contains rule to remove that byte. --- diff --git a/novaboot b/novaboot index 5e8ed54..d6a60ed 100755 --- a/novaboot +++ b/novaboot @@ -1151,9 +1151,15 @@ host server { if (defined $dhcp_tftp || defined $tftp) { $tftp_port ||= 69; + # Generate TFTP mapfile + open(my $fh, '>', "$builddir/mapfile"); + print $fh "# Some PXE clients (mainly UEFI) have bug. They add zero byte to the end of the +# path name. This rule removes it +r \\.efi.* \\.efi"; + close($fh); # Unfortunately, tftpd requires root privileges even with # non-privileged (>1023) port due to initgroups(). - system_verbose("sudo in.tftpd --listen --secure -v -v -v --pidfile tftpd.pid --address :$tftp_port $builddir"); + system_verbose("sudo in.tftpd --listen --secure -v -v -v --pidfile tftpd.pid -m mapfile --address :$tftp_port $builddir"); # Kill server when we die $SIG{__DIE__} = sub { system_verbose('sudo pkill --pidfile=dhcpd.pid') if (defined $dhcp_tftp);