diff --git a/perl-xCAT/xCAT/FSPUtils.pm b/perl-xCAT/xCAT/FSPUtils.pm index afc47c99a..efe2f4331 100644 --- a/perl-xCAT/xCAT/FSPUtils.pm +++ b/perl-xCAT/xCAT/FSPUtils.pm @@ -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$/) { diff --git a/perl-xCAT/xCAT/FSPflash.pm b/perl-xCAT/xCAT/FSPflash.pm index 930c4d0e7..bdee63835 100644 --- a/perl-xCAT/xCAT/FSPflash.pm +++ b/perl-xCAT/xCAT/FSPflash.pm @@ -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); diff --git a/perl-xCAT/xCAT/PPCrflash.pm b/perl-xCAT/xCAT/PPCrflash.pm index 3e0dcde3a..99d55c6e9 100644 --- a/perl-xCAT/xCAT/PPCrflash.pm +++ b/perl-xCAT/xCAT/PPCrflash.pm @@ -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 #################################### diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index c3b82c57f..858402557 100644 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -214,10 +214,10 @@ my %usage = ( "Usage: rflash [ -h|--help|-v|--version] PPC (with HMC) specific: - rflash -p directory [--activate concurrent | disruptive][-V|--verbose] + rflash -p [--activate concurrent | disruptive][-V|--verbose] rflash [--commit | --recover] [-V|--verbose] PPC (using Direct FSP Management) specific: - rflash -p directory --activate disruptive + rflash -p --activate disruptive [-d ] rflash [--commit | --recover] [-V|--verbose]", "mkhwconn" => "Usage: