X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=docs%2Fwriting_udev_rules%2Findex.html;h=b41664bf69cdfe30869f6acf437675a9c71954b0;hp=0e4d54cfaf61a4c4d7ae2bcb47b54326d525a1d6;hb=8af231997824fd1e51a372ae16d4086358c4e83d;hpb=b1ea9f3ef5aad038b4d31cb3e79749de9afb41f8 diff --git a/docs/writing_udev_rules/index.html b/docs/writing_udev_rules/index.html index 0e4d54cfa..b41664bf6 100644 --- a/docs/writing_udev_rules/index.html +++ b/docs/writing_udev_rules/index.html @@ -1,408 +1,838 @@ - + + -Writing udev rules [reactivated.net] - + + +Writing udev rules

Writing udev rules

by Daniel Drake (dsd)
-Version 0.51

+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 regular expressions and wildcards in keys
  16. -
  17. Key-writing basics
  18. -
  19. Identifying devices through basic keys
  20. -
  21. Identifying devices through SYSFS files
  22. -
  23. Example: Writing a rule for my USB printer
  24. -
  25. Example: Writing a rule for my USB-Storage digital camera
  26. - -
  27. Additional notes on writing rules for USB storage
  28. -
  29. Example: Writing convenience rules for my CD drives
  30. -
  31. Tips for finding the appropriate places in SYSFS
  32. -
  33. udev vs Nvidia's graphics drivers
  34. -
  35. Author and credits
  36. -
+ + +

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 persistant 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 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.

+

+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. +

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

+

+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. +

-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 assumes that you have udev installed and running OK with default configurations. This is usually handled by your Linux distribution. +

- +

+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. +

-

History

+

+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. +

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

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

-February 15th 2004: Initial publication.

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

-February 23rd 2004: 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.

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

+ +

History

- -

Software versions used at time of writing

-Linux Kernel 2.6.5-rc3
+