[oi-dev] dmidecode package

Joshua M. Clulow josh at sysmgr.org
Wed Jun 30 00:25:54 UTC 2021


On Mon, 28 Jun 2021 at 10:06, stes at PANDORA.BE <stes at telenet.be> wrote:
> In order to fix DDU (Device Detection Utility) for the Dell Precision workstation,
> and possibly for other computers with UEFI, perhaps dmidecode could be packaged.
>
> http://savannah.nongnu.org/projects/dmidecode/
>
> This dmidecode utility compiles without problems and it works for me.
>
> It supports UEFI and their support for UEFI seems to work on OpenIndiana.
>
> Once dmidecode is packaged, the DDU probe script could use dmidecode,
> instead of dmi_info.
>
> I'm not familiar enough with DDU nor dmidecode to see whether this is a good idea,
> but it could work I guess.

We actually have a library for dealing with SMBIOS in the OS today:

    https://github.com/illumos/illumos-gate/tree/master/usr/src/lib/libsmbios

    https://github.com/illumos/illumos-gate/blob/master/usr/src/uts/common/sys/smbios.h

It's used by a core OS command, smbios(1M), to interrogate the SMBIOS
tables for display.  The same code is also used by various core OS
libraries and the kernel as required.

It definitely works on UEFI machines; e.g., on an Intel NUC to which I
have access:

    $ smbios -t 2
    ID    SIZE TYPE
    2     115  SMB_TYPE_BASEBOARD (type 2) (base board)

      Manufacturer: Intel Corporation
      Product: NUC6i7KYB
      Version: H90766-405
      Serial Number: [REDACTED]
      Asset Tag:
      Location Tag: Default string

      Chassis: 3
      Flags: 0x9
            SMB_BBFL_MOTHERBOARD (board is a motherboard)
            SMB_BBFL_REPLACABLE (board is field-replacable)
      Board Type: 0xa (motherboard)

The source for the "dmi_info" command that comes with DDU seems to be here:

    https://github.com/OpenIndiana/ddu/blob/oi/hipster/utils/dmi_info/dmi.c

It looks like it would be relatively easy to port it to use libsmbios
from the OS.  You would include <smbios.h> and link with -lsmbios and
you should be able to get going.

Note that there is not currently a strong stability guarantee around
the libsmbios ABI, but if you pass a specific version (e.g.,
SMB_VERSION_34) instead of just the latest version token (i.e.,
SMB_VERSION, as we do in the gate) then things will probably be OK.
In practice, we try pretty hard to keep existing binaries working --
and we may be able to make stronger guarantees and provide manual
pages and so on if there are consumers outside the gate.


Cheers.

-- 
Joshua M. Clulow
http://blog.sysmgr.org



More information about the oi-dev mailing list