Skip to content

linux: fall back to DeviceTree when DMI is unavailable#471

Merged
jaypipes merged 1 commit into
jaypipes:mainfrom
rpardini:devicetree-fallback
Jul 10, 2026
Merged

linux: fall back to DeviceTree when DMI is unavailable#471
jaypipes merged 1 commit into
jaypipes:mainfrom
rpardini:devicetree-fallback

Conversation

@rpardini

@rpardini rpardini commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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.

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>
@rpardini rpardini force-pushed the devicetree-fallback branch from 90020d3 to 51adb07 Compare July 9, 2026 18:42
@rpardini rpardini marked this pull request as ready for review July 9, 2026 18:55
rpardini added a commit to rpardini/tinkerbell-tinkerbell that referenced this pull request Jul 9, 2026

@jaypipes jaypipes left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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!

Comment thread pkg/linuxdt/dt_linux.go
paths := linuxpath.New(ctx)
path := filepath.Join(paths.SysFirmwareDeviceTree, name)

log.Debug(ctx, "reading from %q", path)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to remove this :) I need to remove it from the similar place in linuxdmi....

@jaypipes jaypipes merged commit ed1c31c into jaypipes:main Jul 10, 2026
15 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants