LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   udev rule problem with 12.2 (http://www.linuxquestions.org/questions/slackware-14/udev-rule-problem-with-12-2-a-692974/)

conundrum07 12-25-2008 07:51 PM

udev rule problem with 12.2
 
I just finished upgrading to 12.2 and am having a problem with my custom udev rule. It's setup to create the mouse node at /dev/input/mx1000. The rule worked great under 12.1 but after the update to 12.2 the rule doesn't seem to be working. When I boot into X, the mouse doesn't work, and when I check /dev/input the mx1000 node is never created.

I have moved all of the 'new' config files over including rc.udev. The rule exists as /etc/udev/rules.d/10-local.rules. I saw in the CHANGES_AND_HINTS file that the rules folder moved, but from my understanding udev should still read the rules in /etc/udev/rules.d as well.

I know udev was updated to 135, so I suspected a syntax problem. I tried quite a few variations on the rule to see if I can get it to work, but so far I've had no luck.

If anyone has and ideas or can see a problem with my syntax let me know. Udev seems to be working ok - when I plug in a USB device it recognizes it and sets up the node. Im just not sure if the rule is incorrect or if udev isn't reading the rule file.

/etc/udev/rules.d/10-local.rules:
Code:

ACTION=="add", \
  KERNEL=="event*", \
  SUBSYSTEM=="input", \
  SYSFS{manufacturer}=="Logitech", \
  SYSFS{product}=="USB Receiver", \
  NAME="input/mx1000"

Mouse portion of /proc/bus/input/devices:
Code:

I: Bus=0003 Vendor=046d Product=c50e Version=0111
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:1d.1-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input25
U: Uniq=
H: Handlers=mouse1 event3
B: EV=20017
B: KEY=ffff0000 0 0 0 0 0 0 0 0
B: REL=143
B: MSC=10
B: LED=ff00

/var/log/messages when I insert the mouse dongle:
Code:

Dec 25 19:42:40 cloud kernel: usb 3-1: new low speed USB device using uhci_hcd and address 25
Dec 25 19:42:40 cloud kernel: usb 3-1: configuration #1 chosen from 1 choice
Dec 25 19:42:40 cloud kernel: input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input26
Dec 25 19:42:40 cloud kernel: input,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1d.1-1
Dec 25 19:42:40 cloud kernel: usb 3-1: New USB device found, idVendor=046d, idProduct=c50e
Dec 25 19:42:40 cloud kernel: usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Dec 25 19:42:40 cloud kernel: usb 3-1: Product: USB Receiver
Dec 25 19:42:40 cloud kernel: usb 3-1: Manufacturer: Logitech


rworkman 12-25-2008 08:42 PM

s/SYSFS/ATTR/g should fix it.

conundrum07 12-25-2008 09:08 PM

Thanks for the tip. I ran that against 10-local.rules which produced:

Code:

ACTION=="add", \
  KERNEL=="event*", \
  SUBSYSTEM=="input", \
  ATTR{manufacturer}=="Logitech", \
  ATTR{product}=="USB Receiver", \
  NAME="input/mx1000"

I went ahead and restarted udev and pulled the mouse dongle out and reinserted it. Still no dice. For good measure I did a full reboot but it still came up as input3.

Any other ideas?

rworkman 12-25-2008 09:54 PM

Show me output of this:
Code:

udevadm info --attribute-walk --name /dev/input/event3
(adjust if the actual node is different)

While I'm thinking about it, don't change the NAME of the node via udev -- instead, create a symlink to what the kernel names it.

conundrum07 12-25-2008 10:22 PM

Here is the output:

Code:

  looking at device '/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input3/event3':
    KERNEL=="event3"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/input/input3':
    KERNELS=="input3"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="Logitech USB Receiver"
    ATTRS{phys}=="usb-0000:00:1d.1-1/input0"
    ATTRS{uniq}==""
    ATTRS{modalias}=="input:b0003v046DpC50Ee0111-e0,1,2,4,11,k110,111,112,113,114,115,116,117,118,119,11A,11B,11C,11D,11E,11F,r0,1,6,8,am4,l8,9,A,B,C,D,E,sfw"

  looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0':
    KERNELS=="3-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bInterfaceProtocol}=="02"
    ATTRS{modalias}=="usb:v046DpC50Ed2500dc00dsc00dp00ic03isc01ip02"

  looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb3/3-1':
    KERNELS=="3-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bMaxPower}==" 70mA"
    ATTRS{urbnum}=="23980"
    ATTRS{idVendor}=="046d"
    ATTRS{idProduct}=="c50e"
    ATTRS{bcdDevice}=="2500"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{speed}=="1.5"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="2"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Logitech"
    ATTRS{product}=="USB Receiver"

  looking at parent device '/devices/pci0000:00/0000:00:1d.1/usb3':
    KERNELS=="usb3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="34"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="2"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.27.7-smp uhci_hcd"
    ATTRS{product}=="UHCI Host Controller"
    ATTRS{serial}=="0000:00:1d.1"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:1d.1':
    KERNELS=="0000:00:1d.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="uhci_hcd"
    ATTRS{vendor}=="0x8086"
    ATTRS{device}=="0x24d4"
    ATTRS{subsystem_vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x524c"
    ATTRS{class}=="0x0c0300"
    ATTRS{irq}=="19"
    ATTRS{local_cpus}=="ffffffff"
    ATTRS{local_cpulist}=="0-31"
    ATTRS{modalias}=="pci:v00008086d000024D4sv00008086sd0000524Cbc0Csc03i00"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

As far as the symlink, I replaced the "NAME=" line with SYMLINK+="input/mx1000". Upon restarting udev and pulling the dongle a symlink was created pointing to mouse1, however the link didnt work for my xorg.conf.

EDIT: At least now I know udev is matching the rule.

FWIW, I'm running the evdev driver:
Code:

  Identifier      "Mouse1"
  Driver          "evdev"
  Option          "CorePointer"
  Option            "Device" "/dev/input/mx1000"

lsmod shows the evdev module is loaded.

h8er 12-31-2008 06:30 PM

hi i have exactly the same problem here, from what i have understood the evdev driver needs a path to an event not to a device input node, i don't know why but with slackware 12.2 it's impossible to rename an event to a fixed name, i have tried a lot of rules and nothing works, i really don't have ideas on how to fix the problem :( a rule like this one should create a symlink to the mouse event but doesn't work

Code:

ACTION=="add", \
KERNEL=="event*", \
SUBSYSTEM=="input", \
DRIVER="", \
KERNELS="input*", \
SUBSYSTEMS="input", \
DRIVERS="", \
ATTRS{name}=="Logitech USB Receiver", \
NAME="%k", SYMLINK="input/mx1000"

to partially solve the problem in xorg.conf set the device to

Code:

Option            "Device" "/dev/input/EVENTNAME"
this works ok until the event name stays the same, then you have to reedit xorg.conf....

h8er 12-31-2008 07:21 PM

hahahahaha i have solved the problem, absolutely random stuff, i have recompiled the xorg evdev module with the latest version and the kernel to 2.6.27.10, then i have created this udev rule:

Code:

SUBSYSTEM=="input", \
ATTRS{manufacturer}=="Logitech", \
ATTRS{product}=="USB Receiver", \
NAME="mx1000", SYMLINK="mx1000_sym"

this one doesn't create a mx1000 device (i don't know why) but creates a symlink to the right event so in xorg.conf simply write

Code:

Option            "Device" "/dev/mx1000_sym"
this is the evdev tgz if you don't want to recompile it by yourself:

md5 hash: 63acf7c1dd6ba1113e13e9d4f66bbaa2

Code:

http://rapidshare.com/files/178603679/xf86-input-evdev-2.1.0-i486-1.tgz
hope it helps happy new year bye!

h8er 01-03-2009 09:13 AM

unfortunally the previous rule stopped working after few reboots, here there's a new one more correct (according to udev man page) that should work forever (i hope :P)

Code:

KERNEL=="event[0-9]*", \
SUBSYSTEMS=="usb", \
ATTRS{manufacturer}=="Logitech", \
ATTRS{product}=="USB Receiver", \
NAME="%k", SYMLINK="mx1000_sym"

bye

conundrum07 01-04-2009 12:04 PM

Excellent, thanks for the tips! Ill give them a shot.


All times are GMT -5. The time now is 08:21 PM.