[arch-general] udev rules policy

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Wed Apr 22 11:54:26 EDT 2009


Aaron Griffin wrote:
> On Wed, Apr 22, 2009 at 9:19 AM, Tobias Powalowski <t.powa at gmx.de> wrote:
>   
>> Am Mittwoch 22 April 2009 schrieb Damjan Georgievski:
>>     
>>> What is the policy for Udev rules in ArchLinux?
>>>
>>> There are 2 places where udev rules can be placed, /lib/udev/rules.d/
>>> and /etc/udev/rules.d/.
>>> Now, I think the /lib/ directory should be only for the rules coming
>>> from upstream udev, and the /etc/ directory is for rules coming from
>>> ArchLinux packages.
>>>
>>> If this is the policy everyone agrees on - and as far as I remember,
>>> udev devs recommends it too - maybe namcap can check that too?
>>>
>>> ps.
>>> the KVM package now has rules in /lib/ , so I'll open a bug report if
>>> that's not supposed to be like that.
>>>       
>> Normally udev rules should go to /lib that the user can override them with
>> /etc rule file.
>>     
>
> Yeah, I'm fairly certain this is the case - if you copy a rule file to
> /etc from /lib, you can make changes and it will use that one instead
> of /lib. In theory.
>
>   
Yep, this is on my todo list of proposal, also establishing some "rules"
against the prefix number to rules.

Package should put rules on /lib/udev/rules.d so as Aaron said when same
file exist in /etc/udev.d/rules.d
the file on /lib/udev/rules.d is ignored.

(a run of udevadm test .... shows this)
udev_rules_new: rule file basename
'/etc/udev/rules.d/NN-blah-blah.rules' already added, ignoring
'/lib/udev/rules.d/NN-blah-blah.rules'

For example in Debian there are some rules with numbers:

[quote="README"]
Files should be named xx-descriptive-name.rules, the xx should be
chosen first according to the following sequence points:

  00   rules that it is critical to be run first, usually
       only WAIT_FOR_SYSFS
  20   rules that change the name from the device from the default
       (cannot be overriden)
  40   rules that set the permissions of device nodes
       (can be overriden by later rules)
  60   rules that add symlinks to device nodes
       (adds to those set in earlier rules)
  80   rules that run programs (but do not load modules)
  90   rules that load modules
  99   rules that it is critical to be run last


This scheme has been chosen so that user-supplied rules are normally
named 50-*.rules for the right thing to happen.

Packages should chose the approriate sequence point and add 5 to it
(e.g. 25-iftab.rules, 45-libsane.rules, etc.) unless there is a need
for a particular order.
[/quote]

-- 
Gerardo Exequiel Pozzi ( djgera )
http://www.djgera.com.ar
KeyID: 0x1B8C330D
Key fingerprint = 0CAA D5D4 CD85 4434 A219  76ED 39AB 221B 1B8C 330D



More information about the arch-general mailing list