diff --git a/xCAT-server-2.0/lib/xcat/plugins/mknb.pm b/xCAT-server-2.0/lib/xcat/plugins/mknb.pm index c38df2b56..7e5201ba0 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/mknb.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/mknb.pm @@ -94,6 +94,16 @@ sub process_request { } } my $cfgfile; + if ($arch =~ /x86/) { + if (! -r "$tftpdir/pxelinux.0") { + unless (-r "/usr/lib/syslinux/pxelinux.0") { + $callback->({error=>["Unable to find pxelinux.0 "],errorcode=>[1]}); + return; + } + copy("/usr/lib/syslinux/pxelinux.0","$tftpdir/pxelinux.0"); + chmod(0644,"$tftpdir/pxelinux.0"); + } + } foreach (keys %{$hexnets}) { if ($arch =~ /x86/) { open($cfgfile,">","$tftpdir/pxelinux.cfg/".uc($_)); diff --git a/xCAT-server-2.0/lib/xcat/plugins/pxe.pm b/xCAT-server-2.0/lib/xcat/plugins/pxe.pm index 785d5ae64..f6e3bda60 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/pxe.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/pxe.pm @@ -202,6 +202,18 @@ sub process_request { push @nodes,$_; } } + if (! -r "$tftpdir/pxelinux.0") { + unless (-r "/usr/lib/syslinux/pxelinux.0") { + $callback->({error=>["Unable to find pxelinux.0 "],errorcode=>[1]}); + return; + } + copy("/usr/lib/syslinux/pxelinux.0","$tftpdir/pxelinux.0"); + chmod(0644,"$tftpdir/pxelinux.0"); + } + unless ( -r "$tftpdir/pxelinux.0" ) { + $callback->({errror=>["Unable to find pxelinux.0 from syslinux"],errorcode=>[1])}; + return; + } if (ref($request->{arg})) {