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

Weiwu Zhang a at colourful.land
Mon Jan 2 04:14:49 UTC 2017


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"

None of the three rules are tirggered, since evidently they are not
mentioned in syslog (when udev log-priority is set to 'debug') and no
/dev/N700 show up.

I repeated the test with a USB mouse, and everything worked - the rule
is mentioned in syslog, reported as returning successfully, and new
/dev symlink showed up. The rule that worked for USB mouse is:

SUBSYSTEM=="input", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d",
ATTRS{idProduct}=="c063", SYMLINK+="usbmouse"

I wish I can adapt the USB mouse's rule directly for the bluetooth,
but of course I can't because bluetooth device doesn't ahve
idVendor/idProduct, at least not in the output of `udevadmin info`

Using Ubuntu 16.10, Thanks!

P.S. My real intention is to disable touchpad when bluetooth mouse is
connected. I'm attempting a small task - creating a symlink - before
trying that deed.


More information about the systemd-devel mailing list