[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 |
|
---|
[b0c8f4a6] | 47 | <screen><userinput>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 |
|
---|
| 52 | <screen><userinput>install -dv /lib/{firmware,udev/devices/{pts,shm}}
|
---|
| 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 |
|
---|
[8536c02] | 62 | <screen><userinput>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 |
|
---|
[ddd5542] | 77 | <para>To test the results, issue:
|
---|
| 78 | <userinput>make test</userinput>.</para>
|
---|
[81fd230] | 79 |
|
---|
[c226182] | 80 | <para>Note that the Udev testsuite will produce numerous messages in
|
---|
| 81 | the host system's logs. These are harmless and can be ignored.</para>
|
---|
| 82 |
|
---|
[ddd5542] | 83 | <para>Install the package:</para>
|
---|
[9dfc02f] | 84 |
|
---|
[8536c02] | 85 | <screen><userinput>make DESTDIR=/ EXTRAS="`echo extras/*/`" install</userinput></screen>
|
---|
[09043c0] | 86 |
|
---|
[ddd5542] | 87 | <variablelist>
|
---|
| 88 | <title>The meaning of the make parameter:</title>
|
---|
[09043c0] | 89 |
|
---|
[ddd5542] | 90 | <varlistentry>
|
---|
| 91 | <term><parameter>DESTDIR=/</parameter></term>
|
---|
| 92 | <listitem>
|
---|
| 93 | <para>This prevents the Udev build process from killing any
|
---|
| 94 | <command>udevd</command> processes that may be running on the
|
---|
| 95 | host system.</para>
|
---|
| 96 | </listitem>
|
---|
| 97 | </varlistentry>
|
---|
[9dfc02f] | 98 |
|
---|
[ddd5542] | 99 | </variablelist>
|
---|
| 100 |
|
---|
[23732c83] | 101 | <para>Udev has to be configured in order to work properly, as it only
|
---|
| 102 | installs a few configuration files by default. First install the
|
---|
[dbfd971] | 103 | commonly-used rules files provided by Udev:</para>
|
---|
[18da154] | 104 |
|
---|
[7e6fb44] | 105 | <screen><userinput>cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/</userinput></screen>
|
---|
[18da154] | 106 |
|
---|
[dbfd971] | 107 | <para>Now install the LFS-specific rules files:</para>
|
---|
[7eac3e32] | 108 |
|
---|
[7e6fb44] | 109 | <screen><userinput>cd &udev-config;
|
---|
| 110 | make install</userinput></screen>
|
---|
| 111 |
|
---|
| 112 | <para>Install the documentation that explains the LFS-specific rules
|
---|
| 113 | files:</para>
|
---|
| 114 |
|
---|
| 115 | <screen><userinput>make install-doc</userinput></screen>
|
---|
| 116 |
|
---|
[dbfd971] | 117 | <para>Install the documentation that explains the commonly-used rules
|
---|
| 118 | files provided by Udev:</para>
|
---|
[7e6fb44] | 119 |
|
---|
| 120 | <screen><userinput>make install-extra-doc</userinput></screen>
|
---|
| 121 |
|
---|
| 122 | <para>Install the documentation that explains how to create custom Udev
|
---|
| 123 | rules:</para>
|
---|
| 124 |
|
---|
| 125 | <screen><userinput>cd ..
|
---|
[997a8b7] | 126 | install -m644 -v docs/writing_udev_rules/index.html \
|
---|
[2c558d69] | 127 | /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
|
---|
[7eac3e32] | 128 |
|
---|
[ddd5542] | 129 | </sect2>
|
---|
| 130 |
|
---|
| 131 | <sect2 id="contents-udev" role="content">
|
---|
| 132 | <title>Contents of Udev</title>
|
---|
| 133 |
|
---|
| 134 | <segmentedlist>
|
---|
| 135 | <segtitle>Installed programs</segtitle>
|
---|
[2791a8e] | 136 | <segtitle>Installed libraries</segtitle>
|
---|
[ddd5542] | 137 | <segtitle>Installed directory</segtitle>
|
---|
| 138 |
|
---|
| 139 | <seglistitem>
|
---|
[2791a8e] | 140 | <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware.sh,
|
---|
[7d6d34b] | 141 | path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle,
|
---|
[2791a8e] | 142 | udevtest, udevtrigger, usb_id, vol_id, write_cd_rules, and
|
---|
| 143 | write_net_rules</seg>
|
---|
| 144 | <seg>libvolume_id</seg>
|
---|
[ddd5542] | 145 | <seg>/etc/udev</seg>
|
---|
| 146 | </seglistitem>
|
---|
| 147 | </segmentedlist>
|
---|
| 148 |
|
---|
| 149 | <variablelist>
|
---|
| 150 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 151 | <?dbfo list-presentation="list"?>
|
---|
| 152 | <?dbhtml list-presentation="table"?>
|
---|
| 153 |
|
---|
[d2c332bc] | 154 | <varlistentry id="ata_id">
|
---|
| 155 | <term><command>ata_id</command></term>
|
---|
| 156 | <listitem>
|
---|
| 157 | <para>Provides Udev with a unique string and
|
---|
| 158 | additional information (uuid, label) for an ATA drive</para>
|
---|
| 159 | <indexterm zone="ch-system-udev ata_id">
|
---|
| 160 | <primary sortas="b-ata_id">ata_id</primary>
|
---|
| 161 | </indexterm>
|
---|
| 162 | </listitem>
|
---|
| 163 | </varlistentry>
|
---|
| 164 |
|
---|
| 165 | <varlistentry id="cdrom_id">
|
---|
| 166 | <term><command>cdrom_id</command></term>
|
---|
| 167 | <listitem>
|
---|
| 168 | <para>Provides Udev with the capabilities of a
|
---|
| 169 | CD-ROM or DVD-ROM drive</para>
|
---|
| 170 | <indexterm zone="ch-system-udev cdrom_id">
|
---|
| 171 | <primary sortas="b-cdrom_id">cdrom_id</primary>
|
---|
| 172 | </indexterm>
|
---|
| 173 | </listitem>
|
---|
| 174 | </varlistentry>
|
---|
| 175 |
|
---|
| 176 | <varlistentry id="create_floppy_devices">
|
---|
| 177 | <term><command>create_floppy_devices</command></term>
|
---|
[ddd5542] | 178 | <listitem>
|
---|
[d2c332bc] | 179 | <para>Creates all possible floppy devices based on the CMOS type</para>
|
---|
| 180 | <indexterm zone="ch-system-udev create_floppy_devices">
|
---|
| 181 | <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
|
---|
[ddd5542] | 182 | </indexterm>
|
---|
| 183 | </listitem>
|
---|
| 184 | </varlistentry>
|
---|
| 185 |
|
---|
[d2c332bc] | 186 | <varlistentry id="edd_id">
|
---|
| 187 | <term><command>edd_id</command></term>
|
---|
[ddd5542] | 188 | <listitem>
|
---|
[d2c332bc] | 189 | <para>Provides Udev with the EDD ID for a BIOS disk drive</para>
|
---|
| 190 | <indexterm zone="ch-system-udev edd_id">
|
---|
| 191 | <primary sortas="b-edd_id">edd_id</primary>
|
---|
[ddd5542] | 192 | </indexterm>
|
---|
| 193 | </listitem>
|
---|
| 194 | </varlistentry>
|
---|
| 195 |
|
---|
[2791a8e] | 196 | <varlistentry id="firmware.sh">
|
---|
| 197 | <term><command>firmware.sh</command></term>
|
---|
[ddd5542] | 198 | <listitem>
|
---|
[d2c332bc] | 199 | <para>Uploads firmware to devices</para>
|
---|
[2791a8e] | 200 | <indexterm zone="ch-system-udev firmware.sh">
|
---|
| 201 | <primary sortas="b-firmware.sh">firmware.sh</primary>
|
---|
[d2c332bc] | 202 | </indexterm>
|
---|
| 203 | </listitem>
|
---|
| 204 | </varlistentry>
|
---|
| 205 |
|
---|
[7d6d34b] | 206 | <varlistentry id="path_id">
|
---|
| 207 | <term><command>path_id</command></term>
|
---|
| 208 | <listitem>
|
---|
| 209 | <para>Provide the shortest possible unique hardware path to a
|
---|
| 210 | device</para>
|
---|
| 211 | <indexterm zone="ch-system-udev path_id">
|
---|
| 212 | <primary sortas="b-path_id">path_id</primary>
|
---|
| 213 | </indexterm>
|
---|
| 214 | </listitem>
|
---|
| 215 | </varlistentry>
|
---|
| 216 |
|
---|
[d2c332bc] | 217 | <varlistentry id="scsi_id">
|
---|
| 218 | <term><command>scsi_id</command></term>
|
---|
| 219 | <listitem>
|
---|
| 220 | <para>Provides Udev with a unique SCSI identifier
|
---|
| 221 | based on the data returned from sending a SCSI INQUIRY command to
|
---|
| 222 | the specified device</para>
|
---|
| 223 | <indexterm zone="ch-system-udev scsi_id">
|
---|
| 224 | <primary sortas="b-scsi_id">scsi_id</primary>
|
---|
[ddd5542] | 225 | </indexterm>
|
---|
| 226 | </listitem>
|
---|
| 227 | </varlistentry>
|
---|
| 228 |
|
---|
| 229 | <varlistentry id="udevcontrol">
|
---|
| 230 | <term><command>udevcontrol</command></term>
|
---|
| 231 | <listitem>
|
---|
| 232 | <para>Configures a number of options for the running
|
---|
| 233 | <command>udevd</command> daemon, such as the log level.</para>
|
---|
| 234 | <indexterm zone="ch-system-udev udevcontrol">
|
---|
| 235 | <primary sortas="b-udevcontrol">udevcontrol</primary>
|
---|
| 236 | </indexterm>
|
---|
| 237 | </listitem>
|
---|
| 238 | </varlistentry>
|
---|
| 239 |
|
---|
| 240 | <varlistentry id="udevd">
|
---|
| 241 | <term><command>udevd</command></term>
|
---|
| 242 | <listitem>
|
---|
[d2c332bc] | 243 | <para>A daemon that listens for uevents on the netlink socket,
|
---|
| 244 | creates devices and runs the configured external programs in
|
---|
| 245 | response to these uevents</para>
|
---|
[ddd5542] | 246 | <indexterm zone="ch-system-udev udevd">
|
---|
| 247 | <primary sortas="b-udevd">udevd</primary>
|
---|
| 248 | </indexterm>
|
---|
| 249 | </listitem>
|
---|
| 250 | </varlistentry>
|
---|
| 251 |
|
---|
| 252 | <varlistentry id="udevinfo">
|
---|
| 253 | <term><command>udevinfo</command></term>
|
---|
| 254 | <listitem>
|
---|
[d2c332bc] | 255 | <para>Allows users to query the Udev database for
|
---|
[ddd5542] | 256 | information on any device currently present on the system; it also
|
---|
| 257 | provides a way to query any device in the <systemitem
|
---|
| 258 | class="filesystem">sysfs</systemitem> tree to help create udev
|
---|
| 259 | rules</para>
|
---|
| 260 | <indexterm zone="ch-system-udev udevinfo">
|
---|
| 261 | <primary sortas="b-udevinfo">udevinfo</primary>
|
---|
| 262 | </indexterm>
|
---|
| 263 | </listitem>
|
---|
| 264 | </varlistentry>
|
---|
| 265 |
|
---|
| 266 | <varlistentry id="udevmonitor">
|
---|
| 267 | <term><command>udevmonitor</command></term>
|
---|
| 268 | <listitem>
|
---|
[d2c332bc] | 269 | <para>Prints the event received from the kernel and the environment
|
---|
| 270 | which Udev sends out after rule processing</para>
|
---|
[ddd5542] | 271 | <indexterm zone="ch-system-udev udevmonitor">
|
---|
| 272 | <primary sortas="b-udevmonitor">udevmonitor</primary>
|
---|
| 273 | </indexterm>
|
---|
| 274 | </listitem>
|
---|
| 275 | </varlistentry>
|
---|
| 276 |
|
---|
[7d6d34b] | 277 | <varlistentry id="udevsettle">
|
---|
| 278 | <term><command>udevsettle</command></term>
|
---|
| 279 | <listitem>
|
---|
| 280 | <para>Watches the Udev event queue and exits if all current uevents
|
---|
| 281 | have been handled</para>
|
---|
| 282 | <indexterm zone="ch-system-udev udevsettle">
|
---|
| 283 | <primary sortas="b-udevsettle">udevsettle</primary>
|
---|
| 284 | </indexterm>
|
---|
| 285 | </listitem>
|
---|
| 286 | </varlistentry>
|
---|
| 287 |
|
---|
[d2c332bc] | 288 | <varlistentry id="udevtest">
|
---|
| 289 | <term><command>udevtest</command></term>
|
---|
[ddd5542] | 290 | <listitem>
|
---|
[d2c332bc] | 291 | <para>Simulates a uevent for the given device, and prints out the
|
---|
| 292 | name of the node the real <command>udevd</command> would have created,
|
---|
| 293 | or the name of the renamed network interface</para>
|
---|
| 294 | <indexterm zone="ch-system-udev udevtest">
|
---|
| 295 | <primary sortas="b-udevtest">udevtest</primary>
|
---|
[ddd5542] | 296 | </indexterm>
|
---|
| 297 | </listitem>
|
---|
| 298 | </varlistentry>
|
---|
| 299 |
|
---|
[7d6d34b] | 300 | <varlistentry id="udevtrigger">
|
---|
| 301 | <term><command>udevtrigger</command></term>
|
---|
| 302 | <listitem>
|
---|
| 303 | <para>Triggers kernel device uevents to be replayed</para>
|
---|
| 304 | <indexterm zone="ch-system-udev udevtrigger">
|
---|
| 305 | <primary sortas="b-udevtrigger">udevtrigger</primary>
|
---|
| 306 | </indexterm>
|
---|
| 307 | </listitem>
|
---|
| 308 | </varlistentry>
|
---|
| 309 |
|
---|
[d2c332bc] | 310 | <varlistentry id="usb_id">
|
---|
| 311 | <term><command>usb_id</command></term>
|
---|
[ddd5542] | 312 | <listitem>
|
---|
[d2c332bc] | 313 | <para>Provides Udev with information about USB
|
---|
| 314 | devices</para>
|
---|
| 315 | <indexterm zone="ch-system-udev usb_id">
|
---|
| 316 | <primary sortas="b-usb_id">usb_id</primary>
|
---|
[ddd5542] | 317 | </indexterm>
|
---|
| 318 | </listitem>
|
---|
| 319 | </varlistentry>
|
---|
| 320 |
|
---|
[d2c332bc] | 321 | <varlistentry id="vol_id">
|
---|
| 322 | <term><command>vol_id</command></term>
|
---|
[ddd5542] | 323 | <listitem>
|
---|
[d2c332bc] | 324 | <para>Provides Udev with the label and uuid of a
|
---|
| 325 | filesystem</para>
|
---|
| 326 | <indexterm zone="ch-system-udev vol_id">
|
---|
| 327 | <primary sortas="b-vol_id">vol_id</primary>
|
---|
[ddd5542] | 328 | </indexterm>
|
---|
| 329 | </listitem>
|
---|
| 330 | </varlistentry>
|
---|
| 331 |
|
---|
[2791a8e] | 332 | <varlistentry id="write_cd_rules">
|
---|
| 333 | <term><command>write_cd_rules</command></term>
|
---|
| 334 | <listitem>
|
---|
| 335 | <para>A script which generates Udev rules to provide stable names for
|
---|
| 336 | optical drives (see also <xref linkend="ch-scripts-symlinks"/>)</para>
|
---|
| 337 | <indexterm zone="ch-system-udev write_cd_rules">
|
---|
| 338 | <primary sortas="b-write_cd_rules">write_cd_rules</primary>
|
---|
| 339 | </indexterm>
|
---|
| 340 | </listitem>
|
---|
| 341 | </varlistentry>
|
---|
| 342 |
|
---|
| 343 | <varlistentry id="write_net_rules">
|
---|
| 344 | <term><command>write_net_rules</command></term>
|
---|
| 345 | <listitem>
|
---|
| 346 | <para>A script which generates rules to provide stable names for
|
---|
| 347 | network interfaces (see also <xref linkend="ch-scripts-network"/>)
|
---|
| 348 | </para>
|
---|
| 349 | <indexterm zone="ch-system-udev write_net_rules">
|
---|
| 350 | <primary sortas="b-write_net_rules">write_net_rules</primary>
|
---|
| 351 | </indexterm>
|
---|
| 352 | </listitem>
|
---|
| 353 | </varlistentry>
|
---|
| 354 |
|
---|
| 355 | <varlistentry id="libvolume_id">
|
---|
| 356 | <term><command>libvolume_id</command></term>
|
---|
| 357 | <listitem>
|
---|
| 358 | <para></para>
|
---|
| 359 | <indexterm zone="ch-system-udev libvolume_id">
|
---|
| 360 | <primary sortas="c-libvolume_id">libvolume_id</primary>
|
---|
| 361 | </indexterm>
|
---|
| 362 | </listitem>
|
---|
| 363 | </varlistentry>
|
---|
| 364 |
|
---|
[ddd5542] | 365 | <varlistentry id="etc-udev">
|
---|
| 366 | <term><filename class="directory">/etc/udev</filename></term>
|
---|
| 367 | <listitem>
|
---|
[d2c332bc] | 368 | <para>Contains Udev configuation files,
|
---|
[ddd5542] | 369 | device permissions, and rules for device naming</para>
|
---|
| 370 | <indexterm zone="ch-system-udev etc-udev">
|
---|
| 371 | <primary sortas="e-/etc/udev">/etc/udev</primary>
|
---|
| 372 | </indexterm>
|
---|
| 373 | </listitem>
|
---|
| 374 | </varlistentry>
|
---|
| 375 |
|
---|
| 376 | </variablelist>
|
---|
| 377 |
|
---|
| 378 | </sect2>
|
---|
[9dfc02f] | 379 |
|
---|
| 380 | </sect1>
|
---|