[systemd-devel] Why udev rule triggered for USB mice but not bluetooth mice

Andrei Borzenkov arvidjaar at gmail.com
Mon Jan 2 06:13:52 UTC 2017


02.01.2017 09:09, Mantas Mikulėnas пишет:
...
>>> Code:
>>> $ udevadm info -a -p `udevadm info -q path /dev/input/mouse3`
>>>
>>>   looking at device
>>> '/devices/virtual/misc/uhid/0005:17EF:6060.0005/input/input26/mouse3':
>>>     KERNEL=="mouse3"
>>>     SUBSYSTEM=="input"
>>>     DRIVER==""
>>>
>>>   looking at parent device
>>> '/devices/virtual/misc/uhid/0005:17EF:6060.0005/input/input26':
>>>     KERNELS=="input26"
>>>     SUBSYSTEMS=="input"
>>>     DRIVERS==""
>>>     ATTRS{name}=="Lenovo Mice N700"
>>>     ATTRS{phys}=="B8:8A:60:56:E4:3C"
>>>     ATTRS{properties}=="0"
>>>     ATTRS{uniq}=="D5:94:54:38:3D:5D"
>>>
...
>>> SUBSYSTEM=="input", SUBSYSTEMS=="input", SUBSYSTEMS=="hid",
>>> ATTRS{name}=="Lenovo Mice N700", SYMLINK+="N700"
>>>
>>
>> All keys that match against parent nodes must match for the same parent
>> (this is even documented). Also I /think/ that in case of multiple
>> SUBSYSTEMS the last one wins. In this case your ATTRS{name} will match
>> one parent, and SUBSYSTEMS=="hid" - another. Try leaving only
>> SUBSYSTEMS=="input".
>>
> 
> That's a surprising limitation... I guess one could copy attributes to ENV
> to get around it?
> 

It came here more than once, and yes, it is not obvious even though it
is documented. Probably, some examples in manual page to stress this
would be good.

> Either way, SUBSYSTEMS=="input" seems redundant as well.
> 

Yes, in this case it looks like it is.


More information about the systemd-devel mailing list