From c70cc5f6a5d6d89f3e74ecfc26cb2c88c6d6ad88 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 4 Mar 2025 09:06:13 -0500 Subject: [PATCH] Provide build id values for SMMV3 firmware Provide an OEM method to get Oem data from firmware into the normalized form, and use that to hook the SMM firmware information. Change-Id: I7028c510afebf103fb6e0aaabdf085de3472eef2 --- pyghmi/redfish/command.py | 3 ++- pyghmi/redfish/oem/generic.py | 3 +++ pyghmi/redfish/oem/lenovo/smm3.py | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index de8b7d48..32feea92 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -1115,7 +1115,7 @@ class Command(object): yield res def _extract_fwinfo(self, inf): - currinf = {} + currinf = self._oem._extract_fwinfo(inf) fwi, url = inf fwname = fwi.get('Name', 'Unknown') if fwname in self._fwnamemap: @@ -1129,6 +1129,7 @@ class Command(object): currinf['id'] = fwi.get('Id', None) currinf['version'] = fwi.get('Version', 'Unknown') currinf['date'] = parse_time(fwi.get('ReleaseDate', '')) + currinf['software_id'] = fwi.get('SoftwareId', '') if not (currinf['version'] or currinf['date']): return None, None # TODO(Jarrod Johnson): OEM extended data with buildid diff --git a/pyghmi/redfish/oem/generic.py b/pyghmi/redfish/oem/generic.py index a77212f1..0cbb4ba0 100644 --- a/pyghmi/redfish/oem/generic.py +++ b/pyghmi/redfish/oem/generic.py @@ -650,6 +650,9 @@ class OEMHandler(object): return {} + def _extract_fwinfo(self, inf): + return {} + def get_firmware_inventory(self, components, fishclient): return [] diff --git a/pyghmi/redfish/oem/lenovo/smm3.py b/pyghmi/redfish/oem/lenovo/smm3.py index d35a30e5..aa3ab8df 100644 --- a/pyghmi/redfish/oem/lenovo/smm3.py +++ b/pyghmi/redfish/oem/lenovo/smm3.py @@ -104,6 +104,15 @@ class OEMHandler(generic.OEMHandler): progress({'phase': 'complete'}) return savefile + def _extract_fwinfo(self, inf): + fwi, url = inf + currinf = {} + buildid = fwi.get('Oem', {}).get('Lenovo', {}).get('ExtendedVersion', None) + if buildid: + currinf['build'] = buildid + return currinf + + def _get_node_info(self): nodeinfo = self._varsysinfo if not nodeinfo: