| … | |
… | |
| 11 | This document explains what udev is and how you can use udev to fit your needs. |
11 | This document explains what udev is and how you can use udev to fit your needs. |
| 12 | </abstract> |
12 | </abstract> |
| 13 | |
13 | |
| 14 | <license/> |
14 | <license/> |
| 15 | |
15 | |
| 16 | <version>0.2</version> |
16 | <version>0.3</version> |
| 17 | <date>February 29, 2003</date> |
17 | <date>March 1, 2003</date> |
| 18 | |
18 | |
| 19 | <chapter> |
19 | <chapter> |
| 20 | <title>What is udev?</title> |
20 | <title>What is udev?</title> |
| 21 | <section> |
21 | <section> |
| 22 | <title>The /dev Directory</title> |
22 | <title>The /dev Directory</title> |
| 23 | <body> |
23 | <body> |
| 24 | |
24 | |
| 25 | <p> |
25 | <p> |
| 26 | When Linux-users talk about the hardware on their system in the vicinity of |
26 | When Linux-users talk about the hardware on their system in the vicinity of |
| 27 | people that believe Linux is some sort of virus or brand of coffee, the use of |
27 | people who believe Linux is some sort of virus or brand of coffee, the use of |
| 28 | "slash dev slash foo" will return a strange look for sure. But for the fortunate |
28 | "slash dev slash foo" will return a strange look for sure. But for the fortunate |
| 29 | user (and that includes you) using <path>/dev/hda1</path> is just a fast way of |
29 | user (and that includes you) using <path>/dev/hda1</path> is just a fast way of |
| 30 | explaining that we are talking about the primary master IDE, first partition. Or |
30 | explaining that we are talking about the primary master IDE, first partition. Or |
| 31 | aren't we? |
31 | aren't we? |
| 32 | </p> |
32 | </p> |
| … | |
… | |
| 38 | master IDE disk is referred to as <path>/dev/hda</path>. You might not see it |
38 | master IDE disk is referred to as <path>/dev/hda</path>. You might not see it |
| 39 | this way, but this is a flaw by design. |
39 | this way, but this is a flaw by design. |
| 40 | </p> |
40 | </p> |
| 41 | |
41 | |
| 42 | <p> |
42 | <p> |
| 43 | Think hotpluggable devices like USB, IEEE1394, hot-swappable PCI, ... What is |
43 | Think about hotpluggable devices like USB, IEEE1394, hot-swappable PCI, ... What |
| 44 | the first device? And for how long? What will the other devices be named to when |
44 | is the first device? And for how long? What will the other devices be named when |
| 45 | the first one disappears? How will that affect ongoing transactions? Wouldn't it |
45 | the first one disappears? How will that affect ongoing transactions? Wouldn't it |
| 46 | be fun that a printing job is suddenly moved from your supernew laserprinter to |
46 | be fun that a printing job is suddenly moved from your supernew laserprinter to |
| 47 | your almost-dead matrix printer because your mom decided to pull the plug of the |
47 | your almost-dead matrix printer because your mom decided to pull the plug of the |
| 48 | inkjet which happened to be the first printer? |
48 | inkjet which happened to be the first printer? |
| 49 | </p> |
49 | </p> |
| 50 | |
50 | |
| 51 | <p> |
51 | <p> |
| 52 | Enter <e>udev</e>. The goals of the udev project are both interesting and |
52 | Enter <e>udev</e>. The goals of the udev project are both interesting and |
| 53 | needed: |
53 | needed: |
| 54 | </p> |
54 | </p> |
| 55 | |
55 | |
| 56 | <ul> |
56 | <ul> |
| 57 | <li>Run in userspace</li> |
57 | <li>Runs in userspace</li> |
| 58 | <li>Dynamically create/remove device files</li> |
58 | <li>Dynamically creates/removes device files</li> |
| 59 | <li>Provide consistent naming</li> |
59 | <li>Provides consistent naming</li> |
| 60 | <li>Provide a user-space API</li> |
60 | <li>Provides a user-space API</li> |
| 61 | </ul> |
61 | </ul> |
| 62 | |
62 | |
| 63 | <p> |
63 | <p> |
| 64 | To provide these features, udev is developed in three separate projects: |
64 | To provide these features, udev is developed in three separate projects: |
| 65 | <e>namedev</e>, <e>libsysfs</e> and, of course, <e>udev</e>. |
65 | <e>namedev</e>, <e>libsysfs</e> and, of course, <e>udev</e>. |
| … | |
… | |
| 78 | that udev can use. |
78 | that udev can use. |
| 79 | </p> |
79 | </p> |
| 80 | |
80 | |
| 81 | <p> |
81 | <p> |
| 82 | Currently only a single naming scheme is provided by namedev; the one provided |
82 | Currently only a single naming scheme is provided by namedev; the one provided |
| 83 | by LANANA, used by the majority of Linux systems currently and therefor very |
83 | by LANANA, used by the majority of Linux systems currently and therefore very |
| 84 | suitable for the majority of Linux users. |
84 | suitable for the majority of Linux users. |
| 85 | </p> |
85 | </p> |
| 86 | |
86 | |
| 87 | <p> |
87 | <p> |
| 88 | Namedev uses a 5-step procedure to find out the name of a given device. If the |
88 | Namedev uses a 5-step procedure to find out the name of a given device. If the |
| … | |
… | |
| 116 | </p> |
116 | </p> |
| 117 | |
117 | |
| 118 | <p> |
118 | <p> |
| 119 | Likewise the <e>bus topology</e> is a rather static way of defining devices as |
119 | Likewise the <e>bus topology</e> is a rather static way of defining devices as |
| 120 | long as the user doesn't switch devices. When the position of the device matches |
120 | long as the user doesn't switch devices. When the position of the device matches |
| 121 | a given setting provided by the user, the accompagnying name is used. |
121 | a given setting provided by the user, the accompanying name is used. |
| 122 | </p> |
122 | </p> |
| 123 | |
123 | |
| 124 | <p> |
124 | <p> |
| 125 | The fourth step, <e>statically given name</e>, is a simple string replacement. |
125 | The fourth step, <e>statically given name</e>, is a simple string replacement. |
| 126 | When the kernel name (the default name) matches a given replacement string, the |
126 | When the kernel name (the default name) matches a given replacement string, the |
| … | |
… | |
| 218 | <body> |
218 | <body> |
| 219 | |
219 | |
| 220 | <p> |
220 | <p> |
| 221 | If you're interested in the udev-tweaks Gentoo added to make your life |
221 | If you're interested in the udev-tweaks Gentoo added to make your life |
| 222 | comfortable, then read no more. You're all set. The Gentoo init scripts won't |
222 | comfortable, then read no more. You're all set. The Gentoo init scripts won't |
| 223 | run the devfsd daemon and deactivate devfs when you boot up. |
223 | run the devfsd daemon and will deactivate devfs when you boot up. |
| 224 | </p> |
224 | </p> |
| 225 | |
225 | |
| 226 | <p> |
226 | <p> |
| 227 | But if you are a die-hard and want to run a udev-only, no-tweaked system as is |
227 | But if you are a die-hard and want to run a udev-only, no-tweaked system as is |
| 228 | intended by the udev development (including the difficulties of missing device |
228 | intended by the udev development (including the difficulties of missing device |