/[gentoo]/xml/htdocs/doc/en/udev-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/udev-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.55 Revision 1.56
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/udev-guide.xml,v 1.55 2011/12/26 15:22:40 swift Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/udev-guide.xml,v 1.56 2012/12/25 18:41:07 swift Exp $ -->
4 4
5<guide> 5<guide>
6<title>Gentoo udev Guide</title> 6<title>Gentoo udev Guide</title>
7 7
8<author title="Author"> 8<author title="Author">
9 <mail link="swift@gentoo.org">Sven Vermeulen</mail> 9 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
10</author> 10</author>
11<author title="Contributor"> 11<author title="Contributor">
12 <mail link="greg_g@gentoo.org">Gregorio Guidi</mail> 12 <mail link="greg_g@gentoo.org">Gregorio Guidi</mail>
13</author> 13</author>
14<author title="Editor"> 14<author title="Editor">
15 <mail link="nightmorph"/> 15 <mail link="nightmorph"/>
16</author> 16</author>
17 17
18<abstract> 18<abstract>
19This document explains what udev is and how you can use udev to fit your needs. 19This document explains what udev is and how you can use udev to fit your needs.
20</abstract> 20</abstract>
21 21
22<!-- The content of this document is licensed under the CC-BY-SA license --> 22<!-- The content of this document is licensed under the CC-BY-SA license -->
23<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 23<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
24<license/> 24<license/>
25 25
26<version>10</version> 26<version>12</version>
27<date>2011-12-26</date> 27<date>2012-12-25</date>
28 28
29<chapter> 29<chapter>
30<title>What is udev?</title> 30<title>What is udev?</title>
31<section> 31<section>
32<title>The /dev Directory</title> 32<title>The /dev Directory</title>
33<body> 33<body>
34 34
35<p> 35<p>
36When Linux-users talk about the hardware on their system in the vicinity of 36When Linux-users talk about the hardware on their system in the vicinity of
37people who believe Linux is some sort of virus or brand of coffee, the use of 37people who believe Linux is some sort of virus or brand of coffee, the use of
38"slash dev slash foo" will return a strange look for sure. But for the fortunate 38"slash dev slash foo" will return a strange look for sure. But for the fortunate
39user (and that includes you) using <path>/dev/sda1</path> is just a fast way of 39user (and that includes you) using <path>/dev/sda1</path> is just a fast way of
40explaining that we are talking about the primary master SATA, first partition. Or 40explaining that we are talking about the primary master SATA, first partition. Or
41aren't we? 41aren't we?
42</p> 42</p>
61<p> 61<p>
62Enter <e>udev</e>. The goals of the udev project are both interesting and 62Enter <e>udev</e>. The goals of the udev project are both interesting and
63needed: 63needed:
64</p> 64</p>
65 65
66<ul> 66<ul>
67 <li>Runs in userspace</li> 67 <li>Runs in userspace</li>
68 <li>Dynamically creates/removes device files</li> 68 <li>Dynamically creates/removes device files</li>
69 <li>Provides consistent naming</li> 69 <li>Provides consistent naming</li>
70 <li>Provides a user-space API</li> 70 <li>Provides a user-space API</li>
71</ul> 71</ul>
72 72
73<p> 73<p>
74Every time a change happens within the device structure, the kernel emits a 74Every time a change happens within the device structure, the kernel emits a
75<e>uevent</e> which gets picked up by udev. udev then follows the rules as 75<e>uevent</e> which gets picked up by udev. udev then follows the rules as
76declared in the <path>/etc/udev/rules.d</path> and 76declared in the <path>/etc/udev/rules.d</path>, <path>/run/udev/rules.d</path>
77<path>/lib/udev/rules.d</path> directories. Based on the information contained 77and <path>/lib/udev/rules.d</path> directories. Based on the information contained
78within the uevent, it finds the rule or rules it needs to trigger and performs 78within the uevent, it finds the rule or rules it needs to trigger and performs
79the required actions. These actions can be creating or deleting device files, 79the required actions. These actions can be creating or deleting device files,
80but can also trigger the loading of particular firmware files into the 80but can also trigger the loading of particular firmware files into the
81kernel memory. 81kernel memory.
82</p> 82</p>
83 83
84</body> 84</body>
85</section> 85</section>
86</chapter> 86</chapter>
87 87
88<chapter> 88<chapter>
89<title>Using udev on Gentoo</title> 89<title>Using udev on Gentoo</title>
90<section> 90<section>
91<title>Requirements</title> 91<title>Requirements</title>
92<body> 92<body>
93 93
94<p> 94<p>
95udev is meant to be used in combination with a 2.6 kernel (like 95udev is meant to be used in combination with a 2.6 and 3.x kernel (like
96<c>gentoo-sources</c> with the default 10.0 profile). If you're using such a 96<c>gentoo-sources</c> with the default 10.0 profile). If you're using such a
97kernel then you just should have no issues whatsoever with using udev as the 97kernel then you just should have no issues whatsoever with using udev as the
98necessary support is built-in in all stable <c>sys-apps/baselayout</c> 98necessary support is built-in in all stable <c>sys-apps/baselayout</c>
99versions. Normally, udev should already be installed on your system, but if 99versions. Normally, udev should already be installed on your system, but if
100this is not the case, then it is easy to install: 100this is not the case, then it is easy to install:
101</p> 101</p>
102 102
103<pre caption="Installing udev"> 103<pre caption="Installing udev">
104# <i>emerge udev</i> 104# <i>emerge udev</i>
105</pre> 105</pre>
106 106
107<p> 107<p>
108Kernelwise, be sure to activate the following options: 108Kernelwise, be sure to activate the following options:
109</p> 109</p>
110 110
230Another issue is the difference in naming of terminals between devfs and udev. 230Another issue is the difference in naming of terminals between devfs and udev.
231While devfs calls its terminals <c>tty</c>, udev calls them <c>vc</c> and 231While devfs calls its terminals <c>tty</c>, udev calls them <c>vc</c> and
232<c>tty</c>. This could lead to a problem in case you are restricting root 232<c>tty</c>. This could lead to a problem in case you are restricting root
233logins from consoles using <path>/etc/securetty</path>. You will need to make 233logins from consoles using <path>/etc/securetty</path>. You will need to make
234sure that both <c>tty1</c> and <c>vc/1</c> are listed in 234sure that both <c>tty1</c> and <c>vc/1</c> are listed in
235<path>/etc/securetty</path> to ensure that root can login using the console. 235<path>/etc/securetty</path> to ensure that root can login using the console.
236</p> 236</p>
237 237
238</body> 238</body>
239</section> 239</section>
240<section> 240<section>
241<title>Block device renaming</title> 241<title>Block device renaming</title>
242<body> 242<body>
243 243
244<p> 244<p>
245Recent versions of udev (104 and up) along with newer kernel versions (2.6.19 245For a couple of years, udev (104 and up) along with the Linux kernel (versions 2.6.19
246and up) may change your disc device names, due to a change in the kernel's 246and up) may change your disc device names, due to a change in the kernel's
247libata implementation. A CD-RW device at <path>/dev/hdc</path> may be changed to 247libata implementation. A CD-RW device at <path>/dev/hdc</path> may be changed to
248<path>/dev/sr0</path>. While this is not normally a problem, it may cause issues 248<path>/dev/sr0</path>. While this is not normally a problem, it may cause issues
249for some applications that are hardcoded to look for devices at other locations. 249for some applications that are hardcoded to look for devices at other locations.
250For example, <c>media-sound/rip</c> expects to find discs at 250For example, <c>media-sound/rip</c> expects to find discs at
251<path>/dev/cdrom</path>, which becomes a problem if you use a newer kernel and 251<path>/dev/cdrom</path>, which becomes a problem if you use a newer kernel and
252udev renames your device to <path>/dev/cdrom1</path>. 252udev renames your device to <path>/dev/cdrom1</path>.
253</p> 253</p>
254 254
255<p> 255<p>
256To work around these issues, you must edit 256To work around these issues, you must edit
257<path>/etc/udev/rules.d/70-persistent-cd.rules</path> and assign the correct 257<path>/etc/udev/rules.d/70-persistent-cd.rules</path> and assign the correct
258name to the device. 258name to the device.
259</p> 259</p>
260 260
348</pre> 348</pre>
349 349
350</body> 350</body>
351</section> 351</section>
352<section> 352<section>
353<title>Other issues</title> 353<title>Other issues</title>
354<body> 354<body>
355 355
356<p> 356<p>
357Support for the framebuffer devices (<path>/dev/fb/*</path>) comes with the 357Support for the framebuffer devices (<path>/dev/fb/*</path>) comes with the
358kernel starting from version 2.6.6-rc2. 358kernel starting from version 2.6.6-rc2.
359</p> 359</p>
360 360
361<p> 361<p>
362For kernels older than 2.6.4 you have to explicitly include support for the 362For kernels older than 2.6.4 you have to explicitly include support for the
363<path>/dev/pts</path> filesystem. 363<path>/dev/pts</path> filesystem, although we <e>seriously</e> recommend you to
364switch to a more recent kernel.
364</p> 365</p>
365 366
366<pre caption="Enabling the /dev/pts filesystem"> 367<pre caption="Enabling the /dev/pts filesystem">
367File systems ---&gt; 368File systems ---&gt;
368 Pseudo filesystems ---&gt; 369 Pseudo filesystems ---&gt;
369 [*] /dev/pts file system for Unix98 PTYs 370 [*] /dev/pts file system for Unix98 PTYs
370</pre> 371</pre>
371 372
372</body> 373</body>
373</section> 374</section>
374</chapter> 375</chapter>
375 376
376<chapter> 377<chapter>
377<title>Resources &amp; Acknowledgements</title> 378<title>Resources &amp; Acknowledgements</title>
378<section> 379<section>

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

  ViewVC Help
Powered by ViewVC 1.1.13