From ff20b96dba91feec3e506ae354877a85c89a6951 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 13 May 2015 03:40:35 -0400 Subject: [PATCH] 1. appending "statement" within makedhcp rather than from nodeset, find corrent tftpserver for petitboot booting; 2. Use hvc0 for ppc64 genesis shell --- xCAT-server/lib/xcat/plugins/destiny.pm | 6 ++++- xCAT-server/lib/xcat/plugins/dhcp.pm | 29 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 861bbadfd..400edcb65 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -400,7 +400,11 @@ sub setdestiny { } $ent = $hments->{$_}->[0]; #$nodehm->getNodeAttribs($_,['serialport','serialspeed','serialflow']); if ($ent and defined($ent->{serialport})) { - $kcmdline .= "console=tty0 console=ttyS".$ent->{serialport}; + if ($arch eq "ppc64") { + $kcmdline .= "console=tty0 console=hvc".$ent->{serialport}; + } else { + $kcmdline .= "console=tty0 console=ttyS".$ent->{serialport}; + } #$ent = $nodehm->getNodeAttribs($_,['serialspeed']); unless ($ent and defined($ent->{serialspeed})) { $callback->({error=>["Serial port defined in noderes, but no nodehm.serialspeed set for $_"],errorcode=>[1]}); diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 57dbe376e..7a56a453e 100755 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -500,6 +500,35 @@ sub addnode { $guess_next_server = 1; } + if ($nrent->{netboot} and $nrent->{netboot} eq 'petitboot') { + if ($guess_next_server) { + my $node_server = undef; + if ($nrent->{xcatmaster}) { + $node_server = $nrent->{xcatmaster}; + } elsif ($nrent->{servicenode}) { + $node_server = $nrent->{servicenode}; + } + unless($node_server) { + $nxtsrv = xCAT::NetworkUtils->my_ip_facing($node); + unless($nxtsrv) { + $callback->({ error => ["Unable to determine the tftpserver for node"], errorcode => [1]}); + return; + } + } else { + my $tmp_server = inet_aton($node_server); + unless($tmp_server) { + $callback->({ error => ["Unable to resolve the tftpserver for node"], errorcode => [1]}); + return; + } + $nxtsrv = inet_ntoa($tmp_server); + } + unless ($nxtsrv) { + $callback->({ error => ["Unable to determine the tftpserver for node"], errorcode => [1]}); + return; + } + $guess_next_server = 0; + } + } #else { # $nrent = $nrtab->getNodeAttribs($node,['servicenode']);