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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.58 - (show annotations) (download) (as text)
Wed Mar 20 20:44:09 2013 UTC (4 years, 8 months ago) by swift
Branch: MAIN
Changes since 1.57: +3 -104 lines
File MIME type: application/xml
Further fix bug #462488 - Updates on udev guide

1 <?xml version='1.0' encoding="UTF-8"?>
2 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/udev-guide.xml,v 1.57 2013/03/20 15:58:35 swift Exp $ -->
4
5 <guide>
6 <title>Gentoo udev Guide</title>
7
8 <author title="Author">
9 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
10 </author>
11 <author title="Contributor">
12 <mail link="greg_g@gentoo.org">Gregorio Guidi</mail>
13 </author>
14 <author title="Editor">
15 <mail link="nightmorph"/>
16 </author>
17
18 <abstract>
19 This document explains what udev is and how you can use udev to fit your needs.
20 </abstract>
21
22 <!-- The content of this document is licensed under the CC-BY-SA license -->
23 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
24 <license/>
25
26 <version>14</version>
27 <date>2013-03-20</date>
28
29 <chapter>
30 <title>What is udev?</title>
31 <section>
32 <title>The /dev Directory</title>
33 <body>
34
35 <p>
36 When Linux-users talk about the hardware on their system in the vicinity of
37 people 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
39 user (and that includes you) using <path>/dev/sda1</path> is just a fast way of
40 explaining that we are talking about the primary master SATA, first partition. Or
41 aren't we?
42 </p>
43
44 <p>
45 We all know what a device file is. Some even know why device files have special
46 numbers when we take a closer look at them when we issue <c>ls -l</c> in
47 <path>/dev</path>. But what we always take for granted is that the primary
48 SATA disk is referred to as <path>/dev/sda</path>. You might not see it
49 this way, but this is a flaw by design.
50 </p>
51
52 <p>
53 Think about hotpluggable devices like USB, IEEE1394, hot-swappable PCI, ... What
54 is the first device? And for how long? What will the other devices be named when
55 the first one disappears? How will that affect ongoing transactions? Wouldn't it
56 be fun that a printing job is suddenly moved from your supernew laserprinter to
57 your almost-dead matrix printer because your mom decided to pull the plug of the
58 laserprinter which happened to be the first printer?
59 </p>
60
61 <p>
62 Enter <e>udev</e>. The goals of the udev project are both interesting and
63 needed:
64 </p>
65
66 <ul>
67 <li>Runs in userspace</li>
68 <li>Dynamically creates/removes device files</li>
69 <li>Provides consistent naming</li>
70 <li>Provides a user-space API</li>
71 </ul>
72
73 <p>
74 Every 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
76 declared in the <path>/etc/udev/rules.d</path>, <path>/run/udev/rules.d</path>
77 and <path>/lib/udev/rules.d</path> directories. Based on the information contained
78 within the uevent, it finds the rule or rules it needs to trigger and performs
79 the required actions. These actions can be creating or deleting device files,
80 but can also trigger the loading of particular firmware files into the
81 kernel memory.
82 </p>
83
84 </body>
85 </section>
86 </chapter>
87
88 <chapter>
89 <title>Using udev on Gentoo</title>
90 <section>
91 <title>Requirements</title>
92 <body>
93
94 <p>
95 udev is meant to be used in combination with a 2.6 and 3.x kernel (like
96 <c>gentoo-sources</c> with the default 13.0 profile). If you're using such a
97 kernel then you just should have no issues whatsoever with using udev as the
98 necessary support is built-in in all stable <c>sys-apps/baselayout</c>
99 versions. Normally, udev should already be installed on your system, but if
100 this is not the case, then it is easy to install:
101 </p>
102
103 <pre caption="Installing udev">
104 # <i>emerge udev</i>
105 </pre>
106
107 <p>
108 Kernelwise, be sure to activate the following options:
109 </p>
110
111 <pre caption="Required kernel options">
112 General Setup ---&gt;
113 <comment>(Make sure the following item is *not* enabled)</comment>
114 [ ] Enable deprecated sysfs features to support old userspace tools
115
116 File Systems ---&gt;
117 [*] Inotify support for userspace
118 Pseudo filesystems ---&gt;
119 [*] Virtual memory file system support (former shm fs)
120
121 Device Drivers ---&gt;
122 <comment>(Make sure the following item is *not* enabled)</comment>
123 &lt; &gt; ATA/ATAPI/MFM/RLL support (DEPRECATED)
124 <comment>(This is *absolutely* necessary for /dev to populate)</comment>
125 Generic Driver Options ---&gt;
126 [*] Maintain a devtmpfs filesystem to mount at /dev
127 </pre>
128
129 <p>
130 If you use <c>genkernel</c>, you don't need to do anything special. Genkernel
131 sets up udev by default.
132 </p>
133
134 </body>
135 </section>
136 </chapter>
137
138 <chapter>
139 <title>Resources &amp; Acknowledgements</title>
140 <section>
141 <body>
142
143 <p>
144 Documentation for using <uri link="http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames">the new predictable network interface names.</uri>
145 </p>
146
147 <p>
148 <uri link="http://webpages.charter.net/decibelshelp/LinuxHelp_UDEVPrimer.html">Decibel's
149 UDEV Primer</uri> is an in-depth document about udev and Gentoo.
150 </p>
151
152 <p>
153 <uri link="http://www.reactivated.net/udevrules.php">Writing udev rules</uri> by
154 fellow Gentoo developer Daniel Drake is an excellent document to learn how to
155 customize your udev installation.
156 </p>
157
158 </body>
159 </section>
160 </chapter>
161 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20