[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hotplug, udev and usbkey question



John L Fjellstad wrote:
 > Your rule would be something like this (one line):
BUS="usb", SYSFS{manufacturer}="IBM", SYSFS{product}="USB 2.0 Memory
Key", NAME="usbkey%n", GROUP="disk", MODE="0660"

The %n in the NAME rule is so that if you have two or more usbkeys in
the system, the first gets the name usbkey1, the next usbkey2 etc (even
with just one, I think you would get usbkey1).  Note that the system
will create a usbkey, which is similar to sda for scsi harddisk.

You can make it even more specific (for instance, you want to create a
special node for this specific usbkey) by adding more SYSFS attributes,
for instance the serial, which is specific to each USB device.

Save the rules in /etc/udev/rules.d/00usbkey.rules

The number 00 is important, because you want udev to read your rule
before the default rules (it's a first come, permanent set).  You are
also required to have the .rules extension to all your rules, and it
must be in /etc/udev/rules.d (or wherever the udev_rules variable is set
in /etc/udev/udev.conf


John,
in my country we call people like you "wells of science". I really admire your knowledge.

Reading this I think I now understand better what the cryptic docs did not manage to explain :)

But I still have a problem. The /dev/usbkey device is still not created.

Reading your very good explanation I also believe it should already have since I also had the following (0644 root.root):

bob@t40:/etc/udev/rules.d$ cat 10-local.rules
BUS="usb", KERNEL="sd?1", SYSFS{serial}="0206430D0A001CBC", NAME="usbkey"

syslog only shows the creation of the sda* devices from /etc/udev/rules.d/z_hal-plugdev.rules

Any other things to look at ?

Thank you veyr much again,
Bob






Reply to: