Skip to content

inventory/components

Hardware component recognition rules

Map of component keys to recognition rules. The inventory-components task evaluates each rule against the machine's Gohai data and records the matches in inventory/components-data. Site rules belong in inventory/components-site, which is merged over this map by key.

Rules match against a normalized device list built from the Gohai PCI.Devices entries plus a single synthetic entry for the system itself taken from DMI.System. Each device provides Vendor and VendorName, Device and DeviceName, Class, ClassName, SubclassName, the subsystem identifiers and Driver. Identifiers are lower case hex without a 0x prefix; Class is the six digit PCI class code, so ^0302 matches 3D controllers.

The vendor and device fields identify the silicon, while the subsystem fields identify the card as the OEM shipped it. A Dell PERC H330 reports vendor 1000 "Broadcom / LSI" with subsystem vendor 1028 "Dell" and subsystem name "PERC H330 Mini", so rules that select OEM specific tooling must match on Subsystem.

Each rule supports the following fields:

  • Vendor - regular expression tested against the vendor ID and the vendor name.
  • Component - regular expression tested against the device ID, device name, class name and subclass name.
  • Subsystem - regular expression tested against the subsystem vendor ID, subsystem vendor name, subsystem device ID and subsystem name.
  • Class - regular expression tested against the PCI class code.
  • Driver - regular expression tested against the bound kernel driver.
  • Profile - Profile to add when the rule matches. Defaults to hw-comp-<key>.
  • Content - name of the content pack that provides tooling for the component itself. Recorded in inventory/components-data for downstream selection. This is not the OEM's chassis content pack: a Dell PERC is driven by the raid pack, while dell-support covers DSU and OMSA and is selected by chassis identity instead.
  • Description - human readable summary of the component.

All expressions are case insensitive and are evaluated with jq test. An expression over several values matches when it matches any one of them, so ^15b3$ matches the vendor ID and mellanox the vendor name. Omitted expressions are not tested; a rule with no expressions at all is skipped. A device must satisfy every expression in the rule to count as a match.

Matching on vendor and device names rather than IDs keeps rules readable and lets one rule cover a product family:

JSON
{
  "mellanox-nic": {
    "Vendor": "mellanox|^15b3$",
    "Component": "connectx",
    "Profile": "hw-comp-mellanox-nic",
    "Content": "mellanox-support"
  },
  "dell-perc": {
    "Class": "^0104",
    "Subsystem": "perc|^1028$",
    "Profile": "hw-comp-dell-perc",
    "Content": "raid"
  }
}

Rules are independent, so a Dell PERC matches both the generic raid-controller rule and the OEM specific dell-perc rule and both Profiles are applied. Both name the raid pack because that is where PERC tooling lives; what the OEM rule adds is the Profile, which restricts raid-usable-utilities to the drivers that work on a PERC.

Add site specific rules by layering a Profile that sets this Param.

Objects that Reference inventory/components

Objects used by inventory/components

Not used in current content packs