Dan Nicholson wrote:
On 12/29/05, Alexander E. Patrakov <[EMAIL PROTECTED]> wrote:

Andrew Benton wrote:

ka-long wrote:

But in udevs 25-lfs-rule file is:
KERNEL=="hd*", GROUP="disk"


But that's not the rule that makes the /dev/cdrom symlink. It's this
rule you need to look at

BUS=="ide", KERNEL=="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media",
RESULT="cdrom", NAME="%k", SYMLINK="cdrom"

Edit this rule by adding: GROUP="cdrom"


This seems like a good time to ask this question.  Warning: newbie
udev question follows.

Here's my rule I added to /etc/udev/rules.d/15-my.rules

BUS=="ide", KERNEL=="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media",
RESULT=="cdrom", NAME="%k", GROUP="optical", SYMLINK="cdrom%e"

My problem is that the later rule in 25-lfs.rules of

KERNEL=="hd*",                      GROUP="disk"

changed the ownership of /dev/hd* back to disk.  I circumvented it by
adding the above "hd*" rule before my BUS=="ide" rule in 15-my.rules
so that now it looks like this:

KERNEL=="hd*", GROUP="disk"
BUS=="ide", KERNEL=="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media",
RESULT=="cdrom", NAME="%k", GROUP="optical", SYMLINK="cdrom%e"

Question is, is this right?  In the original setup, is udev changing
the ownership because the first rule triggers on BUS and the second
rule triggers on KERNEL?  My understanding was that once a rule was
applied to a particular device that any following rules would be
ignored.


Not anymore. Try the extra option 'last_rule':

BUS=="ide", KERNEL=="hd[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT=="cdrom", OWNER="root", GROUP="optical", MODE="660", OPTIONS="last_rule"

-- DJ Lucas

--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to