diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 5db90c191..3167f1e8f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1105,9 +1105,15 @@ sub parse_command_status { $next_status{RPOWER_ON_REQUEST} = "RPOWER_ON_RESPONSE"; $status_info{RPOWER_ON_RESPONSE}{argv} = "$subcommand"; } elsif ($subcommand eq "bmcreboot") { - $next_status{LOGIN_RESPONSE} = "RPOWER_BMCREBOOT_REQUEST"; + $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + $next_status{RINV_FIRM_RESPONSE}{PENDING} = "RSPCONFIG_DUMP_CLEAR_ALL_REQUEST"; + $next_status{RSPCONFIG_DUMP_CLEAR_ALL_REQUEST} = "RSPCONFIG_DUMP_CLEAR_RESPONSE"; + $next_status{RSPCONFIG_DUMP_CLEAR_RESPONSE} = "RPOWER_BMCREBOOT_REQUEST"; + $next_status{RINV_FIRM_RESPONSE}{NO_PENDING} = "RPOWER_BMCREBOOT_REQUEST"; $next_status{RPOWER_BMCREBOOT_REQUEST} = "RPOWER_RESET_RESPONSE"; $status_info{RPOWER_RESET_RESPONSE}{argv} = "$subcommand"; + $status_info{RINV_FIRM_RESPONSE}{check} = 1; } } @@ -2080,6 +2086,7 @@ sub rinv_response { my $src; my $content_info; my @sorted_output; + my $to_clear_dump = 0; # Get the functional IDs to accurately mark the active running FW my $functional = get_functional_software_ids($response_info); @@ -2102,6 +2109,16 @@ sub rinv_response { if (defined($content{Priority})) { $priority_value = $content{Priority}; } + + if ($status_info{RINV_FIRM_RESPONSE}{check}) { + if (($purpose_value =~ /BMC/) and + ($priority_value == 0 and %{$functional} and !exists($functional->{$sw_id}))) { + $to_clear_dump = 1; + } + @sorted_output = (); + last; + } + # # For 'rinv firm', only print Active software, unless verbose is specified # @@ -2177,11 +2194,19 @@ sub rinv_response { xCAT::MsgUtils->message("I", { data => ["$node: $_"] }, $callback); } } else { - xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node) if (!$status_info{RINV_FIRM_RESPONSE}{check}); } if ($next_status{ $node_info{$node}{cur_status} }) { - $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + if ($status_info{RINV_FIRM_RESPONSE}{check}) { + if ($to_clear_dump) { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{PENDING}; + } else { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{NO_PENDING} + } + } else { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + } gen_send_request($node); } else { $wait_node_num--; @@ -2803,7 +2828,7 @@ sub rspconfig_dump_response { if ($node_info{$node}{cur_status} eq "RSPCONFIG_DUMP_CLEAR_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { my $dump_id = $status_info{RSPCONFIG_DUMP_CLEAR_RESPONSE}{argv}; - xCAT::SvrUtils::sendmsg("[$dump_id] clear", $callback, $node); + xCAT::SvrUtils::sendmsg("[$dump_id] clear", $callback, $node) unless ($next_status{ $node_info{$node}{cur_status} }); } }