X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=docs%2Fwriting_udev_rules%2Findex.html;h=cc8fbd60c7e01bf9f60a79ca3118fca6b86446ab;hp=c2ccdc3663f1878a1bbc5fe9bbf8295904057f2e;hb=9dd0c2573b1e3a6f18356e4db6cee5e5329ecb67;hpb=7fe082a8a42baa45ef45d82edde4f893410ebeea diff --git a/docs/writing_udev_rules/index.html b/docs/writing_udev_rules/index.html index c2ccdc366..cc8fbd60c 100644 --- a/docs/writing_udev_rules/index.html +++ b/docs/writing_udev_rules/index.html @@ -1,490 +1,840 @@ - + + + + Writing udev rules -

Writing udev rules

by Daniel Drake (dsd)
-Version 0.6

+Version 0.72

The most recent version of this document can always be found at:
-http://www.reactivated.net/udevrules.php + +http://www.reactivated.net/writing_udev_rules.html

Contents

-
    -
  1. About this document
  2. -
  3. History
  4. -
  5. Software versions used at time of writing
  6. -
  7. Terminology: devfs, sysfs, nodes, etc.
  8. - -
  9. Why? (The purpose of this document)
  10. -
  11. The basics of writing rules
  12. -
  13. Additional automated customisation for NAME and SYMLINK parameters
  14. -
  15. Using shell-style pattern matching in keys
  16. -
  17. Key-writing basics
  18. -
  19. Identifying devices through basic keys
  20. -
  21. Identifying devices through SYSFS files
  22. -
  23. Using multiple SYMLINK style rules
  24. -
  25. Controlling ownership and permissions
  26. -
  27. Example: Writing a rule for my USB printer
  28. -
  29. Example: Writing a rule for my USB-Storage digital camera
  30. - -
  31. Additional notes on writing rules for USB storage
  32. -
  33. Example: Writing convenience rules for my CD drives
  34. -
  35. Example: Writing a rule to name my network interface
  36. -
  37. Tips for finding the appropriate places in SYSFS
  38. -
  39. Debugging your rules
  40. -
  41. Author and credits
  42. -
+ + +

Introduction

-

About this document

-udev is targetted at Linux kernels 2.6 and beyond to provide a userspace solution for a dynamic /dev directory, with persistent device naming. The previous /dev implementation, devfs, is now deprecated, and udev is seen as the successor. udev vs devfs is a sensitive area of conversation - you should read this document before making comparisons.

+

About this document

+ +

+udev is targeted at Linux kernels 2.6 and beyond to provide a userspace solution for a dynamic /dev directory, with persistent device naming. The previous /dev implementation, devfs, is now deprecated, and udev is seen as the successor. udev vs devfs is a sensitive area of conversation - you should read this document before making comparisons. +

+ +

+Over the years, the things that you might use udev rules for has changed, as well as the flexibility of rules themselves. On a modern system, udev provides persistent naming for some device types out-of-the-box, eliminating the need for custom rules for those devices. However, some users will still require the extra level of customisation. +

-udev is a well thought out solution, but I was initially very confused how I might customise it for my system. This document attempts to make the process of rule writing a little bit clearer.

+

+This document assumes that you have udev installed and running OK with default configurations. This is usually handled by your Linux distribution. +

-I'm all open to feedback - please contact me with any comments, problems, and suggested improvements.

+

+This document does not cover every single detail of rule writing, but does aim to introduce all of the main concepts. The finer details can be found in the udev man page. +

-This document assumes that you have udev/hotplug installed and running OK with default configurations. If you do not yet have udev configured and running, I would suggest that you follow Decibels udev Primer to get to this stage (contains some Gentoo Linux specifics, but should be useful for other distro's too).

+

+This document uses various examples (many of which are entirely fictional) to illustrate ideas and concepts. Not all syntax is explicitly described in the accompanying text, be sure to look at the example rules to get a complete understanding. +

+

History

-

History

- -May 9th 2005 v0.6: Misc updates, including information about udevinfo, groups and permissions, logging, and udevtest.

-June 20th 2004 v0.55: Added info on multiple symlinks, and some minor changes/updates.

-April 26th 2004 v0.54: Added some Debian info. Minor corrections. Re-reverted information about what to call your rule file. Added info about naming network interfaces.

-April 15th 2004 v0.53: Minor corrections. Added info about NAME{all_partitions}. Added info about other udevinfo tricks.

-April 14th 2004 v0.52: Reverted to suggesting using "udev.rules" until the udev defaults allow for other files. Minor work.

-April 6th 2004 v0.51: I now write suggest users to use their own "local.rules" file rather than prepending "udev.rules".

-April 3rd 2004 v0.5: Minor cleanups and preparations for possible inclusion in the udev distribution.

-March 20th 2004 v0.4: General improvements, clarifications, and cleanups. Added more information about writing rules for usb-storage.

-February 23rd 2004 v0.3: Rewrote some parts to emphasise how sysfs naming works, and how it can be matched. Updated rule-writing parts to represent udev 018s new SYSFS{filename} naming scheme. Improved sectioning, and clarified many points. Added info about KDE.

-February 18th 2004 v0.2: Fixed a small omission in an example. Updated section on identifying mass-storage devices. Updated section on nvidia.

-February 15th 2004 v0.1: Initial publication.

- - -

Software versions used at time of writing

-Linux Kernel 2.6.11
-udev 056

+