Have mknb and pxe plugins try to fix lack of pxelinux.0 and error out on complete failure

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@585 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-02-26 18:48:43 +00:00
parent 0e27d30c5f
commit 74451b401b
2 changed files with 22 additions and 0 deletions

View File

@ -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($_));

View File

@ -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})) {