]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - novaboot
tftpd: Run with mapfile
[novaboot.git] / novaboot
index c17b5c1075c4720c89b338f504812982cb192eeb..d6a60edc6aa376dc9192e670f0b1ef1cd06debf8 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -544,7 +544,7 @@ sub generate_syslinux_config($$$$)
 
     if (system("file $kbin|grep 'Linux kernel'") == 0) {
        my $initrd = @$modules_ref[1];
-       die('To many "load" lines for Linux kernel') if (scalar @$modules_ref > 2);
+       die('Too many "load" lines for Linux kernel') if (scalar @$modules_ref > 2);
        print $fg "LINUX $base$kbin\n";
        print $fg "APPEND $kcmd\n";
        print $fg "INITRD $base$initrd\n";
@@ -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);