From b7d580f413310bf6de8cf391fb21dfa643961061 Mon Sep 17 00:00:00 2001 From: nott Date: Tue, 16 Dec 2008 14:55:12 +0000 Subject: [PATCH] Move updating of the SPOT to mkdsklsnode. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2550 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 50 +++++++++++----------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index db85b6e49..e733df0c7 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -1100,17 +1100,6 @@ sub mknimimage return 1; } - # - # Update the SPOT resource - # - my $rc=&updatespot($spot_name, $lpp_source_name, $callback); - if ($rc != 0) { - my $rsp; - push @{$rsp->{data}}, "Could not update the SPOT resource named \'$spot_name\'.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - return 1; - } - # # Identify or create the rest of the resources for this diskless image # @@ -1270,7 +1259,7 @@ sub mknimimage if ($::METHOD eq "rte" ) { - # need lpp_source, spot, resolv_conf, & bosinst_data + # need lpp_source, spot & bosinst_data # user can specify others # must have a source and a name @@ -1310,8 +1299,9 @@ sub mknimimage } elsif ($::METHOD eq "mksysb" ) { - # need mksysb, resolv_conf, & bosinst_data + # need mksysb bosinst_data # user provides SPOT + # TODO - create SPOT from mksysb # user can specify others # # get mksysb resource @@ -2783,9 +2773,11 @@ sub updatespot { my $spot_loc; - my $rsp; - push @{$rsp->{data}}, "Updating $spot_name.\n"; - xCAT::MsgUtils->message("I", $rsp, $callback); + if ($::VERBOSE) { + my $rsp; + push @{$rsp->{data}}, "Updating $spot_name.\n"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } # # add rpm.rte to the SPOT @@ -2859,15 +2851,15 @@ sub updatespot { xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } + } - # Modify the rc.dd-boot script to set the ODM correctly - my $boot_file = "$spot_loc/lib/boot/network/rc.dd_boot"; - if (&update_dd_boot($boot_file, $callback) != 0) { - my $rsp; - push @{$rsp->{data}}, "Could not update the rc.dd_boot file in the SPOT.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - return 1; - } + # Modify the rc.dd-boot script to set the ODM correctly + my $boot_file = "$spot_loc/lib/boot/network/rc.dd_boot"; + if (&update_dd_boot($boot_file, $callback) != 0) { + my $rsp; + push @{$rsp->{data}}, "Could not update the rc.dd_boot file in the SPOT.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; } # @@ -4004,6 +3996,16 @@ ll~; &make_SN_resource($callback, \@nodelist, \@image_names, \%imagehash, \%lochash); } + # Update the SPOT resource + foreach my $image (@image_names) { + my $rc=&updatespot($imagehash{$image}{'spot'}, $imagehash{$image}{'lpp_source'}, $callback); + if ($rc != 0) { + my $rsp; + push @{$rsp->{data}}, "$Sname: Could not update the SPOT resource named \'$imagehash{$image}{'spot'}\'.\n"; + xCAT::MsgUtils->message("I", $rsp, $callback); + } + } + # # define and initialize the diskless/dataless nodes #