[systemd-devel] Why udev rule triggered for USB mice but not bluetooth mice
Mantas Mikulėnas
grawity at gmail.com
Mon Jan 2 06:09:58 UTC 2017
On Mon, Jan 2, 2017, 07:51 Andrei Borzenkov <arvidjaar at gmail.com> wrote:
> 02.01.2017 07:14, Weiwu Zhang пишет:
> > This is a user post cross-posted from
> > https://ubuntuforums.org/showthread.php?t=2348023
> >
> > Seems the question isn't mundane enough for Ubuntu forum - no one
> > followed; so if I can get some clues from here I will cross post back
> > the solution to Ubuntu Forums.
> >
> >
> > The bluetooth mouse's information:
> >
> > 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"
> >
> > looking at parent device
> '/devices/virtual/misc/uhid/0005:17EF:6060.0005':
> > KERNELS=="0005:17EF:6060.0005"
> > SUBSYSTEMS=="hid"
> > DRIVERS=="hid-generic"
> > ATTRS{country}=="00"
> >
> > looking at parent device '/devices/virtual/misc/uhid':
> > KERNELS=="uhid"
> > SUBSYSTEMS=="misc"
> > DRIVERS==""
> > The udev rules I tried:
> >
> > Code:
> >
> > $ cat /etc/udev/rules.d/lenovo.rules
> > KERNEL=="hidraw*", SUBSYSTEM=="hidraw",
> > ATTRS{uniq}=="D5:94:54:38:3D:5D", SYMLINK+="N700"
> > KERNEL=="hidraw*", SUBSYSTEM=="hidraw",
> > ATTRS{address}=="d5:94:54:38:3d:5d", SYMLINK+="N700"
> > 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?
Either way, SUBSYSTEMS=="input" seems redundant as well.
> --
Mantas Mikulėnas <grawity at gmail.com>
Sent from my phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170102/02c25e76/attachment.html>
More information about the systemd-devel
mailing list