| |
---|
| | |
---|
| | ``udev`` is one of those pieces of ``Linux`` that is fairly well |
---|
| | documented and not very well understood. This note isn't intended as |
---|
| | a general introduction to writing ``udev`` rules, but, rather, a brief |
---|
| | introduction to the topic by way of specific example. |
---|
| | |
---|
| | .. NOTE:: The examples and descriptions below assume you |
---|
| | are running as ``root``. Most of the commands |
---|
| | described will either return nothing or will not |
---|
| | work at all unless you are ``root``. |
---|
| | introduction to the topic by way of specific example. Most tutorials |
---|
| | on this subject only provide you with templates along the lines of |
---|
| | "Here's how to do <fill in the blank> with udev." The approach here |
---|
| | is more about "here's why rules work the way they do". Hopefully, |
---|
| | you'll find it useful. |
---|
| | |
---|
| | |
---|
| | .. WARNING:: The examples and descriptions below assume you are |
---|
| | running as ``root``. Most of the commands described |
---|
| | will either return nothing or will not work at all |
---|
| | unless you are ``root``. |
---|
| | |
---|
| | Because you are ``root`` and are making device-level |
---|
| | changes, you can wholly and completely Bugger Up your |
---|
| | machine (it took me 6 years of graduate school to learn |
---|
| | to use that term like a Real Computer Scientist (tm)). |
---|
| | |
---|
| | So ... do the smart thing. Don't practice this stuff |
---|
| | on machines that matter. Better still, spin up some |
---|
| | VMs and play with it there. |
---|
| | |
---|
| | You have been warned. We do provide tech support for |
---|
| | this stuff. For ordinary work we charge the usual |
---|
| | rates. For fixing things you screwed up, $10,000/hour |
---|
| | ... prepaid. |
---|
| | |
---|
| | |
---|
| | |
---|
| | Why Bother With ``udev``? |
---|
| | ========================= |
---|
| |
---|
| | Here the use of the ``+=`` operator means something different. It |
---|
| | means, *"I am the final rule in this matter. No subsequent rule |
---|
| | can change this setting."* That's how we prevent rules that are |
---|
| | read after us (ones with higher numbers in their name) from |
---|
| | overriding what we want. |
---|
| | overriding what we want. For example, on at least one system |
---|
| | I worked on, using ``GROUP=`` got overriden by a later |
---|
| | default filesystem rule that always reset group ownership to |
---|
| | ``disk``. Using ``:=`` instead, fixed this. |
---|
| | |
---|
| | One other thing here: Notice the use of numeric values for ``UID`` |
---|
| | and ``GID``. You *could* use the actual user- and group names |
---|
| | here. In fact, most ``udev`` tutorials show it this way. It is a |
---|
| |
---|
| | |
---|
| | Document Revision Information |
---|
| | ============================= |
---|
| | |
---|
| | ``$Id: Deconstructing_Linux_udev_Rules.rst,v 1.111 2013/11/01 02:00:13 tundra Exp $`` |
---|
| | ``$Id: Deconstructing_Linux_udev_Rules.rst,v 1.112 2013/11/01 02:17:08 tundra Exp $`` |
---|
| | |
---|
| | You can find the latest version of this document at: |
---|
| | |
---|
| | http://www.tundraware.com/TechnicalNotes/Deconstructing-Linux-udev-Rules |
---|
| | |