Changeset 6ef5053 for chapter09/udev.xml
- Timestamp:
- 12/21/2022 10:13:16 PM (21 months ago)
- Branches:
- 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 12.2, 12.2-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/update-glibc
- Children:
- 6beb8ce, a8de3b44
- Parents:
- c1fec3a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter09/udev.xml
rc1fec3a9 r6ef5053 17 17 18 18 <para>In <xref linkend="chapter-building-system"/>, we installed the udev 19 packagewhen <phrase revision="sysv">eudev</phrase>19 daemon when <phrase revision="sysv">eudev</phrase> 20 20 <phrase revision="systemd">systemd</phrase> was built. Before we go into the 21 details regarding how thisworks, a brief history of previous methods of21 details regarding how udev works, a brief history of previous methods of 22 22 handling devices is in order.</para> 23 23 … … 26 26 class="directory">/dev</filename> (sometimes literally thousands of nodes), 27 27 regardless of whether the corresponding hardware devices actually existed. This 28 was typically done via a <command>MAKEDEV</command> script, which contain sa28 was typically done via a <command>MAKEDEV</command> script, which contained a 29 29 number of calls to the <command>mknod</command> program with the relevant 30 30 major and minor device numbers for every possible device that might exist in 31 31 the world.</para> 32 32 33 <para>Using the udev method, only those devices which are detected by the34 kernel get device nodes created for them. Because these device nodes will be35 created each time the system boots , they will be stored on a <systemitem33 <para>Using the udev method, device nodes are only created for those devices 34 which are detected by the kernel. These device nodes are 35 created each time the system boots; they are stored in a <systemitem 36 36 class="filesystem">devtmpfs</systemitem> file system (a virtual file system 37 37 that resides entirely in system memory). Device nodes do not require much … … 52 52 detection, creation, and naming. The latter issue, that of device node 53 53 naming, was perhaps the most critical. It is generally accepted that if 54 device names are allowed to be configurable, thenthe device naming policy55 should be up to a system administrator, not imposed on them by any56 particulardeveloper(s). The <systemitem54 device names are configurable, the device naming policy 55 should be chosen by system administrators, and not imposed on them by the 56 developer(s). The <systemitem 57 57 class="filesystem">devfs</systemitem> file system also suffered from race 58 conditions that were inherent in its design and could not be fixed without a 59 substantial revision to the kernel. It was marked as deprecated for a long 60 period – due to a lack of maintenance – and was finally removed 58 conditions that were inherent in its design; these could not be fixed without a 59 substantial revision of the kernel. <systemitem class="filesystem">devfs</systemitem> 60 was marked as deprecated for a long 61 time, and was finally removed 61 62 from the kernel in June, 2006.</para> 62 63 … … 64 65 as the 2.6 series of stable kernels, a new virtual filesystem called 65 66 <systemitem class="filesystem">sysfs</systemitem> came to be. The job of 66 <systemitem class="filesystem">sysfs</systemitem> is to export a view of67 <systemitem class="filesystem">sysfs</systemitem> is to provide information about 67 68 the system's hardware configuration to userspace processes. With this 68 userspace-visible representation, the possibility of developing a userspace 69 replacement for <systemitem class="filesystem">devfs</systemitem> became 70 much more realistic.</para> 69 userspace-visible representation, it became possible to develop a userspace 70 replacement for <systemitem class="filesystem">devfs</systemitem>.</para> 71 71 72 72 </sect2> … … 82 82 class="filesystem">sysfs</systemitem> knows about the devices present on 83 83 a system and what device numbers should be used for them. Drivers that 84 have been compiled into the kernel directly register their objects with a84 have been compiled into the kernel register their objects in 85 85 <systemitem class="filesystem">sysfs</systemitem> (devtmpfs internally) 86 as they are detected by the kernel. For drivers compiled as modules, this87 registration will happenwhen the module is loaded. Once the <systemitem86 as they are detected by the kernel. For drivers compiled as modules, 87 registration happens when the module is loaded. Once the <systemitem 88 88 class="filesystem">sysfs</systemitem> filesystem is mounted (on /sys), 89 data which the drivers registerwith <systemitem89 data which the drivers have registered with <systemitem 90 90 class="filesystem">sysfs</systemitem> are available to userspace 91 91 processes and to udevd for processing (including modifications to device … … 97 97 <title>Device Node Creation</title> 98 98 99 <para>Device files are created by the kernel bythe <systemitem100 class="filesystem">devtmpfs</systemitem> file system. Any driver that101 wishes to register a device node will go throughthe <systemitem99 <para>Device files are created by the kernel in the <systemitem 100 class="filesystem">devtmpfs</systemitem> file system. Any driver that 101 wishes to register a device node will use the <systemitem 102 102 class="filesystem">devtmpfs</systemitem> (via the driver core) to do it. 103 103 When a <systemitem class="filesystem">devtmpfs</systemitem> instance is 104 104 mounted on <filename class="directory">/dev</filename>, the device node 105 will initially be createdwith a fixed name, permissions, and105 will initially be exposed to userspace with a fixed name, permissions, and 106 106 owner.</para> 107 107 … … 173 173 174 174 <sect3> 175 <title>A kernel module is not loaded automatically</title>175 <title>A Kernel Module Is Not Loaded Automatically</title> 176 176 177 177 <para>Udev will only load a module if it has a bus-specific alias and the … … 207 207 208 208 <sect3> 209 <title>A kernel module is not loaded automatically, and udev is not210 intended to load it</title>209 <title>A Kernel Module Is Not Loaded Automatically, and Udev Is Not 210 Intended to Load It</title> 211 211 212 212 <para>If the <quote>wrapper</quote> module only enhances the … … 237 237 238 238 <sect3> 239 <title>Udev loads some unwanted module</title>239 <title>Udev Loads Some Unwanted Module</title> 240 240 241 241 <para>Either don't build the module, or blacklist it in a … … 251 251 252 252 <sect3> 253 <title>Udev creates a device incorrectly, or makes a wrong symlink</title>253 <title>Udev Creates a Device Incorrectly, or Makes the Wrong Symlink</title> 254 254 255 255 <para>This usually happens if a rule unexpectedly matches a device. For … … 262 262 263 263 <sect3> 264 <title>Udev rule works unreliably</title>264 <title>Udev Rule Works Unreliably</title> 265 265 266 266 <para>This may be another manifestation of the previous problem. If not, … … 276 276 277 277 <sect3> 278 <title>Udev does not create a device</title>279 280 <para>F urther text assumes that the driver is built staticallyinto the281 kernel or already loaded as a module, and that you have already checked282 that udev doesn't createa misnamed device.</para>283 284 <para> Udev has no information needed to create a device node if a kernel285 driver does not export its data to286 <systemitem class="filesystem">sysfs</systemitem>. This is most common278 <title>Udev Does Not Create a Device</title> 279 280 <para>First, be certain that the driver is built into the 281 kernel or already loaded as a module, and that 282 udev isn't creating a misnamed device.</para> 283 284 <para>If a kernel driver does not export its data to 285 <systemitem class="filesystem">sysfs</systemitem>, udev lacks the 286 information needed to create a device node. This is most likely to happen 287 287 with third party drivers from outside the kernel tree. Create a static 288 288 device node in <filename>/usr/lib/udev/devices</filename> with the … … 296 296 297 297 <sect3> 298 <title>Device naming order changes randomly after rebooting</title>298 <title>Device Naming Order Changes Randomly After Rebooting</title> 299 299 300 300 <para>This is due to the fact that udev, by design, handles uevents and
Note:
See TracChangeset
for help on using the changeset viewer.