chid: Provide a command to access chid features

Provide a simple command which supports showing the information which
goes into calculating a CHID. The information is obtained entirely from
SMBIOS tables at present.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-08-31 14:22:46 -06:00
parent 99b1335957
commit 93f35ef78a
7 changed files with 168 additions and 0 deletions

67
doc/usage/cmd/chid.rst Normal file
View File

@@ -0,0 +1,67 @@
.. SPDX-License-Identifier: GPL-2.0+
chid command
============
Synopsis
--------
::
chid show
Description
-----------
The chid command provides access to Computer Hardware IDs (CHIDs) generated from
SMBIOS data. CHIDs are used by Windows Update and fwupd for hardware
identification and firmware-update targeting.
CHIDs are generated according to Microsoft's specification, which defines 15
different hardware ID variants (HardwareID-00 through HardwareID-14), each
using different combinations of SMBIOS fields. The variants range from most
specific (including all identifying fields) to least specific (manufacturer
only).
Subcommands
-----------
show
Show the relevant SMBIOS values for the current board. These are used to
calculate CHIDs.
Examples
--------
::
=> chid show
Manufacturer: Sandbox Corp
Family: Sandbox_Family
Product Name: Sandbox Computer
Product SKU: SANDBOX-SKU
Baseboard Manuf: Sandbox Boards
Baseboard Product: Sandbox Motherboard
BIOS Vendor: U-Boot
BIOS Version: 2025.08-g167811e037b5-dirty
BIOS Major: 25
BIOS Minor: 8
Enclosure Type: 2
=>
Configuration
-------------
The chid command is available when `CONFIG_CMD_CHID` is enabled.
Return value
------------
The return value $? is 0 (true) on success, 1 (false) on failure.
See also
--------
* :doc:`smbios <smbios>` - SMBIOS table information

View File

@@ -49,6 +49,7 @@ Shell commands
cmd/cbcmos
cmd/cbsysinfo
cmd/cedit
cmd/chid
cmd/cli
cmd/cls
cmd/cmp