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";
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);