]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: tag DMI id device with "systemd", so that we can order units after it
authorLennart Poettering <lennart@amutable.com>
Thu, 26 Feb 2026 10:24:21 +0000 (11:24 +0100)
committerLennart Poettering <lennart@amutable.com>
Fri, 20 Mar 2026 10:53:33 +0000 (11:53 +0100)
For various usecases it is useful to read relevant data from the DMI
udev device, but this means we need a way to wait for it for this to be
probed to be race-free. Hence tag it with "systemd", so that
sys-devices-virtual-dmi-id.device can be used as synchronization point.

rules.d/60-dmi-id.rules

index 10b1fe000ca18af47da8abf8c24341a6030593ad..ecea74ec60d1cbc78caea9ba17a0efc1e0330a95 100644 (file)
@@ -2,24 +2,28 @@
 
 ACTION=="remove", GOTO="dmi_end"
 SUBSYSTEM!="dmi", GOTO="dmi_end"
+KERNEL!="id", 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
+# 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
+# Stock keeping unit
 ENV{ID_PRODUCT_SKU_IS_RUBBISH}!="1", ENV{ID_SKU}="$attr{product_sku}"
 
-# hardware version
+# 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
+# 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}"
 
+# Allow units to be ordered after the DMI device
+TAG+="systemd"
+
 LABEL="dmi_end"