From 06abc45a3e1ef87aca50eefe5c8dd972db89adff Mon Sep 17 00:00:00 2001 From: sakolish Date: Fri, 18 Apr 2008 16:40:30 +0000 Subject: [PATCH] Added "-f" flag to rnetboot (force LPAR shutdown) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1118 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/PPCboot.pm | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPCboot.pm b/perl-xCAT-2.0/xCAT/PPCboot.pm index 027e1d122..16c55dad2 100644 --- a/perl-xCAT-2.0/xCAT/PPCboot.pm +++ b/perl-xCAT-2.0/xCAT/PPCboot.pm @@ -6,6 +6,7 @@ use Getopt::Long; use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR); use xCAT::Usage; + ########################################################################## # Parse the command line for options and operands ########################################################################## @@ -19,8 +20,8 @@ sub parse_args { # Responds with usage statement ############################################# local *usage = sub { - my $usage_string=xCAT::Usage->getUsage($cmd); - return( [ $_[0], $usage_string]); + my $usage_string = xCAT::Usage->getUsage($cmd); + return( [ $_[0], $usage_string] ); }; ############################################# # Process command-line arguments @@ -37,10 +38,10 @@ sub parse_args { $Getopt::Long::ignorecase = 0; Getopt::Long::Configure( "bundling" ); - if ( !GetOptions( \%opt, qw(V|Verbose) )) { + if ( !GetOptions( \%opt, qw(V|Verbose f) )) { return( usage() ); } - #################################### + #################################### # Check for "-" with no option #################################### if ( grep(/^-$/, @ARGV )) { @@ -118,6 +119,12 @@ sub ivm_rnetboot { $cmd.= " -v -x"; } ####################################### + # Force LPAR shutdown + ####################################### + if ( exists( $opt->{f} )) { + $cmd.= " -i"; + } + ####################################### # Network specified ####################################### $cmd.= " -s auto -d auto -m $opt->{m} -S $opt->{S} -G $opt->{G} -C $opt->{C}"; @@ -169,7 +176,8 @@ sub rnetboot { my $request = shift; my $d = shift; - my $exp = shift; + my $exp = shift; + my $options = $request->{opt}; my $hwtype = @$exp[2]; my $result; my $node; @@ -196,6 +204,12 @@ sub rnetboot { m => $o->{mac} ); ##################################### + # Force LPAR shutdown + ##################################### + if ( exists( $options->{f} )) { + $opt{f} = 1; + } + ##################################### # Invalid target hardware ##################################### if ( $type !~ /^lpar$/ ) { @@ -320,3 +334,4 @@ sub rnetboot { +