From 2bcc16b884569fc973e2808b660fb9d2897bfeef Mon Sep 17 00:00:00 2001 From: jjhua Date: Thu, 27 May 2010 01:43:39 +0000 Subject: [PATCH] getmacs and rnetboot with -o flag through hmc git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6253 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCboot.pm | 12 ++++++++++-- perl-xCAT/xCAT/PPCmac.pm | 5 ++++- xCAT-server/lib/perl/xCAT/PPC.pm | 2 +- xCAT-server/sbin/lpar_netboot.expect | 11 +++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/perl-xCAT/xCAT/PPCboot.pm b/perl-xCAT/xCAT/PPCboot.pm index 14e26568a..9c396001f 100644 --- a/perl-xCAT/xCAT/PPCboot.pm +++ b/perl-xCAT/xCAT/PPCboot.pm @@ -177,11 +177,15 @@ sub do_rnetboot { } } + if ( exists( $opt->{o} )) { + $cmd.= " -o"; + } ####################################### # Network specified ####################################### $cmd.= " -s auto -d auto -m $opt->{m} -S $opt->{S} -G $opt->{G} -C $opt->{C} -N $opt->{N}"; - + + ####################################### # Get required attributes from master # of the node if -I|--iscsiboot is @@ -335,6 +339,11 @@ sub rnetboot { if ( exists( $options->{s} )) { $opt{s} = $options->{s}; } + + if ( exists( $options->{o} )) { + $opt{o} = $options->{o}; + } + ##################################### # Do iscsi boot ##################################### @@ -342,7 +351,6 @@ sub rnetboot { $opt{I} = 1; } - ##################################### # Invalid target hardware ##################################### diff --git a/perl-xCAT/xCAT/PPCmac.pm b/perl-xCAT/xCAT/PPCmac.pm index f4fa3aba9..a9b4944c0 100644 --- a/perl-xCAT/xCAT/PPCmac.pm +++ b/perl-xCAT/xCAT/PPCmac.pm @@ -301,7 +301,10 @@ sub do_getmacs { ####################################### # Network specified (-D ping test) ####################################### - if ( exists( $opt->{S} )) { + if ( exists( $opt->{S} )) { + if ( exists( $opt->{o} )) { + $cmd .=" -o"; + } $cmd.= " -D -s auto -d auto -S $opt->{S} -G $opt->{G} -C $opt->{C}"; } ####################################### diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 064cf4802..dba9f36c9 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -56,7 +56,7 @@ my %modules = ( }, rspconfig => { hmc => "xCAT::PPCcfg", fsp => "xCAT::FSPcfg", - bpa => "xCAT::PPCcfg", + bpa => "xCAT::FSPcfg", }, rflash => { hmc => "xCAT::PPCrflash", fsp => "xCAT::FSPflash", diff --git a/xCAT-server/sbin/lpar_netboot.expect b/xCAT-server/sbin/lpar_netboot.expect index 08adba439..69f371a61 100644 --- a/xCAT-server/sbin/lpar_netboot.expect +++ b/xCAT-server/sbin/lpar_netboot.expect @@ -1860,6 +1860,7 @@ set debug_flag 0 set rmvterm_flag 0 set immed_flag 0 set from_of 0 +set dev_type_found 0 set list_physical 0 set set_boot_order 0 set colon 0 @@ -2044,7 +2045,7 @@ if { [llength $argv] < 1 } { set arg0 [lindex $argv 0] set arg1 [lindex $argv 1] -if { [llength $argv] > 8 } { +if { [llength $argv] > 10 } { send_user "$PROGRAM: Extraneous parameter(s)\n" usage } @@ -2177,7 +2178,7 @@ if { [string compare "$msg" "Not Available"] == 0 } { } if { $from_of } { - if { ([string compare "$msg" "open-firmware"] != 0) } { + if { ([string compare "$msg" "open-firmware"] != 0) && ([string compare "$msg" "Open Firmware"] != 0) } { send_user "$PROGRAM: You used the -o option. Please make sure the LPAR's initial state is open firmware\n" set rc 1 exit 1 @@ -2245,7 +2246,7 @@ if { ([string compare "$msg" "Off"] == 0) || ([string compare "$msg" "off"] == 0 } } -} + set done 0 set retry_count 0 @@ -2328,6 +2329,8 @@ while { ! $done } { sleep 1 } +} + set retry 0 set done 0 set timeout 10 @@ -2686,7 +2689,7 @@ if { !$noboot } { set done 1 } } else { - if { ([string compare "$msg" "open-firmware"] == 0) } { + if { ([string compare "$msg" "open-firmware"] == 0) || ([string compare "$msg" "Open Firmware"] == 0) } { set done 1 } }