Changeset a3d0817 for chapter09/symlinks.xml
- Timestamp:
- 06/12/2020 08:42:32 PM (4 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 9e7475a
- Parents:
- 96f04d7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter09/symlinks.xml
r96f04d7 ra3d0817 22 22 Intel and Realtek, the network card manufactured by Intel may become eth0 23 23 and the Realtek card becomes eth1. In some cases, after a reboot the cards 24 get renumbered the other way around.</para>24 could get renumbered the other way around.</para> 25 25 26 26 <para>In the new naming scheme, typical network device names would then … … 45 45 <title>Creating Custom Udev Rules</title> 46 46 47 <para>The naming scheme can be customized by creating custom Udev47 <para>The naming scheme can be customized by creating custom udev 48 48 rules. A script has been included that generates the initial rules. 49 49 Generate these rules by running:</para> … … 69 69 the hardware ID nor the driver is used to determine which name to give an 70 70 interface; this information is only for reference. The second line is the 71 Udev rule that matches this NIC and actually assigns it a name.</para>72 73 <para>All Udev rules are made up of several keys, separated by commas and71 udev rule that matches this NIC and actually assigns it a name.</para> 72 73 <para>All udev rules are made up of several keys, separated by commas and 74 74 optional whitespace. This rule's keys and an explanation of each of them 75 75 are as follows:</para> … … 77 77 <itemizedlist> 78 78 <listitem> 79 <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore79 <para><literal>SUBSYSTEM=="net"</literal> - This tells udev to ignore 80 80 devices that are not network cards.</para> 81 81 </listitem> 82 82 <listitem> 83 <para><literal>ACTION=="add"</literal> - This tells Udev to ignore this83 <para><literal>ACTION=="add"</literal> - This tells udev to ignore this 84 84 rule for a uevent that isn't an add ("remove" and "change" uevents also 85 85 happen, but don't need to rename network interfaces).</para> 86 86 </listitem> 87 87 <listitem> 88 <para><literal>DRIVERS=="?*"</literal> - This exists so that Udev will88 <para><literal>DRIVERS=="?*"</literal> - This exists so that udev will 89 89 ignore VLAN or bridge sub-interfaces (because these sub-interfaces do 90 90 not have drivers). These sub-interfaces are skipped because the name … … 97 97 <listitem> 98 98 <para><literal>ATTR{type}=="1"</literal> - This ensures the rule only 99 matches the primary interface in the case of certain wireless drivers ,99 matches the primary interface in the case of certain wireless drivers 100 100 which create multiple virtual interfaces. The secondary interfaces are 101 101 skipped for the same reason that VLAN and bridge sub-interfaces are … … 104 104 <listitem> 105 105 <para><literal>NAME</literal> - The value of this key is the name that 106 Udev will assign to this interface.</para>106 udev will assign to this interface.</para> 107 107 </listitem> 108 108 </itemizedlist> … … 134 134 the physical path to the CD or DVD device. Second, it can operate in 135 135 <quote>by-id</quote> mode (default for IDE and SCSI devices), where the 136 rules it creates depend on identification strings stored in the CD or DVD137 device itself. The path is determined by Udev's <command>path_id</command>136 rules it creates depend on identification strings stored on the CD or DVD 137 device itself. The path is determined by udev's <command>path_id</command> 138 138 script, and the identification strings are read from the hardware by its 139 139 <command>ata_id</command> or <command>scsi_id</command> programs, depending … … 160 160 should not use by-path persistence, because each time the device is plugged 161 161 into a new external port, its physical path will change. All 162 externally-connected devices will have this problem if you write Udev rules162 externally-connected devices will have this problem if you write udev rules 163 163 to recognize them by their physical path; the problem is not limited to CD 164 164 and DVD drives.</para></important> 165 165 166 <para>If you wish to see the values that the Udev scripts will use, then166 <para>If you wish to see the values that the udev scripts will use, then 167 167 for the appropriate CD-ROM device, find the corresponding directory under 168 168 <filename class="directory">/sys</filename> (e.g., this can be … … 183 183 <quote>by-id</quote> or <quote>by-path</quote>):</para> 184 184 185 <screen role="nodump"><userinput>sed - i -e 's/"write_cd_rules"/"write_cd_rules <replaceable>mode</replaceable>"/' \186 /etc/udev/rules.d/83-cdrom-symlinks.rules</userinput></screen>185 <screen role="nodump"><userinput>sed -e 's/"write_cd_rules"/"write_cd_rules <replaceable>mode</replaceable>"/' \ 186 -i /etc/udev/rules.d/83-cdrom-symlinks.rules</userinput></screen> 187 187 188 188 <para>Note that it is not necessary to create the rules files or symlinks 189 at this time ,because you have bind-mounted the host's190 <filename class="directory">/dev</filename> directory into the LFS system ,189 at this time because you have bind-mounted the host's 190 <filename class="directory">/dev</filename> directory into the LFS system 191 191 and we assume the symlinks exist on the host. The rules and symlinks will 192 192 be created the first time you boot your LFS system.</para> … … 194 194 <para>However, if you have multiple CD-ROM devices, then the symlinks 195 195 generated at that time may point to different devices than they point to on 196 your host ,because devices are not discovered in a predictable order. The196 your host because devices are not discovered in a predictable order. The 197 197 assignments created when you first boot the LFS system will be stable, so 198 198 this is only an issue if you need the symlinks on both systems to point to … … 213 213 <filename>/dev/video0</filename> refers to the camera and 214 214 <filename>/dev/video1</filename> refers to the tuner, and sometimes 215 after a reboot the order changes to the opposite one.215 after a reboot the order changes. 216 216 For all classes of hardware except sound cards and network cards, this is 217 fixable by creating Udev rules for custom persistent symlinks.217 fixable by creating udev rules for custom persistent symlinks. 218 218 The case of network cards is covered separately in 219 219 <xref linkend="ch-config-network"/>, and sound card configuration can … … 238 238 <literal> 239 239 # Persistent symlinks for webcam and tuner 240 KERNEL=="video*", ATTRS{idProduct}=="1910", ATTRS{idVendor}=="0d81", \ 241 SYMLINK+="webcam" 242 KERNEL=="video*", ATTRS{device}=="0x036f", ATTRS{vendor}=="0x109e", \ 243 SYMLINK+="tvtuner" 240 KERNEL=="video*", ATTRS{idProduct}=="1910", ATTRS{idVendor}=="0d81", SYMLINK+="webcam" 241 KERNEL=="video*", ATTRS{device}=="0x036f", ATTRS{vendor}=="0x109e", SYMLINK+="tvtuner" 244 242 </literal> 245 243 EOF</userinput></screen>
Note:
See TracChangeset
for help on using the changeset viewer.