From 091ab39b39a43bcf87eed3e62152b65fb4fca284 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 29 Jan 2008 13:50:41 +0000 Subject: [PATCH] For destiny induced nbroot boots, set serial console correctly git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@344 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/destiny.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/destiny.pm b/xCAT-server-2.0/lib/xcat/plugins/destiny.pm index 4470317fe..2a7487e6c 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/destiny.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/destiny.pm @@ -73,6 +73,7 @@ sub setdestiny { my $noderes=xCAT::Table->new('noderes'); my $nodetype = xCAT::Table->new('nodetype'); my $sitetab = xCAT::Table->new('site'); + my $nodehm = xCAT::Table->new('nodehm'); (my $portent) = $sitetab->getAttribs({key=>'xcatdport'},'value'); (my $mastent) = $sitetab->getAttribs({key=>'master'},'value'); foreach (@nodes) { @@ -84,12 +85,29 @@ sub setdestiny { my $arch = $ent->{arch}; my $ent = $noderes->getNodeAttribs($_,[qw(xcatmaster)]); my $master; + my $kcmdline; if ($mastent and $mastent->{value}) { $master = $mastent->{value}; } if ($ent and $ent->{xcatmaster}) { $master = $ent->{xcatmaster}; } + $ent = $noderes->getNodeAttribs($_,['serialport']); + if ($ent and defined($ent->{serialport})) { + $kcmdline = "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]}); + return; + } + $kcmdline .= ",".$ent->{serialspeed}; + $ent = $nodehm->getNodeAttribs($_,['serialflow']); + if ($ent and ($ent->{serialflow} eq 'hard' or $ent->{serialflow} eq 'rtscts')) { + $kcmdline .= "n8r"; + } + $kcmdline .= " "; + } + unless ($master) { $callback->({error=>["No master in site table nor noderes table for $_"],errorcode=>[1]}); return; @@ -100,7 +118,7 @@ sub setdestiny { } $noderes->setNodeAttribs($_,{kernel => "xcat/nbk.$arch", initrd => "xcat/nbfs.$arch.gz", - kcmdline => "xcatd=$master:$xcatdport"}); + kcmdline => $kcmdline."xcatd=$master:$xcatdport"}); } $nodetype->close; } elsif (!($state eq "boot")) {