From 5f5bb2052f82c790149cd0bd3be25c3b03beb02e Mon Sep 17 00:00:00 2001 From: Patrick Lundgren Date: Mon, 15 Aug 2016 15:50:40 -0400 Subject: [PATCH] Added check for GTB Model Type to hpm upgrade buffer size --- xCAT-server/lib/xcat/plugins/ipmi.pm | 31 +++++++++++++++++----------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 77b65bebb..fb0a7fc16 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -524,10 +524,6 @@ sub on_bmc_connect { } elsif ($command eq "rspreset") { return resetbmc($sessdata); } elsif ($command eq "rbeacon") { - unless (defined $sessdata->{device_id}) { #need get device id data initted for SD350 workaround - $sessdata->{ipmisession}->subcmd(netfn => 6, command => 1, data => [], callback => \&gotdevid, callback_args => $sessdata); - return; - } return beacon($sessdata); } elsif ($command eq "rsetboot") { return setboot($sessdata); @@ -1732,9 +1728,22 @@ sub do_firmware_update { } xCAT::SvrUtils::sendmsg("rflash started, please wait.......", $callback, $sessdata->{node}, %allerrornodes); + + # check for 8335-GTB Model Type to adjust buffer size + my $buffer_size = "30000"; + my $cmd = $pre_cmd . " fru print 3"; + $output = xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) { + xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed: $output" ], + $callback, $sessdata->{node}, %allerrornodes); + return -1; + } + if ($output =~ /8335-GTB/) { + $buffer_size = "15000"; + } # step 1 power off - my $cmd = $pre_cmd . " chassis power off"; + $cmd = $pre_cmd . " chassis power off"; $output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC != 0) { xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed: $output" ], @@ -1751,14 +1760,14 @@ sub do_firmware_update { return -1; } - #check reset status + # check reset status unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 24)) { xCAT::SvrUtils::sendmsg([ 1, "Timeout to check the bmc status" ], $callback, $sessdata->{node}, %allerrornodes); return -1; } - #step 3 protect network + # step 3 protect network $cmd = $pre_cmd . " raw 0x32 0xba 0x18 0x00"; $output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC != 0) { @@ -1768,9 +1777,9 @@ sub do_firmware_update { } # step 4 upgrade firmware - $cmd = $pre_cmd . " -z 30000 hpm upgrade $hpm_file force"; + $cmd = $pre_cmd . " -z " . $buffer_size . " hpm upgrade $hpm_file force"; $output = xCAT::Utils->runcmd($cmd, -1); - + if ($::RUNCMD_RC != 0) { xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed." ], $callback, $sessdata->{node}, %allerrornodes); @@ -2358,9 +2367,7 @@ sub beacon { #if stuck with 1.5, say light for 255 seconds. In 2.0, specify to turn it on forever if ($subcommand eq "on") { - if ($sessdata->{mfg_id} == 19046 and $sessdata->{prod_id} == 13616) { # Lenovo SD350 - $sessdata->{ipmisession}->subcmd(netfn => 0x3a, command => 6, data => [ 1, 1 ], callback => \&beacon_answer, callback_args => $sessdata); - } elsif ($ipmiv2) { + if ($ipmiv2) { $sessdata->{ipmisession}->subcmd(netfn => 0, command => 4, data => [ 0, 1 ], callback => \&beacon_answer, callback_args => $sessdata); } else { $sessdata->{ipmisession}->subcmd(netfn => 0, command => 4, data => [0xff], callback => \&beacon_answer, callback_args => $sessdata);