On Tuesday 03 October 2006 16:44, Snarkout wrote:
> SUBSYSTEMS=="scsi", ATTRS{vendor}=="Apple", KERNEL=="sd?2",
> ATTRS{model}=="iPod*", NAME="%k", SYMLINK+="ipod", GROUP="ipod"
>
> Can anyone see a reason the group would be ignored here?
> I've named this rule so that it's first, and so that it's last
> (10-ipod.rule and 99.ipod.rule) and this doesn't make any difference. I've
> also used a differnt grop, for kicks - nothing. In every case, the node is
> created, but it's root:root, not root:ipod. Anyone know what I'm doing
> wrong?
I can't see anything wrong, assuming that you have already created the "ipod"
group, but then again you could try debugging with udevmonitor and emulating
an "add" action with udevtest to see what part gets executed and what not.
> Barring a fix, I'm also having trouble with the new scheme - I've looked at
> the kernel.org docs, and they don't seem to have changed much, if at all. I
> notice the use "SUBSYSTEM" not SUBSYSTEMS" though. Our own wiki includes
> what appear to be conflicting info on a few of the lines. The how-to in
> /etc uses ATTR as well as ATTRS in places. Can somone point me to the
> definitive how-to for The New Way?
By having a look at the udev manpage, it turns out that both forms
(SUBSYSTEM - SUBSYSTEMS and ATTR - ATTRS respectively) are valid. There is a
sublte difference though: the singular form refers to the device itself,
whereas the plural form scans the devpath from the specified device
downside-up for a matching entry.
Unfortunately I don't have my iPod at hand to verify that this is indeed the
case, but I hope this example will help you get the picture. In your
particular example, sd?2 is a disk partition and might as such not have a
model ID of its own. So, if you specified ATTR{model}="iPod", the rule
wouldn't match. Instead, you specify ATTRS{model}, so udev looks at sd?2
itself first, and if it doesn't find a "model"-attribute or if it finds one
different than "iPod", it scans the parent device etc. In this case the
parent device is the iPod itself, which has a model id equal to "iPod", and
so the rule matches.
The same goes obviously for the subsystems. sd?2 is a child to the scsi
subsystem, but the iPod itself is a USB device. As far as i understand
(please correct me if I'm wrong), specifying SUBSYSTEM=="usb" wouldn't match
the partition, whereas SUBSYSTEMS=="usb" would.
Cheers,
Apollon
_______________________________________________
arch mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/arch