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/branches/2.6@10260 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua
2011-08-10 08:49:36 +00:00
parent dde8390522
commit 4ef818ba79
4 changed files with 21 additions and 7 deletions
+1 -1
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$/) {
+1 -1
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);
+17 -3
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
####################################
+2 -2
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: