wsdd-native
wsdd-native copied to clipboard
Use SMBIOS to fetch values when possible?
Noticed the 'FIXME' in wsd_server.cpp and realized I'd done some research when I'd submitted a pull request towards WSDD2 before finding this project, and at least on Linux and FreeBSD you can fetch these values from the SMBIOS entries on x86-based systems, if that's helpful?
Also sorry if I'm not submitting PRs but only Issues, I'm not very comfortable diving into C++ codebases unfortunately.
FreeBSD: (I haven't confirmed if it's on OpenBSD and NetBSD yet, I don't have any installs of those currently.)
$ kenv | grep smbios
hint.smbios.0.mem="0xbfbfb000"
smbios.bios.reldate="05/22/2023"
smbios.bios.vendor="VMware, Inc."
smbios.bios.version="VMW201.00V.21805430.B64.2305221830"
smbios.chassis.maker="No Enclosure"
smbios.chassis.serial="None"
smbios.chassis.tag="No Asset Tag"
smbios.chassis.type="Other"
smbios.chassis.version="N/A"
smbios.memory.enabled="16777216"
smbios.planar.maker="Intel Corporation"
smbios.planar.product="440BX Desktop Reference Platform"
smbios.planar.serial="None"
smbios.planar.version="None"
smbios.socket.enabled="16"
smbios.socket.populated="16"
smbios.system.maker="VMware, Inc."
smbios.system.product="VMware20,1"
smbios.system.serial="VMware-56 4d d1 5f af 73 74 27-17 bb 1c ce 60 f8 c4 68"
smbios.system.uuid="5fd14d56-73af-2774-17bb-1cce60f8c468"
smbios.system.version="None"
smbios.version="2.6"
Linux:
$ grep . $(ls -ld /sys/class/dmi/id/* | grep -E "^[-]r.....r" | grep -Ev "(uevent|modalias)" | awk '{print $9}')
/sys/class/dmi/id/bios_date:02/21/2024
/sys/class/dmi/id/bios_release:5.6
/sys/class/dmi/id/bios_vendor:Intel Corp.
/sys/class/dmi/id/bios_version:BECFL357.86A.0097.2024.0221.1015
/sys/class/dmi/id/board_name:NUC8BEB
/sys/class/dmi/id/board_vendor:Intel Corporation
/sys/class/dmi/id/board_version:J72693-303
/sys/class/dmi/id/chassis_type:3
/sys/class/dmi/id/chassis_vendor:Intel Corporation
/sys/class/dmi/id/chassis_version:2.0
/sys/class/dmi/id/ec_firmware_release:3.26
/sys/class/dmi/id/product_family:Intel NUC
/sys/class/dmi/id/product_name:NUC8i3BEH
/sys/class/dmi/id/product_sku:BOXNUC8i3BEH
/sys/class/dmi/id/product_version:J72753-302
/sys/class/dmi/id/sys_vendor:Intel(R) Client Systems
$ sudo grep . $(ls -ld /sys/class/dmi/id/* | grep -E "^[-]r.....[^r]" | awk '{print $9}')
/sys/class/dmi/id/board_serial:GEBE843005X7
/sys/class/dmi/id/product_serial:G6BE84300Q9L
/sys/class/dmi/id/product_uuid:1f261432-e23e-6911-841c-94c691a6afd8
Note that some of the values are only accessible as root on Linux so I broke things up into the 'sudo grep' and 'normal grep' lines to show example values captured from the Intel NUC I had handy, and I filtered out the uevent/modalias entries as they just have very spammy output that I don't thin is relevant in this case.