From 74451b401b16821452a275488983ba26f59a45c9 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 26 Feb 2008 18:48:43 +0000 Subject: [PATCH] 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 --- xCAT-server-2.0/lib/xcat/plugins/mknb.pm | 10 ++++++++++ xCAT-server-2.0/lib/xcat/plugins/pxe.pm | 12 ++++++++++++ 2 files changed, 22 insertions(+) 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})) {