From a6aab0c6d082f6bb1f8832cb42ce99e2fdda31b2 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 19 Jun 2013 06:55:03 +0000 Subject: [PATCH] update the nodelist.status to installing/netbooting via feedback from node during provision git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16682 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/debian.pm | 15 ++++++++++ .../share/xcat/install/scripts/pre.ubuntu | 29 +++++++++++++++++++ .../share/xcat/netboot/ubuntu/genimage | 22 ++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index ffab2ab89..f67afa9c1 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -889,6 +889,8 @@ sub mknetboot my $installroot; $installroot = "/install"; my $xcatdport = "3001"; + my $xcatiport = "3002"; + my $nodestatus = "y"; if ($sitetab) { @@ -902,11 +904,21 @@ sub mknetboot { $xcatdport = $ref->{value}; } + ($ref) = $sitetab->getAttribs({key => 'xcatiport'}, 'value'); + if ($ref and $ref->{value}) + { + $xcatiport = $ref->{value}; + } ($ref) = $sitetab->getAttribs({key => 'tftpdir'}, 'value'); if ($ref and $ref->{value}) { $globaltftpdir = $ref->{value}; } + ($ref) = $sitetab->getAttribs({key => 'nodestatus'}, 'value'); + if ($ref and $ref->{value}) + { + $nodestatus = $ref->{value}; + } } my %donetftp=(); my %oents = %{$ostab->getNodesAttribs(\@nodes,[qw(os arch profile provmethod)])}; @@ -1307,6 +1319,9 @@ sub mknetboot $kcmdline = "imgurl=http://$imgsrv/$rootimgdir/rootimg-statelite.gz STATEMNT="; } + if(($nodestatus eq "n") or ($nodestatus eq "N") or ($nodestatus eq "0")){ + $kcmdline .= " nonodestatus "; + } # add support for subVars in the value of "statemnt" diff --git a/xCAT-server/share/xcat/install/scripts/pre.ubuntu b/xCAT-server/share/xcat/install/scripts/pre.ubuntu index 95c95ece9..e6bcf76b9 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/pre.ubuntu @@ -63,9 +63,18 @@ cat >/tmp/foo.sh < /dev/null && export DEBUG=1 # TODO: does "anaconda.busybox sh" support "set " ? PRINIC=$prinic +NODESTATUS='y' +XCATIPORT="3002" for i in `cat /proc/cmdline`; do KEY=`echo \$i |awk -F= '{print \$1}'` @@ -971,7 +973,17 @@ for i in `cat /proc/cmdline`; do VALUE=`echo \$i |awk -F= '{print \$2}'` # format: XCAT=xcatmaster:3001 XCATSERVER=\$VALUE + elif [ "\$KEY" == 'XCATIPORT' ]; then + VALUE=`echo \$i |awk -F= '{print \$2}'` + # format: XCAT=xcatmaster:3001 + XCATIPORT=\$VALUE fi + + #if "nonodestatus" specified,do not update the nodestatus + if [ \$i == 'nonodestatus' ]; then + NODESTATUS='n' + fi + done if [ -z "\$IFACE" ]; then @@ -998,6 +1010,16 @@ while ! ifconfig | grep 'inet addr'; do done ifconfig lo 127.0.0.1 ifconfig lo up + + +XCATMASTER=`echo \$XCATSERVER|awk -F: '{print \$1}'` + + +#update nodelist.nodestatus to "netbooting" +if [ \$NODESTATUS != 'n' ]; then + /tmp/updateflag \$XCATMASTER \$XCATIPORT "installstatus netbooting" +fi + cd / for i in `cat /proc/cmdline`; do KEY=`echo \$i |awk -F= '{print \$1}'`