Re: udev: how to do it right?
Antonio Rodriguez <arodriguez31@cfl.rr.com> writes:
> hpd:/home/tony# ls /usr/local/bin/lsbus
> ls: /usr/local/bin/lsbus: No such file or directory
> hpd:/home/tony# ls /usr/local/bin/systool
> ls: /usr/local/bin/systool: No such file or directory
Debian packages will never install stuff in /usr/local/bin. If any
documentation mentions /usr/local, then it's presumed that you have
compiled by hand. Otherwise, the binaries will always be in /usr/bin.
I looked through the documentation mentioned, and it makes some mistakes
(mostly stuff that has been deprecated in never udev).
For instance, memorystick isn't necessary a scsi device. At my place,
it's a USB device:
Device = "3-1"
Device path = "/sys/devices/pci0000:00/0000:00:1d.2/usb3/3-1"
bConfigurationValue = "1"
bDeviceClass = "00"
bDeviceProtocol = "00"
bDeviceSubClass = "00"
bMaxPower = "200mA"
bNumConfigurations = "1"
bNumInterfaces = " 1"
bcdDevice = "0140"
bmAttributes = "c0"
detach_state = "0"
idProduct = "0069"
idVendor = "054c"
manufacturer = "Sony"
product = "USB Memory Stick Slot"
speed = "12"
The udev rule I would create for this would be
BUS="usb", SYSFS{manufacturer}="Sony", SYSFS{product}="USB Memory Stick\
Slot", NAME{all_partitions}="Memstick"
Note that the format has changed a little (the old format is deprecated,
and was totally removed starting with version 023).
Also, note the {all_partitions} attribute in NAME. There was a problem
with the node (ie memstick1) not beging created unless it is accessed,
but it can't be accessed without being created. So, the all_partitions
attribute was created to statically create the nodes.
--
John L. Fjellstad
web: http://www.fjellstad.org/ Quis custodiet ipsos custodes
Reply to: