Udev Rules

Bruce Dubbs bruce.dubbs at gmail.com
Sun Oct 12 20:51:47 PDT 2008

DJ Lucas wrote:

> http://thread.gmane.org/gmane.linux.hotplug.devel/12895

> Bottom line, it is still left to opinion for now.  However, I too am leaning 
> towards /lib/udev/rules.d myself for both rule sets.  Taken from the README:

>> Default udev rules, which are not supposed to be edited by the user, should
>> be placed in /lib/udev/rules.d/ now, to make it clear that they are 
>> private to the udev package and will be replaced with an update. Udev will 
>> pick up rule files from:

>> /lib/udev/rules.d/  - default installed rules /etc/udev/rules.d/  - user
>> rules + on-the-fly generated rules /dev/.udev/rules.d/ - temporary
>> non-persistent rules created after bootup

>> It does not matter in which directory a rule file lives, all files are 
>> sorted in lexical order.

> "Will be replaced with an update" is the kicker.

It is an interesting thread.  I don't think there was any agreement, but there
also is:

"Of course the world isn't as black as white as you paint it hence why udev will 
still read files from /etc/udev/rules.d so hackers, ppl building embedded 
systems and hobbyist users can override rules there."


"In fact, we should put

  # DO NOT EDIT. This is not a configuration file, see the udev man page for details

in the top of each udev rule. Then said man page can tell the user what
to do."

This has been done.

I don't know of any time the rules have been changed by upstream without 
changing the code though.  The issue of updates are far more important to 
commercial distros where the users may blindly do a rpm --upgrade or similar 

For LFS, it is still "Your distro, your rules"  Putting what appears to be 
configuration file sin /lib just tends to hide them to "protect" them from 
users.  Our role is to spread information on how a system is built so users can 
make changes more intelligently.

I'm not opposed to adding more verbiage to the udev section to caution users 
that upstream does not recommend changes.

There is another issue.  If udev rules were split into an upstream location in 
/lib and user modified rules in /etc, someone that wanted to make a legitimate 
change would probably have to review the rules in both locations anyway.

I say keep them in /etc.

   -- Bruce

More information about the lfs-dev mailing list