[9dfc02f] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[1770019] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[9dfc02f] | 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[a001133] | 6 | <sect1 id="ch-system-udev" role="wrap">
|
---|
[9dfc02f] | 7 | <title>Udev-&udev-version;</title>
|
---|
| 8 | <?dbhtml filename="udev.html"?>
|
---|
| 9 |
|
---|
[a001133] | 10 | <indexterm zone="ch-system-udev"><primary sortas="a-Udev">Udev</primary></indexterm>
|
---|
[9dfc02f] | 11 |
|
---|
[a001133] | 12 | <sect2 role="package"><title/>
|
---|
[81fd230] | 13 | <para>The Udev package contains programs for dynamic creation of device nodes.</para>
|
---|
[9dfc02f] | 14 |
|
---|
[a001133] | 15 | <segmentedlist>
|
---|
| 16 | <segtitle>&buildtime;</segtitle>
|
---|
| 17 | <segtitle>&diskspace;</segtitle>
|
---|
[3d16951] | 18 | <seglistitem><seg>0.1 SBU</seg><seg>3.1 MB</seg></seglistitem>
|
---|
[a001133] | 19 | </segmentedlist>
|
---|
[9dfc02f] | 20 |
|
---|
[81fd230] | 21 | <segmentedlist>
|
---|
[45992ae] | 22 | <segtitle>&dependencies;</segtitle>
|
---|
[81fd230] | 23 | <seglistitem><seg>Coreutils and Make</seg></seglistitem>
|
---|
| 24 | </segmentedlist>
|
---|
| 25 |
|
---|
[a001133] | 26 | </sect2>
|
---|
| 27 |
|
---|
| 28 | <sect2 role="installation">
|
---|
[9dfc02f] | 29 | <title>Installation of Udev</title>
|
---|
| 30 |
|
---|
[dc591b5] | 31 | <para>Create some devices that Udev cannot handle due to them being required
|
---|
| 32 | very early in the boot process:</para>
|
---|
| 33 |
|
---|
| 34 | <screen><userinput>ln -sv /proc/self/fd /lib/udev/devices/fd
|
---|
| 35 | ln -sv /proc/self/fd/0 /lib/udev/devices/stdin
|
---|
| 36 | ln -sv /proc/self/fd/1 /lib/udev/devices/stdout
|
---|
| 37 | ln -sv /proc/self/fd/2 /lib/udev/devices/stderr
|
---|
| 38 | ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen>
|
---|
| 39 |
|
---|
[81fd230] | 40 | <para>Compile the package:</para>
|
---|
[9dfc02f] | 41 |
|
---|
[dc591b5] | 42 | <screen><userinput>make \
|
---|
| 43 | EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id"</userinput></screen>
|
---|
[81fd230] | 44 |
|
---|
[09043c0] | 45 | <para>The meaning of the make option:</para>
|
---|
| 46 |
|
---|
| 47 | <variablelist>
|
---|
| 48 | <varlistentry>
|
---|
[dc591b5] | 49 | <term><parameter>EXTRAS=...</parameter></term>
|
---|
[09043c0] | 50 | <listitem>
|
---|
[dc591b5] | 51 | <para>This builds several helper binaries that can aid in writing custom
|
---|
| 52 | Udev rules.</para>
|
---|
[09043c0] | 53 | </listitem>
|
---|
| 54 | </varlistentry>
|
---|
| 55 | </variablelist>
|
---|
| 56 |
|
---|
[317b76b] | 57 | <para>To test the results, issue:
|
---|
[5f6ad4e] | 58 | <userinput>make test</userinput>.</para>
|
---|
[81fd230] | 59 |
|
---|
| 60 | <para>Install the package:</para>
|
---|
[9dfc02f] | 61 |
|
---|
[dc591b5] | 62 | <screen><userinput>make DESTDIR=/ \
|
---|
| 63 | EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id extras/firmware extras/floppy extras/scsi_id extras/usb_id extras/volume_id" \
|
---|
| 64 | install</userinput></screen>
|
---|
[09043c0] | 65 |
|
---|
| 66 | <para>The meaning of the make option:</para>
|
---|
| 67 |
|
---|
| 68 | <variablelist>
|
---|
| 69 | <varlistentry>
|
---|
| 70 | <term><parameter>DESTDIR=/</parameter>
|
---|
| 71 | </term>
|
---|
| 72 | <listitem>
|
---|
| 73 | <para>This prevents the Udev build process from killing any
|
---|
| 74 | <command>udevd</command> processes that may be running on the host
|
---|
| 75 | system.
|
---|
| 76 | </para>
|
---|
| 77 | </listitem>
|
---|
| 78 | </varlistentry>
|
---|
| 79 | </variablelist>
|
---|
[9dfc02f] | 80 |
|
---|
[81fd230] | 81 | <para>Udev's configuration is far from ideal by default, so install
|
---|
| 82 | the configuration files here:</para>
|
---|
[18da154] | 83 |
|
---|
[c8c8222] | 84 | <screen><userinput>cp -v ../&udev-config-file; /etc/udev/rules.d/25-lfs.rules</userinput></screen>
|
---|
[18da154] | 85 |
|
---|
[dc591b5] | 86 | <para>Alter Udev's configuration file so that Udev can automatically load kernel
|
---|
| 87 | modules.</para>
|
---|
| 88 |
|
---|
| 89 | <screen><userinput>sed -i 147,150d /etc/udev/rules.d/25-lfs.rules
|
---|
| 90 | cat >> /etc/udev/rules.d/25-lfs.rules << EOF
|
---|
| 91 | # Rules to allow hotplugging of devices with modular drivers
|
---|
| 92 | ACTION=="add", SUBSYSTEM=="usb", MODALIAS=="*", \
|
---|
| 93 | RUN+="/sbin/modprobe $modalias"
|
---|
| 94 | ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", \
|
---|
| 95 | RUN+="/sbin/modprobe sd_mod"
|
---|
| 96 | EOF</userinput></screen>
|
---|
| 97 |
|
---|
[7eac3e32] | 98 | <para>Install the documentation that explains how to create Udev rules:</para>
|
---|
| 99 |
|
---|
[5998892] | 100 | <screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
|
---|
[7eac3e32] | 101 |
|
---|
[fa21b3d] | 102 | <!-- Not for the LiveCD -->
|
---|
[81fd230] | 103 | <!-- Edit Me -->
|
---|
[dc591b5] | 104 |
|
---|
[81fd230] | 105 | <para>Run the <command>udevstart</command> program to create our full
|
---|
[09bd7b3] | 106 | complement of device nodes.</para>
|
---|
[6135b95] | 107 |
|
---|
| 108 | <screen><userinput>/sbin/udevstart</userinput></screen>
|
---|
| 109 |
|
---|
[9dfc02f] | 110 | </sect2>
|
---|
| 111 |
|
---|
[c6cb3aa] | 112 | <sect2 id="contents-udev" role="content"><title>Contents of Udev</title>
|
---|
[9dfc02f] | 113 |
|
---|
[81fd230] | 114 | <segmentedlist>
|
---|
| 115 | <segtitle>Installed programs</segtitle>
|
---|
| 116 | <segtitle>Installed directory</segtitle>
|
---|
[3d16951] | 117 | <seglistitem><seg>ata_id, cdrom_id, create_floppy_devices, edd_id,
|
---|
| 118 | firmware_helper, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevtest,
|
---|
| 119 | usb_id and vol_id</seg>
|
---|
[81fd230] | 120 | <seg>/etc/udev</seg></seglistitem>
|
---|
| 121 | </segmentedlist>
|
---|
[32324418] | 122 |
|
---|
[81fd230] | 123 | <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 124 | <?dbfo list-presentation="list"?>
|
---|
[8f97096] | 125 | <?dbhtml list-presentation="table"?>
|
---|
[81fd230] | 126 |
|
---|
[3d16951] | 127 | <varlistentry id="ata_id">
|
---|
| 128 | <term>
|
---|
| 129 | <command>ata_id</command>
|
---|
| 130 | </term>
|
---|
| 131 | <listitem>
|
---|
| 132 | <para>Provides <command>udev</command> with a unique string and additional
|
---|
| 133 | information (uuid, label) for an ATA drive</para>
|
---|
| 134 | <indexterm zone="ch-system-udev ata_id">
|
---|
| 135 | <primary sortas="b-ata_id">ata_id</primary>
|
---|
| 136 | </indexterm>
|
---|
| 137 | </listitem>
|
---|
| 138 | </varlistentry>
|
---|
| 139 |
|
---|
| 140 | <varlistentry id="cdrom_id">
|
---|
| 141 | <term>
|
---|
| 142 | <command>cdrom_id</command>
|
---|
| 143 | </term>
|
---|
| 144 | <listitem>
|
---|
| 145 | <para>Provides <command>udev</command> with the capabilities of a CD-ROM or
|
---|
| 146 | DVD-ROM drive</para>
|
---|
| 147 | <indexterm zone="ch-system-udev cdrom_id">
|
---|
| 148 | <primary sortas="b-cdrom_id">cdrom_id</primary>
|
---|
| 149 | </indexterm>
|
---|
| 150 | </listitem>
|
---|
| 151 | </varlistentry>
|
---|
| 152 |
|
---|
| 153 | <varlistentry id="create_floppy_devices">
|
---|
| 154 | <term>
|
---|
| 155 | <command>create_floppy_devices</command>
|
---|
| 156 | </term>
|
---|
| 157 | <listitem>
|
---|
| 158 | <para>Creates all possible floppy devices based on the CMOS type</para>
|
---|
| 159 | <indexterm zone="ch-system-udev create_floppy_devices">
|
---|
| 160 | <primary sortas="b-create_floppy_devices">create_floppy_devices</primary>
|
---|
| 161 | </indexterm>
|
---|
| 162 | </listitem>
|
---|
| 163 | </varlistentry>
|
---|
| 164 |
|
---|
| 165 | <varlistentry id="edd_id">
|
---|
| 166 | <term>
|
---|
| 167 | <command>edd_id</command>
|
---|
| 168 | </term>
|
---|
| 169 | <listitem>
|
---|
| 170 | <para>Provides <command>udev</command> with the EDD ID for a BIOS disk
|
---|
| 171 | drive</para>
|
---|
| 172 | <indexterm zone="ch-system-udev edd_id">
|
---|
| 173 | <primary sortas="b-edd_id">edd_id</primary>
|
---|
| 174 | </indexterm>
|
---|
| 175 | </listitem>
|
---|
| 176 | </varlistentry>
|
---|
| 177 |
|
---|
| 178 | <varlistentry id="firmware_helper">
|
---|
| 179 | <term>
|
---|
| 180 | <command>firmware_helper</command>
|
---|
| 181 | </term>
|
---|
| 182 | <listitem>
|
---|
| 183 | <para>Enables <command>udev</command> to upload firmware to devices</para>
|
---|
| 184 | <indexterm zone="ch-system-udev firmware_helper">
|
---|
| 185 | <primary sortas="b-firmware_helper">firmware_helper</primary>
|
---|
| 186 | </indexterm>
|
---|
| 187 | </listitem>
|
---|
| 188 | </varlistentry>
|
---|
| 189 |
|
---|
| 190 | <varlistentry id="scsi_id">
|
---|
| 191 | <term>
|
---|
| 192 | <command>scsi_id</command>
|
---|
| 193 | </term>
|
---|
| 194 | <listitem>
|
---|
| 195 | <para>Provides <command>udev</command> with a unique SCSI identifier based
|
---|
| 196 | on the data returned from sending a SCSI INQUIRY command to the specified
|
---|
| 197 | device</para>
|
---|
| 198 | <indexterm zone="ch-system-udev scsi_id">
|
---|
| 199 | <primary sortas="b-scsi_id">scsi_id</primary>
|
---|
| 200 | </indexterm>
|
---|
| 201 | </listitem>
|
---|
| 202 | </varlistentry>
|
---|
| 203 |
|
---|
[6c511d85] | 204 | <varlistentry id="udevcontrol">
|
---|
| 205 | <term><command>udevcontrol</command></term>
|
---|
| 206 | <listitem>
|
---|
| 207 | <para>Configures a number of options for the running <command>udevd</command>
|
---|
| 208 | daemon, such as the log level.</para>
|
---|
| 209 | <indexterm zone="ch-system-udev udevcontrol"><primary sortas="b-udevcontrol">udevcontrol</primary>
|
---|
| 210 | </indexterm>
|
---|
| 211 | </listitem></varlistentry>
|
---|
| 212 |
|
---|
[81fd230] | 213 | <varlistentry id="udevd">
|
---|
| 214 | <term><command>udevd</command></term>
|
---|
| 215 | <listitem>
|
---|
| 216 | <para>A daemon that reorders hotplug events before submitting them to
|
---|
| 217 | <command>udev</command>,
|
---|
| 218 | thus avoiding various race conditions</para>
|
---|
| 219 | <indexterm zone="ch-system-udev udevd"><primary sortas="b-udevd">udevd</primary></indexterm>
|
---|
| 220 | </listitem></varlistentry>
|
---|
| 221 |
|
---|
[6c511d85] | 222 | <varlistentry id="udevinfo">
|
---|
| 223 | <term><command>udevinfo</command></term>
|
---|
| 224 | <listitem>
|
---|
| 225 | <para>Allows users to query the <command>udev</command> database for
|
---|
| 226 | information on any device currently present on the system; it also
|
---|
| 227 | provides a way to query any device in the <systemitem
|
---|
| 228 | class="filesystem">sysfs</systemitem> tree to help create udev
|
---|
| 229 | rules</para>
|
---|
| 230 | <indexterm zone="ch-system-udev udevinfo"><primary sortas="b-udevinfo">udevinfo</primary></indexterm>
|
---|
| 231 | </listitem></varlistentry>
|
---|
| 232 |
|
---|
| 233 | <varlistentry id="udevmonitor">
|
---|
| 234 | <term><command>udevmonitor</command></term>
|
---|
| 235 | <listitem>
|
---|
| 236 | <para>Prints the event received from the kernel and the event which
|
---|
| 237 | <command>udev</command> sends out after rule processing</para>
|
---|
| 238 | <indexterm zone="ch-system-udev udevmonitor"><primary sortas="b-udevmonitor">udevmonitor</primary>
|
---|
| 239 | </indexterm>
|
---|
| 240 | </listitem></varlistentry>
|
---|
| 241 |
|
---|
[81fd230] | 242 | <varlistentry id="udevtest">
|
---|
| 243 | <term><command>udevtest</command></term>
|
---|
| 244 | <listitem>
|
---|
| 245 | <para>Simulates a <command>udev</command> run for the given device,
|
---|
| 246 | and prints out the name of the node the real <command>udev</command> would
|
---|
| 247 | have created or (not in LFS) the name of the renamed network interface</para>
|
---|
| 248 | <indexterm zone="ch-system-udev udevtest"><primary sortas="b-udevtest">udevtest</primary></indexterm>
|
---|
| 249 | </listitem></varlistentry>
|
---|
| 250 |
|
---|
[3d16951] | 251 | <varlistentry id="usb_id">
|
---|
| 252 | <term>
|
---|
| 253 | <command>usb_id</command>
|
---|
| 254 | </term>
|
---|
| 255 | <listitem>
|
---|
| 256 | <para>Provides <command>udev</command> with information about USB devices
|
---|
| 257 | </para>
|
---|
| 258 | <indexterm zone="ch-system-udev usb_id">
|
---|
| 259 | <primary sortas="b-usb_id">usb_id</primary>
|
---|
| 260 | </indexterm>
|
---|
| 261 | </listitem>
|
---|
| 262 | </varlistentry>
|
---|
| 263 |
|
---|
| 264 | <varlistentry id="vol_id">
|
---|
| 265 | <term>
|
---|
| 266 | <command>vol_id</command>
|
---|
| 267 | </term>
|
---|
| 268 | <listitem>
|
---|
| 269 | <para>Provides <command>udev</command> with the label and uuid of a
|
---|
| 270 | filesystem</para>
|
---|
| 271 | <indexterm zone="ch-system-udev vol_id">
|
---|
| 272 | <primary sortas="b-vol_id">vol_id</primary>
|
---|
| 273 | </indexterm>
|
---|
| 274 | </listitem>
|
---|
| 275 | </varlistentry>
|
---|
| 276 |
|
---|
[81fd230] | 277 | <varlistentry id="etc-udev">
|
---|
| 278 | <term><filename class="directory">/etc/udev</filename></term>
|
---|
| 279 | <listitem>
|
---|
| 280 | <para>Contains <command>udev</command> configuation files,
|
---|
| 281 | device permissions, and rules for device naming</para>
|
---|
[32b21a1] | 282 | <indexterm zone="ch-system-udev etc-udev"><primary sortas="e-/etc/udev">/etc/udev</primary></indexterm>
|
---|
[81fd230] | 283 | </listitem></varlistentry>
|
---|
| 284 | </variablelist>
|
---|
[32324418] | 285 | </sect2>
|
---|
[9dfc02f] | 286 |
|
---|
| 287 | </sect1>
|
---|
[81fd230] | 288 |
|
---|