fix xcat-Bugs-3386437, add -d <data_directory> for rflash to do firmware udpate

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10254 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2011-08-10 07:00:18 +00:00
parent 7d1196bd80
commit 56156f5e37
5 changed files with 22 additions and 8 deletions

View File

@ -145,7 +145,7 @@ sub fsp_api_action {
my $cmd;
my $install_dir = xCAT::Utils->getInstallDir();
if( $action =~ /^code_update$/) {
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name: -d $install_dir/packages_fw/";
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter -d $install_dir/packages_fw/";
} elsif($action =~ /^add_connection$/) {
$cmd = "$fsp_api -a $action -u $user -p $password -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
} elsif ($action =~ /^set_frame_number$/) {

View File

@ -472,7 +472,7 @@ sub rflash {
dpush ( \@value, [$name, $msg]);
}
my $res = xCAT::FSPUtils::fsp_api_action( $name, $d, $action );
my $res = xCAT::FSPUtils::fsp_api_action( $name, $d, $action, 0, $request->{opt}->{d} );
push(@value,[$name, @$res[1], @$res[2]]);
return (\@value);

View File

@ -12,7 +12,6 @@ use Getopt::Long;
use File::Spec;
use POSIX qw(tmpnam);
my $packages_dir= ();
my $activate = ();
my $verbose = 0;
@ -96,7 +95,7 @@ sub parse_args {
$Getopt::Long::ignorecase = 0;
Getopt::Long::Configure( "bundling" );
if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s activate=s commit recover) )) {
if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s d=s activate=s commit recover) )) {
return( usage() );
}
@ -136,6 +135,17 @@ sub parse_args {
if ( exists( $opt{p} ) && ($opt{p} !~ /^\//) ) {#relative path
$opt{p} = xCAT::Utils->full_path($opt{p}, $request->{cwd}->[0]);
}
if( exists( $opt{d} ) ) {
if(!exists( $opt{activate}) ) {
return( usage("Option -d must be used with --activate ") );
}
}
if ( exists( $opt{d} ) && ($opt{d} !~ /^\//) ) {#relative path
$opt{d} = xCAT::Utils->full_path($opt{d}, $request->{cwd}->[0]);
}
###############################
#--activate's value only can be concurrent and disruptive
################################
@ -143,8 +153,12 @@ sub parse_args {
if( ($opt{activate} ne "concurrent") && ($opt{activate} ne "disruptive")) {
return (usage("--activate's value can only be concurrent or disruptive"));
}
if(!exists( $opt{d} )) {
$opt{d} = "/tmp";
}
}
####################################
# Check for "-" with no option
####################################

View File

@ -475,7 +475,7 @@ nodehm => {
descriptions => {
node => 'The node name or group name.',
power => 'The method to use to control the power of the node. If not set, the mgt attribute will be used. Valid values: ipmi, blade, hmc, ivm, fsp. If "ipmi", xCAT will search for this node in the ipmi table for more info. If "blade", xCAT will search for this node in the mp table. If "hmc", "ivm", or "fsp", xCAT will search for this node in the ppc table.',
mgt => 'The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp. See the power attribute for more details.',
mgt => 'The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa. See the power attribute for more details.',
cons => 'The console method. If nodehm.serialport is set, this will default to the nodehm.mgt setting, otherwise it defaults to unused. Valid values: cyclades, mrv, or the values valid for the mgt attribute.',
termserver => 'The hostname of the terminal server.',
termport => 'The port number on the terminal server that this node is connected to.',

View File

@ -214,10 +214,10 @@ my %usage = (
"Usage:
rflash [ -h|--help|-v|--version]
PPC (with HMC) specific:
rflash <noderange> -p directory [--activate concurrent | disruptive][-V|--verbose]
rflash <noderange> -p <rpm_directory> [--activate concurrent | disruptive][-V|--verbose]
rflash <noderange> [--commit | --recover] [-V|--verbose]
PPC (using Direct FSP Management) specific:
rflash <noderange> -p directory --activate disruptive
rflash <noderange> -p <rpm_directory> --activate disruptive [-d <data_directory>]
rflash <noderange> [--commit | --recover] [-V|--verbose]",
"mkhwconn" =>
"Usage: