Mailinglist Archive: opensuse (1698 mails)

< Previous Next >
Re: [opensuse] USB, udev and serial numbers
  • From: Roger Oberholtzer <roger@xxxxxx>
  • Date: Wed, 14 Dec 2011 15:00:39 +0100
  • Message-id: <1323871239.14878.36.camel@acme.pacific>
On Wed, 2011-12-14 at 14:38 +0100, Lars Müller wrote:
On Wed, Dec 14, 2011 at 02:25:59PM +0100, Roger Oberholtzer wrote:
[ 8< ]
The serial number is different for each converter. So it seems like the
value to use.

I have made a udev rule that should make a symlink to the device, and
relax the permissions:

BUS=="usb", SYSFS{iSerial}=="A7004luX", MODE="0666", SYMLINK+="usbp2",
OWNER="rst", GROUP="users"

After reloading the rules (udevadm control --reload-rules), I would like
to see the symlink created when I plug in the device. Unfortunately,
that is not the case.

For another device, I use SYSFS{idVendor} to determine the vendor.
iSerial seems to be in the same group of variables. Perhaps it is not
and only the lsusb listing makes it appear so.

A google of 'udev iSerial' returned nothing a all. How odd.

Maybe this recent thread in German helps
http://lists.opensuse.org/opensuse-de/2011-12/msg00120.html

It looked like what was different was they used ATTRS() instead of
SYSFS(). That did not make a difference.

BUS=="usb", ATTRS{iSerial}=="A7004luX", MODE="0666", SYMLINK+="usbp1",
OWNER="rst", GROUP="users"

The part of udev that has always confused me is knowing which category
an item is in.

When I run udevadm, I see this when I plug in the device:

UDEV [1323874499.445208] add
/devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0/ttyUSB0/tty/ttyUSB0 (tty)
UDEV_LOG=3
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb6/6-2/6-2:1.0/ttyUSB0/tty/ttyUSB0
SUBSYSTEM=tty
DEVNAME=/dev/ttyUSB0
SEQNUM=1408
ID_PORT=0
ID_PATH=pci-0000:00:1d.0-usb-0:2:1.0
ID_VENDOR=FTDI
ID_VENDOR_ENC=FTDI
ID_VENDOR_ID=0403
ID_MODEL=FT232R_USB_UART
ID_MODEL_ENC=FT232R\x20USB\x20UART
ID_MODEL_ID=6001
ID_REVISION=0600
ID_SERIAL=FTDI_FT232R_USB_UART_A7004luX
ID_SERIAL_SHORT=A7004luX
ID_TYPE=generic
ID_BUS=usb
ID_USB_INTERFACES=:ffffff:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=ftdi_sio
ID_IFACE=00
ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
ID_MODEL_FROM_DATABASE=FT232 USB-Serial (UART) IC
MAJOR=188
MINOR=0

Since I see other udev rules with ENV{ID_USB_INTERFACES} and the like, I
also tried ENV{ID_SERIAL_SHORT}=="A7004luX". No go.

It is not just that the symlink does not show up where expected. I think
the rule is not triggering. When a rule does trigger, a line like this
gets printed by udevadm:

DEVLINKS=/dev/char/188:0 /dev/serial/by-path/pci-0000:00:1d.0-usb-0:2:1.0-port0
/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A7004luX-if00-port0 /dev/mylink

The symlink one requested is shown. In my case, the name is not shown.
The rule is not triggering or completing successfully.



I forgot to mention that this in for openSUSE 11.2

Yours sincerely,

Roger Oberholtzer

OPQ Systems / Ramböll RST

Office: Int +46 10-615 60 20
Mobile: Int +46 70-815 1696
roger.oberholtzer@xxxxxxxxxx
________________________________________

Ramböll Sverige AB
Krukmakargatan 21
P.O. Box 17009
SE-104 62 Stockholm, Sweden
www.rambollrst.se


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups