* Using smbios-mdr: expected file format
@ 2021-07-08 14:31 Garrett, Mike (HPE Server Firmware)
2021-07-08 15:27 ` Artem Senichev
0 siblings, 1 reply; 2+ messages in thread
From: Garrett, Mike (HPE Server Firmware) @ 2021-07-08 14:31 UTC (permalink / raw)
To: OpenBMC Maillist
[-- Attachment #1: Type: text/plain, Size: 722 bytes --]
We have a method to transfer SMBIOS tables to the BMC (a legacy HPE-specific method implemented in our UEFI firmware), and on the BMC side, we can create a file at /var/lib/smbios/smbios2. We have also integrated smbios-mdr into the build. I'd like to match up our file format with what is expected by the smbios-mdr code to unlock all the goodness onto dbus.
Is there any documentation on the expected format of the file? I gather there's a header (struct MDRSMBIOSHeader) But what structure is imposed over the rest of the data. I'm hoping its something as simple as a concatenated set of SMBIOS records as defined in the spec (header(type, length, handle), type-specific-data, double-nulls).
Thanks,
Mike
[-- Attachment #2: Type: text/html, Size: 2441 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Using smbios-mdr: expected file format
2021-07-08 14:31 Using smbios-mdr: expected file format Garrett, Mike (HPE Server Firmware)
@ 2021-07-08 15:27 ` Artem Senichev
0 siblings, 0 replies; 2+ messages in thread
From: Artem Senichev @ 2021-07-08 15:27 UTC (permalink / raw)
To: Garrett, Mike (HPE Server Firmware); +Cc: OpenBMC Maillist
On Thu, Jul 08, 2021 at 02:31:44PM +0000, Garrett, Mike (HPE Server Firmware) wrote:
> We have a method to transfer SMBIOS tables to the BMC (a legacy HPE-specific method implemented in our UEFI firmware), and on the BMC side, we can create a file at /var/lib/smbios/smbios2. We have also integrated smbios-mdr into the build. I'd like to match up our file format with what is expected by the smbios-mdr code to unlock all the goodness onto dbus.
>
> Is there any documentation on the expected format of the file? I gather there's a header (struct MDRSMBIOSHeader) But what structure is imposed over the rest of the data. I'm hoping its something as simple as a concatenated set of SMBIOS records as defined in the spec (header(type, length, handle), type-specific-data, double-nulls).
Hi Mike,
There is a very simple format: header and SMBIOS dump.
This is how it works on our servers (patch for intel-ipmi-oem):
```
#include <smbiosmdrv2handler.hpp>
void handleSmbiosDump(const std::vector<uint8_t>& data)
{
// save dump in MDR format
const std::filesystem::path mdrPath(mdrType2File);
std::filesystem::create_directories(mdrPath.parent_path());
time_t timestamp;
time(×tamp);
std::ofstream mdrFile(mdrType2File, std::ios::trunc | std::ios::binary);
const MDRSMBIOSHeader header = {mdr2Version, mdrTypeII,
static_cast<uint32_t>(timestamp),
static_cast<uint32_t>(data.size())};
mdrFile.write(reinterpret_cast<const char*>(&header), sizeof(header));
mdrFile.write(reinterpret_cast<const char*>(data.data()), data.size());
mdrFile.close();
}
```
--
Regards,
Artem Senichev
Software Engineer, YADRO.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-08 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 14:31 Using smbios-mdr: expected file format Garrett, Mike (HPE Server Firmware)
2021-07-08 15:27 ` Artem Senichev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.