diff --git a/xCAT-client/share/xcat/rvid/rvid.blade b/xCAT-client/share/xcat/rvid/rvid.blade index 1c2773c6d..ec9d5a71c 100755 --- a/xCAT-client/share/xcat/rvid/rvid.blade +++ b/xCAT-client/share/xcat/rvid/rvid.blade @@ -1,9 +1,28 @@ -#!/bin/sh +#!/bin/bash # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html +set +fwpref=${rvid_fwrev%%???} +fwver=${rvid_fwrev##????} +fwmaj=${fwver%%?} +if [ -z "$fwmaj" ]; then + echo "Unable to recognize AMM firmware revision" + exit 1 +fi mkdir -p /tmp/xcat if [ ! -f /tmp/xcat/$rvid_server.remotekvm.jar ]; then wget -O /tmp/xcat/$rvid_server.remotekvm.jar http://$rvid_server/private/remotekvm.jar fi +if [ $fwpref == 'BPET' ]; then + if [ $fwmaj -ge 46 ]; then + java -jar /tmp/xcat/$rvid_server.remotekvm.jar -s $rvid_server -r $rvid_authtoken -b $rvid_slot >& /dev/null + elif [ $fwmaj -ge 42 ]; then + java -jar /tmp/xcat/$rvid_server.remotekvm.jar $rvid_server -rbs $rvid_authtoken -ba $rvid_ba -port $rvid_port >& /dev/null + else + echo "Unknown method for firmware $rvid_fwrev, ensure it is at least BPET42R"; + fi +else + echo "Unknown semantics for $fwpref, trying a particular way, may not work." + java -jar /tmp/xcat/$rvid_server.remotekvm.jar $rvid_server -rbs $rvid_authtoken -ba $rvid_ba -b $rvid_slot >& /dev/null +fi -java -jar /tmp/xcat/$rvid_server.remotekvm.jar -s $rvid_server -r $rvid_authtoken -b $rvid_slot >& /dev/null -rm /tmp/xcat/rvid_server.remotekvm.jar +rm /tmp/xcat/$rvid_server.remotekvm.jar diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index ed441edd0..0d880fb5c 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1783,30 +1783,41 @@ sub get_kvm_params { my $html = $response->{_content}; my $destip; my $rbs; + my $fwrev; + my $port; foreach (split /\n/,$html) { if (/get("http://$mpa/private/remotecontrol.js.php"); + $html = $response->{_content}; foreach (split /\n/,$html) { - if (/{$mpa}->{username}; my $pass = $mpahash->{$mpa}->{password}; httplogin($mpa,$user,$pass); - (my $target, my $authtoken) = get_kvm_params($mpa); + (my $target, my $authtoken, my $fwrev, my $port, my $ba) = get_kvm_params($mpa); #an http logoff would invalidate the KVM token, so we can't do it here #For the instant in time, banking on the http session timeout to cleanup for us #It may be possible to provide the session id to client so it can logoff when done, but @@ -2662,6 +2673,13 @@ sub dompa { push(@output,"server:$target"); push(@output,"authtoken:$authtoken"); push(@output,"slot:$slot"); + push(@output,"fwrev:$fwrev"); + if ($port) { + push(@output,"ba:$ba"); + } + if ($ba) { + push(@output,"ba:$ba"); + } my %outh; $outh{node}->[0]->{name}=[$node]; $outh{node}->[0]->{data}=[];