how-to debug udev
I want to use udev to give specific names to two mice.
My system runs Ubuntu 12.10 and I have an old system running Ubuntu 10.04 which is already doing this (so I am using it as a reference). /etc/udev/rules.d/90-wally.rules contains: KERNEL=="event[0-9]*", ATTR{idVendor}=="047d", ATTR{idProduct}=="1020", MODE="0664", GROUP="plugdev", NAME="input/trackBallBig" KERNEL=="event[0-9]*", ATTR{idVendor}=="047d", ATTR{idProduct}=="1022", MODE="0664", GROUP="plugdev", NAME="input/trackBallSmall" lsusb shows: Bus 001 Device 005: ID 047d:1022 Kensington Orbit Optical Bus 001 Device 006: ID 047d:1020 Kensington Expert Mouse Trackball ls -l /dev/input shows (relevant parts): crw-r----- 1 root root 13, 32 Jan 4 17:10 mouse0 crw-r----- 1 root root 13, 33 Jan 4 17:10 mouse1 crw-r----- 1 root root 13, 34 Jan 4 17:10 mouse2 Looking at the 10.04 machine, ls -l /dev/input shows (relevant parts): crw-r----- 1 root root 13, 32 2012-11-28 16:44 mouse0 crw-r----- 1 root root 13, 33 2012-12-15 10:51 mouse1 crw-r----- 1 root root 13, 34 2012-11-28 16:44 mouse2 crw-rw-r-- 1 root plugdev 13, 68 2012-11-28 16:44 trackBallBig crw-rw-r-- 1 root plugdev 13, 67 2012-12-15 10:51 trackBallSmall I have confirmed that udev daemon is running and that the group plugdev exists. I don't find any errors in syslog. Earlier I had some errors, but then discovered that "SYSFS" keyword in rules file needs to be "ATTR". In /var/log/udev I find no references to "trackBall*", whereas on the 10.04 machine, I see "DEVNAME=/dev/input/trackBallSmall". I am stuck for what to do to debug this. Are my rules incorrect for what I want to do? I have read the udev tutorial http://ubuntuforums.org/showthread.php?t=168221 but need additional help. thanks |
You can use "udevadm" command to help. For example this command show what kernel sees and which udev rules was triggered after connecting device
Code:
udevadm monitor --kernel --udev |
thanks, the following rules (from /etc/udev/rules.d/90-trackball.config) worked.
#try this based on output of "udevadm monitor --kernel --udev --property" # 01/15/13 THIS WORKS the devices themselves are in plugdev group with crw-rw-r-- perms # BEST SET OF RULES SO FAR. DO NOT DELETE. #SUBSYSTEM=="usb", ATTR{product}=="Kensington Expert Mouse", MODE="0664", GROUP="plugdev", SYMLINK+="input/trackBallBig" #SUBSYSTEM=="usb", ATTR{product}=="Kensington USB/PS2 Orbit", MODE="0664", GROUP="plugdev", SYMLINK+="input/trackBallSmall" #tried this just to see and IT WORKS. This is better than the best because there are no symlinks SUBSYSTEM=="usb", ATTR{product}=="Kensington Expert Mouse", MODE="0664", GROUP="plugdev", NAME="input/trackBallBig" SUBSYSTEM=="usb", ATTR{product}=="Kensington USB/PS2 Orbit", MODE="0664", GROUP="plugdev", NAME="input/trackBallSmall" |
All times are GMT -5. The time now is 09:37 AM. |