Skip to contentSkip to conversation

renaming causes incorrect device creation

DISCUSSION xsdg 2 participants 3 messages Mar 17, 2004

lore
Share & tools
lore

xsdg

author
#0 lore raw

Normally, when I plug in my camera, I see (in /udev/):

brw-------    1 root     root       8,   0 2004-03-17 01:53 sda
brw-------    1 root     root       8,   1 2004-03-17 01:53 sda1

I then add to udev.rules:
BUS=3D"scsi", SYSFS{model}=3D"Sony DSC ", NAME=3D"removable/camera%n"

after adding, I see:

brw-------    1 root     root       8,   0 2004-03-17 01:55 camera
crw-------    1 root     root      21,   1 2004-03-17 01:55 camera1

I'm starting off with the default installed udev.rules. This also occurs when I try to get my key drive going with:

BUS=3D"scsi", SYSFS{vendor}=3D"LEXAR ", SYSFS{model}=3D"JUMPDRIVE PRO ", NAME=3D"removable/jdrive%n"

brw-------    1 root     root       8,  16 2004-03-17 01:31 jdrive
crw-------    1 root     root      21,   2 2004-03-17 01:31 jdrive2

Also note that jdrive2 should not exist; only disc and generic exist in devfs, and I set the drive up _without_ partitioning (mkfs.vfat /udev/sda)

Signature · 3 lines
| If you have to do something wrong to get what you |
|   want, it's really not worth having.             |
) http://www.cuodan.net/~xsdg/    [email protected] (
#1 lore raw
Quoted 7 lines · xsdg

Normally, when I plug in my camera, I see (in /udev/):

brw-------    1 root     root       8,   0 2004-03-17 01:53 sda brw-------    1 root     root       8,   1 2004-03-17 01:53 sda1

I then add to udev.rules:
BUS="scsi", SYSFS{model}="Sony DSC        ", NAME="removable/camera%n"

I used the following rule successfully...

# USB storage of Sony DSC-31 camera
BUS="usb", SYSFS{product}="Sony DSC" NAME="%k" SYMLINK="camera"

...until I built the "generic devices" module, and found that char device sg2 was being assigned to the camera. So I changed the rule and it works again:

# USB storage of Sony DSC-31 camera
BUS="usb", KERNEL="sd*", SYSFS{product}="Sony DSC" NAME="%k" SYMLINK="camera"

OT: The script I use to download from the camera is attached.

#2 lore raw
In reply to xsdg
Quoted 2 lines · Bob Barry

So I changed the rule and it works again:
BUS="usb", KERNEL="sd*", SYSFS{product}="Sony DSC" NAME="%k" SYMLINK="camera"

That still wasn't really right. Using udevtest in a loop for all "udevinfo -d" devices showed that the camera symlink was being created twice (for sda and sda1) with the last one prevailing. Without the "KERNEL" qualification, it was getting created three times, and sg2 prevailed. Changing the "KERNEL" qualification to "sd??" eliminates spurious symlink creation:

BUS="usb", KERNEL="sd??", SYSFS{product}="Sony DSC" NAME="%k" SYMLINK="camera"

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel