Files
systemd/rules.d/60-persistent-usb.rules
Matthias Klumpp e0b52606b7 udev: add hwdb lookup by USB interfaces
Several rules match ID_USB_INTERFACES directly to classify USB devices.
Add a `usb-interface` property to hwdb, looked up for each USB device,
so that such matches can live in the hwdb instead. The key also contains
vendor and product IDs, so that single devices can be matched.

We also add ID_LINK_DIR. When a hwdb entry sets it, the new
60-persistent-usb.rules creates by-id and by-path symlinks below
/dev/<ID_LINK_DIR>/, so a device class doesn't need its own rules file
for this.
2026-10-30 18:10:59 +01:00

14 lines
606 B
Plaintext

# do not edit this file, it will be overwritten on update
ACTION=="remove", GOTO="persistent_usb_end"
SUBSYSTEM!="usb", GOTO="persistent_usb_end"
ENV{DEVTYPE}!="usb_device", GOTO="persistent_usb_end"
ENV{ID_LINK_DIR}!="?*", GOTO="persistent_usb_end"
IMPORT{builtin}="path_id"
ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_LINK_DIR}/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
ENV{ID_PATH_WITH_USB_REVISION}=="?*", SYMLINK+="$env{ID_LINK_DIR}/by-path/$env{ID_PATH_WITH_USB_REVISION}"
ENV{ID_PATH_WITH_USB_REVISION}=="", ENV{ID_PATH}=="?*", SYMLINK+="$env{ID_LINK_DIR}/by-path/$env{ID_PATH}"
LABEL="persistent_usb_end"