sm-discuss AT lists.ibiblio.org
Subject: Public SourceMage Discussion List
List archive
- From: Arwed von Merkatz <v.merkatz AT gmx.net>
- To: sm-discuss <sm-discuss AT lists.ibiblio.org>
- Subject: Re: [SM-Discuss] GVM works :)
- Date: Tue, 1 Nov 2005 08:52:23 +0100
On Tue, Oct 18, 2005 at 10:36:57PM +0200, Flavien Bridault wrote:
[...]
> > > Correct. :-)
> > > That's exactly why we switch from a single rules file to a directory of
> > > rules file. Users should have defined their own rules in a file read
> > > *after* 50-default.rules, so something like 90-mysetup.rules, as
> > > explained in /etc/udev/rules.d/README :
> > >
> > > "The files which name ends in ".rules" will be read by udev in lexical
> > > order.
> > > Any others will be ignored.
> > > There are some example rules in rules.examples, take a look at those for
> > > an idea of what's possible with udev.
> > >
> > > When a rule matches in one file, a different rule in another file will
> > > be
> > > ignored, so be sure to name your own files properly.
> >
> > So 50-default will match before 90-mysetup and so anything duplicated
> > in 90-mysetup will be ignored?
> >
> Well that was what I thought when I read this, but in practice this
> seems to be the inverse !
> For example, for cdrtools rules, I first named the file
> 10-cdrtools.rules, but when I added the new rules, I noticed that only
> those from 50-default.rules were applied, i.e. the cd recorder belonged
> to cdrom group and not to burning group. I was quite surprised that it
> works when I renamed 10-cdrtools to 80-cdrtools. Unless I misunderstood
> something ?
> You're right to highlight that point, I would be interested that someone
> confirm what I just told, and then I should update the README. (And I
> should have read it completely before pasted it ;-) )
Rules files are read in lexical order, so 10-cdrtools.rules would be
applied before 50-default.rules. What's making this a little more
complicated to figure out is that an existing udev rule for a device
does _not_ stop other rules for that device to be used. So if you have
two rules setting up permissions for /dev/cdrom, one in each of those
files the one in 50-default.rules will override the one in
10-cdrtools.rules. There are two exceptions to this rule. The first is
the NAME assignment, only the first assignment like that is used, all
later ones are ignored. The second is when you make a rule explicitly
the last one for this device by using OPTIONS=last_rule.
So basically when you want to override what name a device gets (real
name, not symlink), you should use something like 00-mine.rules; if you
want to change permissions or add symlinks you should use 99-mine.rules;
if you want to completely ignore the smgl rules for a device you should
put it in 00-mine.rules with OPTIONS=last_rule
Did that make it a bit clearer? :)
--
Arwed v. Merkatz Source Mage GNU/Linux developer
http://www.sourcemage.org
-
Re: [SM-Discuss] GVM works :),
Arwed von Merkatz, 11/01/2005
- Re: [SM-Discuss] GVM works :), Flavien Bridault, 11/01/2005
Archive powered by MHonArc 2.6.24.