diff --git a/xCAT-nbroot/xcat-core-nbroot.spec b/xCAT-nbroot/xcat-core-nbroot.spec index 69ecab7be..b0eacfebc 100644 --- a/xCAT-nbroot/xcat-core-nbroot.spec +++ b/xCAT-nbroot/xcat-core-nbroot.spec @@ -51,6 +51,12 @@ chmod 755 etc/init.d/S40network bin/getdestiny bin/getdestiny.awk bin/getipmi bi cd - +%post +if [ "$1" == "2" ]; then #only on upgrade, as on install it's probably not going + #to work... + . /etc/profile.d/xcat.sh + mknb %{tarch} +fi %Files %defattr(-,root,root) diff --git a/xCAT-server-2.0/lib/xcat/plugins/mknb.pm b/xCAT-server-2.0/lib/xcat/plugins/mknb.pm index 84ad3e62c..a778dfb9c 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/mknb.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/mknb.pm @@ -41,7 +41,7 @@ sub process_request { my $installdir = "/install"; my $tftpdir = "/tftpboot"; if (scalar(@{$request->{arg}}) != 1) { - $callback->({error=>"Need to specifiy architecture (x86_64 or ppc64)"},{errorcode=>[1]}); + $callback->({error=>"Need to specifiy architecture (x86, x86_64 or ppc64)"},{errorcode=>[1]}); return; } my $arch = $request->{arg}->[0]; @@ -106,8 +106,27 @@ sub process_request { chmod(0644,"$tftpdir/pxelinux.0"); } } + my $dopxe=0; foreach (keys %{$hexnets}) { - if ($arch =~ /x86/) { + $dopxe=0; + if ($arch =~ /x86/) { #only do pxe if just x86 or x86_64 and no x86 + if ($arch =~ /x86_64/) { + if (-r "$tftpdir/pxelinux.cfg/".uc($_)) { + my $pcfg; + open($pcfg,"<","$tftpdir/pxelinux.cfg/".uc($_)); + my @pcfgcontents = <$pcfg>; + close($pcfg); + if (grep (/x86_64/,@pcfgcontents)) { + $dopxe=1; + } + } else { + $dopxe=1; + } + } else { + $dopxe=1; + } + } + if ($dopxe) { open($cfgfile,">","$tftpdir/pxelinux.cfg/".uc($_)); print $cfgfile "DEFAULT xCAT\n"; print $cfgfile " LABEL xCAT\n"; diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index ff2c2d65e..81c82ab43 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -22,7 +22,7 @@ Requires: atftp dhcp httpd nfs-utils expect conserver fping bind perl-XML-Parser %endif %ifarch i386 i586 i686 x86 x86_64 -Requires: xCAT-nbroot-oss-x86_64 xCAT-nbroot-core-x86_64 xCAT-nbkernel-x86_64 syslinux +Requires: xCAT-nbroot-oss-x86 xCAT-nbroot-core-x86 xCAT-nbkernel-x86 xCAT-nbroot-oss-x86_64 xCAT-nbroot-core-x86_64 xCAT-nbkernel-x86_64 syslinux Requires: ipmitool >= 1.8.9 %endif @@ -163,6 +163,7 @@ if [ "$1" = "1" ]; then #Only if installing for the fist time.. XCATROOT=$RPM_INSTALL_PREFIX0 /etc/init.d/xcatd start if [ -x $RPM_INSTALL_PREFIX0/sbin/mknb ]; then %ifarch i386 i586 i686 x86 x86_64 + $RPM_INSTALL_PREFIX0/sbin/mknb x86 $RPM_INSTALL_PREFIX0/sbin/mknb x86_64 %endif %ifarch ppc ppc64