Documentation
¶
Overview ¶
Package linuxdt reads identity information from the Linux DeviceTree, exposed by the kernel under /sys/firmware/devicetree/base. It is the DeviceTree counterpart to the linuxdmi package and is used as a fallback on systems (most ARM/RISC-V boards) that have no DMI/SMBIOS tables.
All knowledge of DeviceTree property names and layout lives here: callers ask for a piece of identity (Model, Vendor, SerialNumber, ...) and never deal with raw property paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Available ¶
Available returns true if the DeviceTree firmware tree is present, i.e. the host exposes /sys/firmware/devicetree/base.
func ChassisType ¶
ChassisType returns the SMBIOS chassis type code corresponding to the standardized DeviceTree "chassis-type" property (e.g. "34" for "embedded"), or util.UNKNOWN if the property is absent or unrecognized. Only some boards expose it.
func Model ¶
Model returns the DeviceTree "model" string (e.g. "Raspberry Pi 4 Model B Rev 1.4"), or util.UNKNOWN if absent.
func SerialNumber ¶
SerialNumber returns the DeviceTree "serial-number" string, or util.UNKNOWN if absent (not all boards provide one).
func SoC ¶
SoC returns the System-on-Chip identifier taken from the most specific (last) entry of the "compatible" list, e.g. "rockchip,rk3576" from "seeed,recomputer-rk3576-devkit\0rockchip,rk3576\0". The compatible list runs from most specific board to the underlying SoC, so the last entry is the SoC. Returns util.UNKNOWN if there is no compatible property.
func UBootVersion ¶
UBootVersion returns the U-Boot firmware version recorded by the bootloader in the "chosen" node, or util.UNKNOWN if absent (boards using another bootloader do not provide it).
Types ¶
This section is empty.