diff --git a/perl-xCAT-2.0/xCAT/Schema.pm b/perl-xCAT-2.0/xCAT/Schema.pm index 97018890f..34fe7ba73 100644 --- a/perl-xCAT-2.0/xCAT/Schema.pm +++ b/perl-xCAT-2.0/xCAT/Schema.pm @@ -31,7 +31,7 @@ package xCAT::Schema; keys => [qw(node)], }, iscsi => { - cols => [qw(node server target file userid passwd comments disable)], + cols => [qw(node server target file userid passwd kernel kcmdline initrd comments disable)], keys => [qw(node)], }, vpd => { @@ -79,7 +79,7 @@ package xCAT::Schema; keys => [qw(groupname)] }, switch => { - cols => [qw(node switch vlan port comments disable)], + cols => [qw(node switch port vlan comments disable)], keys => [qw(node switch port)] }, nodelist => { diff --git a/xCAT-client-2.0/bin/wcons b/xCAT-client-2.0/bin/wcons index 6f57d6f8c..b4c546721 100755 --- a/xCAT-client-2.0/bin/wcons +++ b/xCAT-client-2.0/bin/wcons @@ -1,12 +1,41 @@ -#!/bin/sh +#!/usr/bin/env perl #A placeholder wcons, a fuller port from 1.3 is needed -if [ -z "$DISPLAY" ]; then - echo '$DISPLAY not set' - exit 1 -fi -NODES=`nodels $1` -MYDIR=`dirname $0` -for n in $NODES -do - xterm -rv -name wcons -T $n -n $n -e $MYDIR/rcons $n & -done +use Getopt::Long qw(:config getopt_compat); +use File::Basename; +use Data::Dumper; +unless ($ENV{DISPLAY}) { + print '$DISPLAY not set'; + exit 1; +} +my $mydir = dirname($0); +my $sb; +my $tilefact; +my $font; +GetOptions( + 'sb' => \$sb, + 'tile|t:i' => \$tilefact, + 'font|f=s' => \$font +); +my $nodes=`nodels $ARGV[0]`; +my @nodes = split /\n/,$nodes; +my $firstnode = shift @nodes; +if (defined($tilefact)) { + system("xterm -name $firstnode -title $firstnode -n $firstnode -geometry +0+0 -e $mydir/rcons $firstnode &"); + sleep(1); + my $xinfo = `xwininfo -name $firstnode` +} else { + system("xterm -name $firstnode -title $firstnode -n $firstnode -e $mydir/rcons $firstnode &"); + +} +foreach (@nodes) { + system("xterm -name $_ -title $_ -n $_ -e $mydir/rcons $_ &"); +} + + +#print Dumper(\@ARGV); + +#MYDIR=`dirname $0` +#for n in $NODES +#do +# xterm -name wcons -T $n -n $n -e $MYDIR/rcons $n & +#done diff --git a/xCAT-server-2.0/lib/xcat/plugins/destiny.pm b/xCAT-server-2.0/lib/xcat/plugins/destiny.pm index 2a7487e6c..1d5e46bf4 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/destiny.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/destiny.pm @@ -2,6 +2,7 @@ package xCAT_plugin::destiny; use xCAT::NodeRange; use Data::Dumper; +use xCAT::Utils; use Sys::Syslog; use strict; @@ -48,6 +49,24 @@ sub setdestiny { my %nstates; if ($state eq "next") { return nextdestiny(); + } elsif ($state eq "iscsiboot") { + my $iscsitab=xCAT::Table->new('iscsi'); + unless ($iscsitab) { + $callback->({error=>"Unable to open iscsi table to get iscsiboot parameters",errorcode=>[1]}); + } + my $noderestab = xCAT::Table->new('noderes'); + foreach (@{$req->{node}}) { + my $ient = $iscsitab->getNodeAttribs($_,[qw(kernel kcmdline initrd)]); + unless ($ient and $ient->{kernel}) { + $callback->({error=>"$_: No iscsi boot data available",errorcode=>[1]}); + next; + } + my $hash; + $hash->{kernel} = $ient->{kernel}; + if ($ient->{initrd}) { $hash->{initrd} = $ient->{initrd} } + if ($ient->{kcmdline}) { $hash->{kcmdline} = $ient->{kcmdline} } + $noderestab->setNodeAttribs($_,$hash); + } } elsif ($state =~ /^install$/ or $state eq "install" or $state eq "netboot") { chomp($state); $subreq->({command=>["mk$state"], @@ -255,6 +274,8 @@ sub getdestiny { $response{imgserver}=$nrent->{xcatmaster}; } elsif (defined($sent->{value})) { $response{imgserver}=$sent->{value}; + } else { + $response{imgserver} = xCAT::Utils->my_ip_facing($node); } $callback->({node=>[\%response]}); diff --git a/xCAT-server-2.0/sbin/xcatd b/xCAT-server-2.0/sbin/xcatd index 6cc21c518..78687c395 100755 --- a/xCAT-server-2.0/sbin/xcatd +++ b/xCAT-server-2.0/sbin/xcatd @@ -165,15 +165,15 @@ if (xCAT::Utils->isLinux()) { # exit(0); #} } elsif ($text =~ /^unlocktftpdir/) { #TODO: only nodes in install state should be allowed - close($conn); - mkpath("$tftpdir/xcat/$node"); + mkpath("$tftpdir/xcat/$node"); chmod 01777,"$tftpdir/xcat/$node"; chmod 0666,glob("$tftpdir/xcat/$node/*"); + close($conn); } elsif ($text =~ /locktftpdir/) { chmod 0755,"$tftpdir/xcat/$node"; chmod 0644,glob("$tftpdir/xcat/$node/*"); - } elsif ($text =~ /^setnetboot/) { - $text =~ s/^setnetboot\s+//; + } elsif ($text =~ /^setiscsiparms/) { + $text =~ s/^setiscsiparms\s+//; my $kname; my $iname; my $kcmdline; @@ -181,8 +181,10 @@ if (xCAT::Utils->isLinux()) { chomp($kcmdline); my $noderestab = xCAT::Table->new('noderes',-create=>1); $noderestab->setNodeAttribs($node,{kernel=>"xcat/$node/$kname",initrd=>"xcat/$node/$iname",kcmdline=>$kcmdline}); + my $iscsitab = xCAT::Table->new('iscsi',-create=>1); + $iscsitab->setNodeAttribs($node,{kernel=>"xcat/$node/$kname",initrd=>"xcat/$node/$iname",kcmdline=>$kcmdline}); my $chaintab = xCAT::Table->new('chain',-create=>1); - $chaintab->setNodeAttribs($node,{currstate=>'netboot',currchain=>'netboot'}); + $chaintab->setNodeAttribs($node,{currstate=>'iscsiboot',currchain=>'netboot'}); $noderestab->close; $chaintab->close; undef $noderestab; diff --git a/xCAT/postscripts/uploadboot b/xCAT/postscripts/uploadboot index 46aed58a8..2b8aa0107 100755 --- a/xCAT/postscripts/uploadboot +++ b/xCAT/postscripts/uploadboot @@ -25,4 +25,4 @@ cp $INITRD /servboot/$INAME umount /servboot `dirname $0`/locktftpdir.awk $MASTER 3002 rmdir /servboot -`dirname $0`/setnetboot.awk $MASTER 3002 $KNAME $INAME "$KCMDLINE" +`dirname $0`/setiscsiparms.awk $MASTER 3002 $KNAME $INAME "$KCMDLINE"