linux: fall back to DeviceTree when DMI is unavailable#471
Merged
Conversation
DMI/SMBIOS is absent on most DeviceTree-based systems (ARM/RISC-V boards), leaving chassis, product, baseboard, bios and cpu info all unknown. When DMI is unavailable but the DeviceTree is present, populate identity from /sys/firmware/devicetree/base instead: - chassis/product/baseboard: model, vendor (compatible prefix), serial-number - chassis type: map DeviceTree chassis-type to the SMBIOS type code - bios: chosen/u-boot,version reported as U-Boot firmware - cpu: SoC compatible (last entry) as processor model when cpuinfo has none DMI remains preferred when present. All DeviceTree property knowledge is encapsulated in the new linuxdt package via semantic accessors. Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
90020d3 to
51adb07
Compare
rpardini
added a commit
to rpardini/tinkerbell-tinkerbell
that referenced
this pull request
Jul 9, 2026
jaypipes
approved these changes
Jul 10, 2026
jaypipes
left a comment
Owner
There was a problem hiding this comment.
@rpardini this is excellent. Thank you so much for this contribution!
There's room to clean up some of the repeated testing utilities and I'd definitely want to get some ghw snapshots added to the testdata/ directory for these systems you are working with. But that can always be done in a followup PR. :)
Welcome to the ghw contributor club!
| paths := linuxpath.New(ctx) | ||
| path := filepath.Join(paths.SysFirmwareDeviceTree, name) | ||
|
|
||
| log.Debug(ctx, "reading from %q", path) |
Owner
There was a problem hiding this comment.
Probably best to remove this :) I need to remove it from the similar place in linuxdmi....
rpardini
added a commit
to rpardini/tinkerbell-tinkerbell
that referenced
this pull request
Jul 10, 2026
rpardini
added a commit
to rpardini/tinkerbell-tinkerbell
that referenced
this pull request
Jul 10, 2026
- see jaypipes/ghw#471 Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DMI/SMBIOS is absent on most DeviceTree-based systems (ARM/RISC-V boards), leaving chassis, product, baseboard, bios and cpu info all unknown. When DMI is unavailable but the DeviceTree is present, populate identity from /sys/firmware/devicetree/base instead:
chosen/u-boot,versionreported as U-Boot firmwareDMI remains preferred when present. All DeviceTree property knowledge is encapsulated in the new
linuxdtpackage via semantic accessors.