[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: udev sample
From: |
Daniele Forsi |
Subject: |
Re: udev sample |
Date: |
Mon, 18 Jan 2010 17:23:24 +0100 |
2010/1/10 Leo 'costela' Antunes:
> I've received a bug report concerning the DKU2 sample udev rules[0], but
> I unfortunately don't have any DKU2 device to test the proposed new rules.
the proposed rules are actually the older ones [1] with
SYSFS{idVendor} replaced by ATTRS{idVendor} and with
SYSFS{bDeviceClass} replaced by ATTRS{idProduct}, they aren't pratical
because they require to list each and every Nokia phone
> If it were possible to create a rule that was comprehensive enough, but
> not too broadly, it would probably be OK to install this rule by default.
the exact rule would be
ATTRS{manufacturer}=="Nokia", ATTR{bInterfaceClass}=="02",
ATTR{bInterfaceSubClass}=="fe"
(it is what cdc-phonet uses) however it matches a device without an
associated file so permissions are to be set to its parent device and
I don't know how to do that
for example, this is what the rule above matches:
$ udevadm info --query=property --path
/devices/pci0000:00/0000:00:0a.2/usb4/4-1/4-1:1.11
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:0a.2/usb4/4-1/4-1:1.11
DEVTYPE=usb_interface
DEVICE=/proc/bus/usb/004/004
PRODUCT=421/4b8/350
TYPE=2/0/0
INTERFACE=2/254/0
MODALIAS=usb:v0421p04B8d0350dc02dsc00dp00ic02iscFEip00
SUBSYSTEM=usb
but permissions are to be set for DEVNAME=/dev/bus/usb/004/004 from its parent:
$ udevadm info --query=property --path
/devices/pci0000:00/0000:00:0a.2/usb4/4-1/
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:0a.2/usb4/4-1
MAJOR=189
MINOR=387
DEVNAME=/dev/bus/usb/004/004
DEVTYPE=usb_device
DRIVER=usb
DEVICE=/proc/bus/usb/004/004
PRODUCT=421/4b8/350
TYPE=2/0/0
BUSNUM=004
DEVNUM=004
SUBSYSTEM=usb
ID_VENDOR=Nokia
ID_VENDOR_ENC=Nokia
ID_VENDOR_ID=0421
ID_MODEL=Nokia_5300
ID_MODEL_ENC=Nokia\x205300
ID_MODEL_ID=04b8
ID_REVISION=0350
ID_SERIAL=Nokia_Nokia_5300
ID_BUS=usb
ID_USB_INTERFACES=:020801:020201:0a0000:020b00:0202ff:02fe00:02fd00:
DEVLINKS=/dev/char/189:387
> I'm also not sure why the user reported the original rule didn't work
> for him. Possibly because ATTRS{manufacturer} wasn't "Nokia"?
yeah, possibly different kernel/udev versions
both the original rules and the proposed ones work for me with kernel
2.6.31-16-generic #53-Ubuntu and udev 147
We should probably use GROUP="dialout" like the default rules (at
least on Debian) use for tty|ircomm|rfcomm instead of GROUP="plugdev":
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*",
GROUP="dialout"
[0] bugs.debian.org/563547
[1]
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=04f501c5857894bde78336a818bd6fe75193eba3
--
Daniele Forsi