mirror of
https://github.com/systemd/systemd.git
synced 2025-09-10 22:52:49 +02:00
Add support for the hardware version. The version describes a distinct version of compatibility hardware. The value is read from the file /etc/machine-info or DMI as fallback. The integration provides an unified interface to collect detail hardware information. The /etc/machine-info entry enables embedded devices without UEFI support to read the information from a custom store.
26 lines
1.2 KiB
Plaintext
26 lines
1.2 KiB
Plaintext
# do not edit this file, it will be overwritten on update
|
|
|
|
ACTION=="remove", GOTO="dmi_end"
|
|
SUBSYSTEM!="dmi", GOTO="dmi_end"
|
|
|
|
ENV{ID_SYS_VENDOR_IS_RUBBISH}!="1", ENV{ID_VENDOR}="$attr{sys_vendor}"
|
|
ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="", ENV{ID_PRODUCT_NAME_IS_RUBBISH}!="1", ENV{ID_MODEL}="$attr{product_name}"
|
|
ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="product_name", ENV{ID_MODEL}="$attr{product_name}"
|
|
ENV{ID_SYSFS_ATTRIBUTE_MODEL}=="product_version", ENV{ID_MODEL}="$attr{product_version}"
|
|
# fallback to board information
|
|
ENV{ID_VENDOR}=="", ENV{ID_VENDOR}="$attr{board_vendor}"
|
|
ENV{ID_MODEL}=="", ENV{ID_MODEL}="$attr{board_name}"
|
|
|
|
# stock keeping unit
|
|
ENV{ID_PRODUCT_SKU_IS_RUBBISH}!="1", ENV{ID_SKU}="$attr{product_sku}"
|
|
|
|
# hardware version
|
|
ENV{ID_PRODUCT_VERSION_IS_RUBBISH}!="1", ENV{ID_HARDWARE_VERSION}="$attr{product_version}"
|
|
ENV{ID_HARDWARE_VERSION}=="", ENV{ID_BOARD_VERSION_IS_RUBBISH}!="1", ENV{ID_HARDWARE_VERSION}="$attr{board_version}"
|
|
|
|
# chassis asset tag
|
|
ENV{MODALIAS}!="", ATTR{chassis_asset_tag}!="", IMPORT{builtin}="hwdb '$attr{modalias}cat$attr{chassis_asset_tag}:'"
|
|
ENV{ID_CHASSIS_ASSET_TAG_IS_RUBBISH}!="1", ENV{ID_CHASSIS_ASSET_TAG}="$attr{chassis_asset_tag}"
|
|
|
|
LABEL="dmi_end"
|