diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py index e24a70031..bdb8c96cc 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_flash.py @@ -527,6 +527,16 @@ class OpenBMCFlashTask(ParallelNodesCommand): try: obmc.login() + # Before uploading file, check CPU DD version + inventory_info_dict = obmc.get_inventory_info() + cpu_info = inventory_info_dict["CPU"] + for info in cpu_info: + if info.startswith("CPU0 Version : 20"): + # Display warning the only certain firmware versions are supported on DD 2.0 + self.callback.info( '%s: Warning: DD 2.0 processor detected on this node, should not have firmware > ibm-v2.0-0-r13.6 (BMC) and > v1.19_1.94 (Host).' % node) + if info.startswith("CPU0 Version : 21"): + if self.verbose: + self.callback.info( '%s: DD 2.1 processor' % node) except (SelfServerException, SelfClientException) as e: return self._msg_process(node, e.message, msg_type='E') diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 5a1723ef7..d33fa192e 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -4625,6 +4625,7 @@ sub rflash_upload { # curl commands my $curl_login_cmd = "curl -c $cjar_id -k -H 'Content-Type: application/json' -X POST $request_url/login -d '" . $content_login . "'"; my $curl_logout_cmd = "curl -b $cjar_id -k -H 'Content-Type: application/json' -X POST $request_url/logout -d '" . $content_logout . "'"; + my $curl_check_cpu_dd_cmd = "curl -b $cjar_id -k -H 'Content-Type: application/json' -X GET $request_url/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 | grep Version | cut -d: -f2"; if (%fw_tar_files) { foreach my $key (keys %fw_tar_files) { @@ -4656,6 +4657,17 @@ sub rflash_upload { } if ($h->{message} eq $::RESPONSE_OK) { if(%curl_upload_cmds){ + # Before uploading file, check CPU DD version + my $curl_dd_check_result = `$curl_check_cpu_dd_cmd`; + if ($curl_dd_check_result =~ "20") { + # Display warning the only certain firmware versions are supported on DD 2.0 + xCAT::SvrUtils::sendmsg("Warning: DD 2.0 processor detected on this node, should not have firmware > ibm-v2.0-0-r13.6 (BMC) and > v1.19_1.94 (Host).", $callback, $node); + } + if ($curl_dd_check_result =~ "21") { + if ($::VERBOSE) { + xCAT::SvrUtils::sendmsg("DD 2.1 processor", $callback, $node); + } + } while((my $file,my $version)=each(%fw_tar_files)){ my $uploading_msg = "Uploading $file ..."; my $upload_cmd = $curl_upload_cmds{$file};