[vox-tech] udev - any good howtos? experience?

Ken Bloom kbloom at gmail.com
Tue Sep 27 12:31:31 PDT 2005


On Tue, Sep 27, 2005 at 11:04:18AM -0700, Bill Kendrick wrote:
> I've got numerous USB-connected devices nowadays:
> 
>   * External hard drive enclosure
>   * Compact Flash memory card reader
>   * USB memory stick thumb pen flash drive key
>   * Sharp Zaurus cradle
>   * Digital Camera
>   * Stelladaptor (connect Atari joystick to PC)
> 
> The top 3 are USB mass storage devices.  Unfortunately, which "/dev/sdX" device
> they get appears to depend on how they're activated.  If I plug in the USB
> memory stick thing before turning on the HDD enclosure, it comes out as
> /dev/sda.  If I turn on the drive before plugging in the USB stick, it gets
> /dev/sdb, instead.
> 
> Briefly Googling around, I discovered something I hadn't heard of before,
> called "udev".  Apparently it allows devices to be assigned to specific
> locations (somewhere in '/udev') based on the device's name.
> (That way, icons on my desktop and/or mount points like /media/card0 and
> /media/keychain0, would always point to the right place.)
> 
> I installed it via 'aptitdue' but didn't have time to get it working,
> and had to reboot at some point.  I got a nice red warning message
> during boot that 'udev' isn't supported with the older 2.6.x kernel I'm
> using.
> 
> Oh well.  In the meantime, while I wait for Debian/etch to upgrade
> (or if I decide to build my own kernel :^) ), is there a good HOWTO on
> using udev that anyone can recommend?  I remember someone here (Jeff?)
> mentioning they use it.  Is it working nicely for you? :)

I use it -- it works great. Debian's default is to mount it over /dev,
so that it does kind of what devfs used to do. In addition to the default rules (which
create all of the usual device nodes) I have the following two
additional rules to name a couple of my devices:

KERNEL="sd?1",SYSFS{model}="ACEMAR          ",SYSFS{vendor}="IDIGAT L",SYMLINK="camera"
BUS="usb" SYSFS{product}="Palm Handheld*" KERNEL="ttyUSB*" SYMLINK="pilot" MODE="666" 

the second one I copied off the internet
the first one I wrote myself, taking advantage of udevinfo to tell me
some of the useful values.

To find information about the device that is currently connected to
/dev/hda1, do the following:

[bloom at little-cat-a ~]$ udevinfo -q path -n /dev/hda1 
/block/hda/hda1
[bloom at little-cat-a ~]$ udevinfo -a -p /block/hda/hda1 

Then you can take values from the output of udevinfo *from only one
level of the device chain* for the SYSFS{} attributes, and with
judicious use of KERNEL= you can choose which level of the device
chain to create the node or symlink for.

Note that jpilot doesn't take too kindly to the pilot symlink only
appearing when I hit the hotsync button, but it wouldn't take too
kindly to it even if the device node was always around. I resolved
this by switching to kpilot with korganizer and kaddressbook, which
are actually a whole lot nicer than jpilot.

--Ken Bloom

-- 
I usually have a GPG digital signature included as an attachment.
See http://www.gnupg.org/ for info about these digital signatures.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://ns1.livepenguin.com/pipermail/vox-tech/attachments/20050927/43cb4d72/attachment.pgp


More information about the vox-tech mailing list