UDEV Rules Didn't Behave Like I Thought

Dan Nicholson dbn.lists at gmail.com
Tue Mar 7 11:49:26 PST 2006


On 3/7/06, Dan McGhee <beesnees at grm.net> wrote:
> My original set up were lines in /etc/udev/rules.d.  Here are
> the relevant parts:
>
> /etc/udev/rules.d/24-dvd.rules
> KERNEL="hdc", SYMLINK="dvd"

I'm not the expert here, but I think you need SYMLINK+=dvd.  Then,
udev will retain this in it's memory until later when it finds the
BUS=="ide" rule that tells it how to actually create the device nodes.
 I'm pretty sure if you read the how-to-write-udev-rules.html doc that
came with udev, it says that if you want multiple symlinks, you need
to use +=.

This is my setup which I tailored after reading that doc.  I use
GROUP:= so that it retains the group I give even when the later
KERNEL=="hd*", GROUP="disk" would override it otherwise.  I have both
generic and persistent symlinks (although, Alexander says that using
%e in the first rule is discouraged).  I have two drives, hdc and hdd,
one is a CD-RW, and one is a DVD-RW.

--
Dan

# /etc/udev/rules.d/15-my.rules: Rule definitions for my system.

# Create the /dev/cdrom* symlinks.
BUS=="ide", KERNEL=="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media",
RESULT=="cdrom", NAME="%k", GROUP:="optical", SYMLINK+="cdrom%e"
BUS=="ide", KERNEL=="hd[a-z]", PROGRAM="/bin/grep '^PLEXTOR' /proc/ide/%k/model"
, SYMLINK+="cdrw"
BUS=="ide", KERNEL=="hd[a-z]", PROGRAM="/bin/grep '^PIONEER' /proc/ide/%k/model"
, SYMLINK+="dvd"
BUS=="ide", KERNEL=="hd[a-z]", PROGRAM="/bin/grep '^PIONEER' /proc/ide/%k/model"
, SYMLINK+="dvdrw"
#KERNEL="hdd", SYMLINK+="dvd"

# Create the printer node
BUS=="usb", SYSFS{product}=="DeskJet 810C", SYMLINK+="printer/deskjet810c"

# Create the camera node
BUS=="usb", SYSFS{product}=="Canon Digital Camera", SYMLINK+="camera/canon"



More information about the blfs-support mailing list