Changeset 82fc053 for BOOK/bootscripts/common/eudev.xml
- Timestamp:
- May 14, 2014, 1:21:04 AM (10 years ago)
- Branches:
- clfs-3.0.0-sysvinit, sysvinit
- Children:
- 056e32f4
- Parents:
- db71344
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
BOOK/bootscripts/common/eudev.xml
rdb71344 r82fc053 6 6 ]> 7 7 8 <sect1 id="ch-scripts- udev">9 <?dbhtml filename=" udev.html"?>8 <sect1 id="ch-scripts-eudev"> 9 <?dbhtml filename="eudev.html"?> 10 10 11 11 <title>Device and Module Handling on a CLFS System</title> 12 12 13 <indexterm zone="ch-scripts- udev">14 <primary sortas="a- systemd">Systemd</primary>15 <secondary>u dev usage</secondary>13 <indexterm zone="ch-scripts-eudev"> 14 <primary sortas="a-Eudev">Eudev</primary> 15 <secondary>usage</secondary> 16 16 </indexterm> 17 17 18 <para>In <xref linkend="chapter-building-system"/>, we installed systemd,19 which contains systemd-udevd, previously known as Udev. Before we go into20 the details regarding how this works, a brief history of previous methods of21 handling devices is inorder.</para>18 <para>In <xref linkend="chapter-building-system"/>, we installed the Eudev 19 package. Before we go into the details regarding how this works, 20 a brief history of previous methods of handling devices is in 21 order.</para> 22 22 23 23 <para>Linux systems in general traditionally use a static device creation … … 30 30 the world.</para> 31 31 32 <para>Using the Udev method, only those devices which are detected by the32 <para>Using the Eudev method, only those devices which are detected by the 33 33 kernel get device nodes created for them. Because these device nodes will be 34 34 created each time the system boots, they will be stored on a <systemitem … … 71 71 72 72 <sect2> 73 <title> Udev Implementation</title>73 <title>Eudev Implementation</title> 74 74 75 75 <sect3> … … 93 93 94 94 <sect3> 95 <title>Eudev Bootscript</title> 96 97 <para>The <command>S10udev</command> initscript takes care of creating 98 device nodes when Linux is booted. The script unsets the uevent handler 99 from the default of <command>/sbin/hotplug</command>. This is done 100 because the kernel no longer needs to call out to an external binary. 101 Instead <command>udevd</command> will listen on a netlink socket for 102 uevents that the kernel raises. Next, the bootscript copies any static 103 device nodes that exist in <filename 104 class="directory">/lib/udev/devices</filename> to <filename 105 class="directory">/dev</filename>. This is necessary because some devices, 106 directories, and symlinks are needed before the dynamic device handling 107 processes are available during the early stages of booting a system. 108 Creating static device nodes in <filename 109 class="directory">/lib/udev/devices</filename> also provides an easy 110 workaround for devices that are not supported by the dynamic device 111 handling infrastructure. The bootscript then starts the Eudev daemon, 112 <command>udevd</command>, which will act on any uevents it receives. 113 Finally, the bootscript forces the kernel to replay uevents for any 114 devices that have already been registered and then waits for 115 <command>udevd</command> to handle them.</para> 116 117 </sect3> 118 119 <sect3> 95 120 <title>Device Node Creation</title> 96 121 97 <para>To obtain the right major and minor number for a device, Udev relies122 <para>To obtain the right major and minor number for a device, Eudev relies 98 123 on the information provided by <systemitem 99 124 class="filesystem">sysfs</systemitem> in <filename … … 104 129 <emphasis>0</emphasis>. The names and permissions of the nodes created 105 130 under the <filename class="directory">/dev</filename> directory are 106 determined by rules specified in the files within the 107 <filename class="directory">/lib/udev/rules.d</filename> and <filename 108 class="directory">/etc/udev/rules.d/</filename> directories. These files 109 have names that start with numbers, and are evaluated in numerical order. 110 If <command>udevd</command> can't find a rule for the device it is 111 creating, it will default permissions to <emphasis>660</emphasis> and 112 ownership to <emphasis>root:root</emphasis>. </para> 131 determined by rules specified in the files within the <filename 132 class="directory">/etc/udev/rules.d/</filename> directory. These are 133 numbered in a similar fashion to the CLFS-Bootscripts package. If 134 <command>udevd</command> can't find a rule for the device it is creating, 135 it will default permissions to <emphasis>660</emphasis> and ownership to 136 <emphasis>root:root</emphasis>. Documentation on the syntax of the Eudev 137 rules configuration files is available in 138 <filename>/usr/share/doc/udev/writing_udev_rules/index.html</filename></para> 113 139 114 140 </sect3> … … 129 155 might contain the string 130 156 <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>. 131 The default rules provided by Udev will cause <command>udevd</command>157 The default rules provided by Eudev will cause <command>udevd</command> 132 158 to call out to <command>/sbin/modprobe</command> with the contents of the 133 159 <envar>MODALIAS</envar> uevent environment variable (that should be the … … 168 194 <title>A kernel module is not loaded automatically</title> 169 195 170 <para> Udev will only load a module if it has a bus-specific alias and the196 <para>Eudev will only load a module if it has a bus-specific alias and the 171 197 bus driver properly exports the necessary aliases to <systemitem 172 198 class="filesystem">sysfs</systemitem>. In other cases, one should 173 arrange module loading by other means. With Linux-&linux-version;, Udev is199 arrange module loading by other means. With Linux-&linux-version;, Eudev is 174 200 known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI, 175 201 SERIO and FireWire devices.</para> 176 202 177 203 <para>To determine if the device driver you require has the necessary 178 support for Udev, run <command>modinfo</command> with the module name as204 support for Eudev, run <command>modinfo</command> with the module name as 179 205 the argument. Now try locating the device directory under 180 206 <filename class="directory">/sys/bus</filename> and check whether there is … … 184 210 class="filesystem">sysfs</systemitem>, the driver supports the device and 185 211 can talk to it directly, but doesn't have the alias, it is a bug in the 186 driver. Load the driver without the help from Udev and expect the issue212 driver. Load the driver without the help from Eudev and expect the issue 187 213 to be fixed later.</para> 188 214 … … 193 219 busses. Expect this issue to be fixed in later kernel versions.</para> 194 220 195 <para> Udev is not intended to load <quote>wrapper</quote> drivers such as221 <para>Eudev is not intended to load <quote>wrapper</quote> drivers such as 196 222 <emphasis>snd-pcm-oss</emphasis> and non-hardware drivers such as 197 223 <emphasis>loop</emphasis> at all.</para> … … 200 226 201 227 <sect3> 202 <title>A kernel module is not loaded automatically, and Udev is not228 <title>A kernel module is not loaded automatically, and Eudev is not 203 229 intended to load it</title> 204 230 … … 207 233 enhances the functionality of <emphasis>snd-pcm</emphasis> by making the 208 234 sound cards available to OSS applications), configure 209 <command>modprobe</command> to load the wrapper after Udev loads the210 wrapped module. To do this, add an <quote>install</quote> line to a file211 in <filename>/etc/modprobe.d</filename>. For example:</para>235 <command>modprobe</command> to load the wrapper after Eudev loads the 236 wrapped module. To do this, add an <quote>install</quote> line in 237 <filename>/etc/modprobe.conf</filename>. For example:</para> 212 238 213 239 <screen role="nodump"><literal>install snd-pcm /sbin/modprobe -i snd-pcm ; \ 214 240 /sbin/modprobe snd-pcm-oss ; true</literal></screen> 215 241 216 </sect3> 217 218 <sect3> 219 <title>Udev loads some unwanted module</title> 242 <para>If the module in question is not a wrapper and is useful by itself, 243 configure the <command>S05modules</command> bootscript to load this 244 module on system boot. To do this, add the module name to the 245 <filename>/etc/sysconfig/modules</filename> file on a separate line. 246 This works for wrapper modules too, but is suboptimal in that case.</para> 247 248 </sect3> 249 250 <sect3> 251 <title>Eudev loads some unwanted module</title> 220 252 221 253 <para>Either don't build the module, or blacklist it in 222 <filename>/etc/modprobe. d</filename> file as done with the254 <filename>/etc/modprobe.conf</filename> file as done with the 223 255 <emphasis>forte</emphasis> module in the example below:</para> 224 256 … … 231 263 232 264 <sect3> 233 <title> Udev creates a device incorrectly, or makes a wrong symlink</title>265 <title>Eudev creates a device incorrectly, or makes a wrong symlink</title> 234 266 235 267 <para>This usually happens if a rule unexpectedly matches a device. For … … 242 274 243 275 <sect3> 244 <title> Udev rule works unreliably</title>276 <title>Eudev rule works unreliably</title> 245 277 246 278 <para>This may be another manifestation of the previous problem. If not, … … 256 288 257 289 <sect3> 258 <title> Udev does not create a device</title>290 <title>Eudev does not create a device</title> 259 291 260 292 <para>Further text assumes that the driver is built statically into the 261 293 kernel or already loaded as a module, and that you have already checked 262 that Udev doesn't create a misnamed device.</para>263 264 <para> Udev has no information needed to create a device node if a kernel294 that Eudev doesn't create a misnamed device.</para> 295 296 <para>Eudev has no information needed to create a device node if a kernel 265 297 driver does not export its data to <systemitem 266 298 class="filesystem">sysfs</systemitem>. … … 279 311 <title>Device naming order changes randomly after rebooting</title> 280 312 281 <para>This is due to the fact that Udev, by design, handles uevents and313 <para>This is due to the fact that Eudev, by design, handles uevents and 282 314 loads modules in parallel, and thus in an unpredictable order. This will 283 315 never be <quote>fixed</quote>. You should not rely upon the kernel device 284 316 names being stable. Instead, create your own rules that make symlinks with 285 317 stable names based on some stable attributes of the device, such as a 286 serial number or the output of various *_id utilities installed by Udev.318 serial number or the output of various *_id utilities installed by Eudev. 287 319 See <xref linkend="ch-scripts-symlinks"/> and 288 320 <xref linkend="chapter-network"/> for examples.</para>
Note: See TracChangeset
for help on using the changeset viewer.