[9dfc02f] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[9dfc02f] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[ddd5542] | 7 |
|
---|
[a001133] | 8 | <sect1 id="ch-system-udev" role="wrap">
|
---|
[ddd5542] | 9 | <?dbhtml filename="udev.html"?>
|
---|
| 10 |
|
---|
[e747759] | 11 | <sect1info condition="script">
|
---|
| 12 | <productname>udev</productname>
|
---|
| 13 | <productnumber>&udev-version;</productnumber>
|
---|
| 14 | <address>&udev-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
[ddd5542] | 17 | <title>Udev-&udev-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-system-udev">
|
---|
| 20 | <primary sortas="a-Udev">Udev</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect2 role="package">
|
---|
| 24 | <title/>
|
---|
[9dfc02f] | 25 |
|
---|
[ddd5542] | 26 | <para>The Udev package contains programs for dynamic creation of device
|
---|
| 27 | nodes.</para>
|
---|
[9dfc02f] | 28 |
|
---|
[ddd5542] | 29 | <segmentedlist>
|
---|
| 30 | <segtitle>&buildtime;</segtitle>
|
---|
| 31 | <segtitle>&diskspace;</segtitle>
|
---|
[9dfc02f] | 32 |
|
---|
[ddd5542] | 33 | <seglistitem>
|
---|
[e4a5635] | 34 | <seg>&udev-ch6-sbu;</seg>
|
---|
| 35 | <seg>&udev-ch6-du;</seg>
|
---|
[ddd5542] | 36 | </seglistitem>
|
---|
| 37 | </segmentedlist>
|
---|
[9dfc02f] | 38 |
|
---|
[ddd5542] | 39 | </sect2>
|
---|
[9dfc02f] | 40 |
|
---|
[ddd5542] | 41 | <sect2 role="installation">
|
---|
| 42 | <title>Installation of Udev</title>
|
---|
| 43 |
|
---|
[7d6d34b] | 44 | <para>The udev-config tarball contains LFS-specific files used to configure
|
---|
[e1060de] | 45 | Udev. Unpack it into the Udev source directory:</para>
|
---|
[7d6d34b] | 46 |
|
---|
[0445a3d] | 47 | <screen><userinput remap="pre">tar -xvf ../&udev-config;.tar.bz2</userinput></screen>
|
---|
[7d6d34b] | 48 |
|
---|
[d2c332bc] | 49 | <para>Create some devices and directories that Udev cannot handle due to
|
---|
| 50 | them being required very early in the boot process:</para>
|
---|
| 51 |
|
---|
[0445a3d] | 52 | <screen><userinput remap="pre">install -dv /lib/{firmware,udev/devices/{pts,shm}}
|
---|
[d2c332bc] | 53 | mknod -m0666 /lib/udev/devices/null c 1 3
|
---|
| 54 | ln -sv /proc/self/fd /lib/udev/devices/fd
|
---|
| 55 | ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
|
---|
| 56 | ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
|
---|
| 57 | ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
|
---|
| 58 | ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
|
---|
| 59 |
|
---|
[ddd5542] | 60 | <para>Compile the package:</para>
|
---|
[9dfc02f] | 61 |
|
---|
[0445a3d] | 62 | <screen><userinput remap="make">make EXTRAS="`echo extras/*/`"</userinput></screen>
|
---|
[81fd230] | 63 |
|
---|
[ddd5542] | 64 | <variablelist>
|
---|
| 65 | <title>The meaning of the make option:</title>
|
---|
| 66 |
|
---|
| 67 | <varlistentry>
|
---|
[d2c332bc] | 68 | <term><parameter>EXTRAS=...</parameter></term>
|
---|
[ddd5542] | 69 | <listitem>
|
---|
[8536c02] | 70 | <para>This builds the helper binaries that can aid in writing custom
|
---|
[d2c332bc] | 71 | Udev rules.</para>
|
---|
[ddd5542] | 72 | </listitem>
|
---|
| 73 | </varlistentry>
|
---|
[09043c0] | 74 |
|
---|
[ddd5542] | 75 | </variablelist>
|
---|
[09043c0] | 76 |
|
---|
[0445a3d] | 77 | <para>To test the results, issue:</para>
|
---|
| 78 |
|
---|
| 79 | <screen><userinput remap="test">make test</userinput></screen>
|
---|
[81fd230] | 80 |
|
---|
[c226182] | 81 | <para>Note that the Udev testsuite will produce numerous messages in
|
---|
| 82 | the host system's logs. These are harmless and can be ignored.</para>
|
---|
| 83 |
|
---|
[ddd5542] | 84 | <para>Install the package:</para>
|
---|
[9dfc02f] | 85 |
|
---|
[0445a3d] | 86 | <screen><userinput remap="install">make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
|
---|
[09043c0] | 87 |
|
---|
[ddd5542] | 88 | <variablelist>
|
---|
| 89 | <title>The meaning of the make parameter:</title>
|
---|
[09043c0] | 90 |
|
---|
[ddd5542] | 91 | <varlistentry>
|
---|
| 92 | <term><parameter>DESTDIR=/</parameter></term>
|
---|
| 93 | <listitem>
|
---|
| 94 | <para>This prevents the Udev build process from killing any
|
---|
| 95 | <command>udevd</command> processes that may be running on the
|
---|
| 96 | host system.</para>
|
---|
| 97 | </listitem>
|
---|
| 98 | </varlistentry>
|
---|
[9dfc02f] | 99 |
|
---|
[ddd5542] | 100 | </variablelist>
|
---|
| 101 |
|
---|
[23732c83] | 102 | <para>Udev has to be configured in order to work properly, as it only
|
---|
| 103 | installs a few configuration files by default. First install the
|
---|
[dbfd971] | 104 | commonly-used rules files provided by Udev:</para>
|
---|
[18da154] | 105 |
|
---|
[0445a3d] | 106 | <screen><userinput remap="install">cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/</userinput></screen>
|
---|
[18da154] | 107 |
|
---|
[dbfd971] | 108 | <para>Now install the LFS-specific rules files:</para>
|
---|
[7eac3e32] | 109 |
|
---|
[0445a3d] | 110 | <screen><userinput remap="install">cd &udev-config;
|
---|
[7e6fb44] | 111 | make install</userinput></screen>
|
---|
| 112 |
|
---|
| 113 | <para>Install the documentation that explains the LFS-specific rules
|
---|
| 114 | files:</para>
|
---|
| 115 |
|
---|
[0445a3d] | 116 | <screen><userinput remap="install">make install-doc</userinput></screen>
|
---|
[7e6fb44] | 117 |
|
---|
[dbfd971] | 118 | <para>Install the documentation that explains the commonly-used rules
|
---|
| 119 | files provided by Udev:</para>
|
---|
[7e6fb44] | 120 |
|
---|
[0445a3d] | 121 | <screen><userinput remap="install">make install-extra-doc</userinput></screen>
|
---|
[7e6fb44] | 122 |
|
---|
| 123 | <para>Install the documentation that explains how to create custom Udev
|
---|
| 124 | rules:</para>
|
---|
| 125 |
|
---|
[0445a3d] | 126 | <screen><userinput remap="install">cd ..
|
---|
[997a8b7] | 127 | install -m644 -v docs/writing_udev_rules/index.html \
|
---|
[2c558d69] | 128 | /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
|
---|
[7eac3e32] | 129 |
|
---|
[ddd5542] | 130 | </sect2>
|
---|
| 131 |
|
---|
| 132 | <sect2 id="contents-udev" role="content">
|
---|
| 133 | <title>Contents of Udev</title>
|
---|
| 134 |
|
---|
| 135 | <segmentedlist>
|
---|
| 136 | <segtitle>Installed programs</segtitle>
|
---|
[2791a8e] | 137 | <segtitle>Installed libraries</segtitle>
|
---|
[ddd5542] | 138 | <segtitle>Installed directory</segtitle>
|
---|
| 139 |
|
---|
| 140 | <seglistitem>
|
---|
[2791a8e] | 141 | <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware.sh,
|
---|
[7d6d34b] | 142 | path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
|
---|
[2791a8e] | 143 | udevtest, udevtrigger, usb_id, vol_id, write_cd_rules, and
|
---|
| 144 | write_net_rules</seg>
|
---|
| 145 | <seg>libvolume_id</seg>
|
---|
[ddd5542] | 146 | <seg>/etc/udev</seg>
|
---|
| 147 | </seglistitem>
|
---|
| 148 | </segmentedlist>
|
---|
| 149 |
|
---|
| 150 | <variablelist>
|
---|
| 151 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 152 | <?dbfo list-presentation="list"?>
|
---|
| 153 | <?dbhtml list-presentation="table"?>
|
---|
| 154 |
|
---|
[d2c332bc] | 155 | <varlistentry id="ata_id">
|
---|
| 156 | <term><command>ata_id</command></term>
|
---|
| 157 | <listitem>
|
---|
| 158 | <para>Provides Udev with a unique string and
|
---|
| 159 | additional information (uuid, label) for an ATA drive</para>
|
---|
| 160 | <indexterm zone="ch-system-udev ata_id">
|
---|
| 161 | <primary sortas="b-ata_id">ata_id</primary>
|
---|
| 162 | </indexterm>
|
---|
| 163 | </listitem>
|
---|
| 164 | </varlistentry>
|
---|
| 165 |
|
---|
| 166 | <varlistentry id="cdrom_id">
|
---|
| 167 | <term><command>cdrom_id</command></term>
|
---|
| 168 | <listitem>
|
---|
| 169 | <para>Provides Udev with the capabilities of a
|
---|
| 170 | CD-ROM or DVD-ROM drive</para>
|
---|
| 171 | <indexterm zone="ch-system-udev cdrom_id">
|
---|
| 172 | <primary sortas="b-cdrom_id">cdrom_id</primary>
|
---|
| 173 | </indexterm>
|
---|
| 174 | </listitem>
|
---|
| 175 | </varlistentry>
|
---|
| 176 |
|
---|
| 177 | <varlistentry id="create_floppy_devices">
|
---|
| 178 | <term><command>create_floppy_devices</command></term>
|
---|
[ddd5542] | 179 | <listitem>
|
---|
[d2c332bc] | 180 | <para>Creates all possible floppy devices based on the CMOS type</para>
|
---|
| 181 | <indexterm zone="ch-system-udev create_floppy_devices">
|
---|
| 182 | <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
|
---|
[ddd5542] | 183 | </indexterm>
|
---|
| 184 | </listitem>
|
---|
| 185 | </varlistentry>
|
---|
| 186 |
|
---|
[d2c332bc] | 187 | <varlistentry id="edd_id">
|
---|
| 188 | <term><command>edd_id</command></term>
|
---|
[ddd5542] | 189 | <listitem>
|
---|
[d2c332bc] | 190 | <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
|
---|
| 191 | <indexterm zone="ch-system-udev edd_id">
|
---|
| 192 | <primary sortas="b-edd_id">edd_id</primary>
|
---|
[ddd5542] | 193 | </indexterm>
|
---|
| 194 | </listitem>
|
---|
| 195 | </varlistentry>
|
---|
| 196 |
|
---|
[2791a8e] | 197 | <varlistentry id="firmware.sh">
|
---|
| 198 | <term><command>firmware.sh</command></term>
|
---|
[ddd5542] | 199 | <listitem>
|
---|
[d2c332bc] | 200 | <para>Uploads firmware to devices</para>
|
---|
[2791a8e] | 201 | <indexterm zone="ch-system-udev firmware.sh">
|
---|
| 202 | <primary sortas="b-firmware.sh">firmware.sh</primary>
|
---|
[d2c332bc] | 203 | </indexterm>
|
---|
| 204 | </listitem>
|
---|
| 205 | </varlistentry>
|
---|
| 206 |
|
---|
[7d6d34b] | 207 | <varlistentry id="path_id">
|
---|
| 208 | <term><command>path_id</command></term>
|
---|
| 209 | <listitem>
|
---|
[9058aa1] | 210 | <para>Provides the shortest possible unique hardware path to a
|
---|
[7d6d34b] | 211 | device</para>
|
---|
| 212 | <indexterm zone="ch-system-udev path_id">
|
---|
| 213 | <primary sortas="b-path_id">path_id</primary>
|
---|
| 214 | </indexterm>
|
---|
| 215 | </listitem>
|
---|
| 216 | </varlistentry>
|
---|
| 217 |
|
---|
[d2c332bc] | 218 | <varlistentry id="scsi_id">
|
---|
| 219 | <term><command>scsi_id</command></term>
|
---|
| 220 | <listitem>
|
---|
| 221 | <para>Provides Udev with a unique SCSI identifier
|
---|
| 222 | based on the data returned from sending a SCSI INQUIRY command to
|
---|
| 223 | the specified device</para>
|
---|
| 224 | <indexterm zone="ch-system-udev scsi_id">
|
---|
| 225 | <primary sortas="b-scsi_id">scsi_id</primary>
|
---|
[ddd5542] | 226 | </indexterm>
|
---|
| 227 | </listitem>
|
---|
| 228 | </varlistentry>
|
---|
| 229 |
|
---|
| 230 | <varlistentry id="udevcontrol">
|
---|
| 231 | <term><command>udevcontrol</command></term>
|
---|
| 232 | <listitem>
|
---|
| 233 | <para>Configures a number of options for the running
|
---|
| 234 | <command>udevd</command> daemon, such as the log level.</para>
|
---|
| 235 | <indexterm zone="ch-system-udev udevcontrol">
|
---|
| 236 | <primary sortas="b-udevcontrol">udevcontrol</primary>
|
---|
| 237 | </indexterm>
|
---|
| 238 | </listitem>
|
---|
| 239 | </varlistentry>
|
---|
| 240 |
|
---|
| 241 | <varlistentry id="udevd">
|
---|
| 242 | <term><command>udevd</command></term>
|
---|
| 243 | <listitem>
|
---|
[d2c332bc] | 244 | <para>A daemon that listens for uevents on the netlink socket,
|
---|
| 245 | creates devices and runs the configured external programs in
|
---|
| 246 | response to these uevents</para>
|
---|
[ddd5542] | 247 | <indexterm zone="ch-system-udev udevd">
|
---|
| 248 | <primary sortas="b-udevd">udevd</primary>
|
---|
| 249 | </indexterm>
|
---|
| 250 | </listitem>
|
---|
| 251 | </varlistentry>
|
---|
| 252 |
|
---|
| 253 | <varlistentry id="udevinfo">
|
---|
| 254 | <term><command>udevinfo</command></term>
|
---|
| 255 | <listitem>
|
---|
[d2c332bc] | 256 | <para>Allows users to query the Udev database for
|
---|
[ddd5542] | 257 | information on any device currently present on the system; it also
|
---|
| 258 | provides a way to query any device in the <systemitem
|
---|
| 259 | class="filesystem">sysfs</systemitem> tree to help create udev
|
---|
| 260 | rules</para>
|
---|
| 261 | <indexterm zone="ch-system-udev udevinfo">
|
---|
| 262 | <primary sortas="b-udevinfo">udevinfo</primary>
|
---|
| 263 | </indexterm>
|
---|
| 264 | </listitem>
|
---|
| 265 | </varlistentry>
|
---|
| 266 |
|
---|
| 267 | <varlistentry id="udevmonitor">
|
---|
| 268 | <term><command>udevmonitor</command></term>
|
---|
| 269 | <listitem>
|
---|
[d2c332bc] | 270 | <para>Prints the event received from the kernel and the environment
|
---|
| 271 | which Udev sends out after rule processing</para>
|
---|
[ddd5542] | 272 | <indexterm zone="ch-system-udev udevmonitor">
|
---|
| 273 | <primary sortas="b-udevmonitor">udevmonitor</primary>
|
---|
| 274 | </indexterm>
|
---|
| 275 | </listitem>
|
---|
| 276 | </varlistentry>
|
---|
| 277 |
|
---|
[7d6d34b] | 278 | <varlistentry id="udevsettle">
|
---|
| 279 | <term><command>udevsettle</command></term>
|
---|
| 280 | <listitem>
|
---|
| 281 | <para>Watches the Udev event queue and exits if all current uevents
|
---|
| 282 | have been handled</para>
|
---|
| 283 | <indexterm zone="ch-system-udev udevsettle">
|
---|
| 284 | <primary sortas="b-udevsettle">udevsettle</primary>
|
---|
| 285 | </indexterm>
|
---|
| 286 | </listitem>
|
---|
| 287 | </varlistentry>
|
---|
| 288 |
|
---|
[d2c332bc] | 289 | <varlistentry id="udevtest">
|
---|
| 290 | <term><command>udevtest</command></term>
|
---|
[ddd5542] | 291 | <listitem>
|
---|
[d2c332bc] | 292 | <para>Simulates a uevent for the given device, and prints out the
|
---|
| 293 | name of the node the real <command>udevd</command> would have created,
|
---|
| 294 | or the name of the renamed network interface</para>
|
---|
| 295 | <indexterm zone="ch-system-udev udevtest">
|
---|
| 296 | <primary sortas="b-udevtest">udevtest</primary>
|
---|
[ddd5542] | 297 | </indexterm>
|
---|
| 298 | </listitem>
|
---|
| 299 | </varlistentry>
|
---|
| 300 |
|
---|
[7d6d34b] | 301 | <varlistentry id="udevtrigger">
|
---|
| 302 | <term><command>udevtrigger</command></term>
|
---|
| 303 | <listitem>
|
---|
| 304 | <para>Triggers kernel device uevents to be replayed</para>
|
---|
| 305 | <indexterm zone="ch-system-udev udevtrigger">
|
---|
| 306 | <primary sortas="b-udevtrigger">udevtrigger</primary>
|
---|
| 307 | </indexterm>
|
---|
| 308 | </listitem>
|
---|
| 309 | </varlistentry>
|
---|
| 310 |
|
---|
[d2c332bc] | 311 | <varlistentry id="usb_id">
|
---|
| 312 | <term><command>usb_id</command></term>
|
---|
[ddd5542] | 313 | <listitem>
|
---|
[d2c332bc] | 314 | <para>Provides Udev with information about USB
|
---|
| 315 | devices</para>
|
---|
| 316 | <indexterm zone="ch-system-udev usb_id">
|
---|
| 317 | <primary sortas="b-usb_id">usb_id</primary>
|
---|
[ddd5542] | 318 | </indexterm>
|
---|
| 319 | </listitem>
|
---|
| 320 | </varlistentry>
|
---|
| 321 |
|
---|
[d2c332bc] | 322 | <varlistentry id="vol_id">
|
---|
| 323 | <term><command>vol_id</command></term>
|
---|
[ddd5542] | 324 | <listitem>
|
---|
[d2c332bc] | 325 | <para>Provides Udev with the label and uuid of a
|
---|
| 326 | filesystem</para>
|
---|
| 327 | <indexterm zone="ch-system-udev vol_id">
|
---|
| 328 | <primary sortas="b-vol_id">vol_id</primary>
|
---|
[ddd5542] | 329 | </indexterm>
|
---|
| 330 | </listitem>
|
---|
| 331 | </varlistentry>
|
---|
| 332 |
|
---|
[2791a8e] | 333 | <varlistentry id="write_cd_rules">
|
---|
| 334 | <term><command>write_cd_rules</command></term>
|
---|
| 335 | <listitem>
|
---|
| 336 | <para>A script which generates Udev rules to provide stable names for
|
---|
| 337 | optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
|
---|
| 338 | <indexterm zone="ch-system-udev write_cd_rules">
|
---|
| 339 | <primary sortas="b-write_cd_rules">write_cd_rules</primary>
|
---|
| 340 | </indexterm>
|
---|
| 341 | </listitem>
|
---|
| 342 | </varlistentry>
|
---|
| 343 |
|
---|
| 344 | <varlistentry id="write_net_rules">
|
---|
| 345 | <term><command>write_net_rules</command></term>
|
---|
| 346 | <listitem>
|
---|
| 347 | <para>A script which generates rules to provide stable names for
|
---|
| 348 | network interfaces (see also <xref linkend="ch-scripts-network"/>)
|
---|
| 349 | </para>
|
---|
| 350 | <indexterm zone="ch-system-udev write_net_rules">
|
---|
| 351 | <primary sortas="b-write_net_rules">write_net_rules</primary>
|
---|
| 352 | </indexterm>
|
---|
| 353 | </listitem>
|
---|
| 354 | </varlistentry>
|
---|
| 355 |
|
---|
| 356 | <varlistentry id="libvolume_id">
|
---|
| 357 | <term><command>libvolume_id</command></term>
|
---|
| 358 | <listitem>
|
---|
| 359 | <para></para>
|
---|
| 360 | <indexterm zone="ch-system-udev libvolume_id">
|
---|
| 361 | <primary sortas="c-libvolume_id">libvolume_id</primary>
|
---|
| 362 | </indexterm>
|
---|
| 363 | </listitem>
|
---|
| 364 | </varlistentry>
|
---|
| 365 |
|
---|
[ddd5542] | 366 | <varlistentry id="etc-udev">
|
---|
| 367 | <term><filename class="directory">/etc/udev</filename></term>
|
---|
| 368 | <listitem>
|
---|
[9058aa1] | 369 | <para>Contains Udev configuration files,
|
---|
[ddd5542] | 370 | device permissions, and rules for device naming</para>
|
---|
| 371 | <indexterm zone="ch-system-udev etc-udev">
|
---|
| 372 | <primary sortas="e-/etc/udev">/etc/udev</primary>
|
---|
| 373 | </indexterm>
|
---|
| 374 | </listitem>
|
---|
| 375 | </varlistentry>
|
---|
| 376 |
|
---|
| 377 | </variablelist>
|
---|
| 378 |
|
---|
| 379 | </sect2>
|
---|
[9dfc02f] | 380 |
|
---|
| 381 | </sect1>
|
---|