cosmetic udev glitches

Dan Nicholson dbn.lists at gmail.com
Tue Mar 2 14:47:22 PST 2010


On Tue, Mar 02, 2010 at 05:57:04PM +0100, Simon Thum wrote:
> Hi all,
> 
> I just upgraded my X to use udev. It generally went fine, but  I noticed
> two minor issues:
> 
> At first, the device names have quotation marks. As in
> 
> xinput list
> ...
> ⎜     "ImExPS/2 Logitech Wheel Mouse"           id=7    [slave  pointer
>  (2)]
> 
> I looked up the source, but found nothing obvious. Is this expected
> behavior?
> 
> Second, udev seems to add my mouse (and others) twice, resulting in some
> log spam. Excerpt:
> 
> [  5571.537] (II) config/udev: Adding input device "ImExPS/2 Logitech
> Wheel Mouse" (/dev/input/event3)
> (...)
> [  5571.538] (II) XINPUT: Adding extended input device ""ImExPS/2
> Logitech Wheel Mouse"" (type: MOUSE)
> [  5571.538] (II) "ImExPS/2 Logitech Wheel Mouse": initialized for
> relative axes.
> [  5571.538] (II) config/udev: Adding input device "ImExPS/2 Logitech
> Wheel Mouse" (/dev/input/mouse0)
> [  5571.538] (**) "ImExPS/2 Logitech Wheel Mouse": Applying InputClass
> "evdev catchall"
> [  5571.538] (**) "ImExPS/2 Logitech Wheel Mouse": always reports core
> events
> [  5571.538] (**) "ImExPS/2 Logitech Wheel Mouse": Device:
> "/dev/input/mouse0"
> [  5571.539] (EE) ioctl EVIOCGNAME failed: Inappropriate ioctl for device
> [  5571.539] (II) UnloadModule: "evdev"
> [  5571.539] (EE) PreInit returned NULL for ""ImExPS/2 Logitech Wheel
> Mouse""
> 
> 
> Things work fine here, I just wanted to make sure whether my
> configuration is broken or these are known issues.
> 
> In case it helps, I did:
> udevadm info --attribute-walk --name /dev/input/mouse0
> 
> Udevadm info starts with the device specified by the devpath and then
> walks up the chain of parent devices. It prints for every device
> found, all possible attributes in the udev rules key format.
> A rule to match, can be composed by the attributes of the device
> and the attributes from one single parent device.
> 
>   looking at device '/devices/platform/i8042/serio1/input/input3/mouse0':
>     KERNEL=="mouse0"
>     SUBSYSTEM=="input"
>     DRIVER==""
> 
>   looking at parent device '/devices/platform/i8042/serio1/input/input3':
>     KERNELS=="input3"
>     SUBSYSTEMS=="input"
>     DRIVERS==""
>     ATTRS{name}=="ImExPS/2 Logitech Wheel Mouse"
>     ATTRS{phys}=="isa0060/serio1/input0"
>     ATTRS{uniq}==""

Can you try the patch below that uses the name attribute instead of the
value from the uevent? I ran it through a little test app, but not in X.

Dan

>From c01a4e6dce7196a60b5247dde78054b27e004494 Mon Sep 17 00:00:00 2001
From: Dan Nicholson <dbn.lists at gmail.com>
Date: Tue, 2 Mar 2010 14:42:22 -0800
Subject: [PATCH] config/udev: Get product name from attribute instead of uevent

The input device product name in the kernel uevent has embedded quotes
that aren't expected here. Use the sysfs name attribute instead, which
does not suffer this problem.

Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
---
 config/udev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/config/udev.c b/config/udev.c
index 69257e9..54306ef 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -74,7 +74,7 @@ device_added(struct udev_device *udev_device)
 
     parent = udev_device_get_parent(udev_device);
     if (parent)
-        name = udev_device_get_property_value(parent, "NAME");
+        name = udev_device_get_sysattr_value(parent, "name");
     if (!name)
         name = "(unnamed)";
     else
-- 
1.6.6.1



More information about the xorg mailing list