Changeset 5cef314
- Timestamp:
- 10/02/2012 10:40:39 PM (12 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, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, 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:
- 12574f2
- Parents:
- ce935eb
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/bash.xml
rce935eb r5cef314 87 87 a shell:</para> 88 88 89 <screen><userinput remap="install">ln - vsbash /tools/bin/sh</userinput></screen>89 <screen><userinput remap="install">ln -sv bash /tools/bin/sh</userinput></screen> 90 90 91 91 </sect2> -
chapter05/gcc-pass1.xml
rce935eb r5cef314 239 239 <filename>libgcc_eh.a</filename>:</para> 240 240 241 <screen><userinput remap="install">ln - vslibgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`</userinput></screen>241 <screen><userinput remap="install">ln -sv libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`</userinput></screen> 242 242 243 243 </sect2> -
chapter05/gcc-pass2.xml
rce935eb r5cef314 211 211 which C compiler to install:</para> 212 212 213 <screen><userinput remap="install">ln - vsgcc /tools/bin/cc</userinput></screen>213 <screen><userinput remap="install">ln -sv gcc /tools/bin/cc</userinput></screen> 214 214 215 215 <caution> -
chapter07/udev.xml
rce935eb r5cef314 77 77 <title>Sysfs</title> 78 78 79 <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was80 mentioned briefly above. One may wonder how <systemitem79 <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem 80 was mentioned briefly above. One may wonder how <systemitem 81 81 class="filesystem">sysfs</systemitem> knows about the devices present on 82 82 a system and what device numbers should be used for them. Drivers that 83 have been compiled into the kernel directly register their objects with 84 <systemitem class="filesystem">sysfs</systemitem> as they are detected by 85 the kernel. For drivers compiled as modules, this registration will happen 86 when the module is loaded. Once the <systemitem 87 class="filesystem">sysfs</systemitem> filesystem is mounted (on <filename 88 class="directory">/sys</filename>), data which the built-in drivers 89 registered with <systemitem class="filesystem">sysfs</systemitem> are 90 available to userspace processes and to <command>udevd</command> for 91 processing (including modifications to device nodes).</para> 92 93 </sect3> 94 95 <sect3> 96 <title>Udev Bootscripts</title> 97 98 <para>The <command>/etc/rc.d/init.d/udev</command> initscript takes care 99 of creating device nodes when Linux is booted. The script unsets the 100 uevent handler from the default of <command>/sbin/hotplug</command>. 101 This is done because the kernel no longer needs to call out to an 102 external binary. Instead <command>udevd</command> will listen on a 103 netlink socket for uevents that the kernel raises. Next, the bootscript 104 copies any static device nodes that exist in <filename 105 class="directory">/lib/udev/devices</filename> to <filename 106 class="directory">/dev</filename>. This is necessary because some 107 devices, directories, and symlinks are needed before the dynamic device 108 handling processes are available during the early stages of booting a 109 system, or are required by <command>udevd</command> itself. Creating 110 static device nodes in <filename 111 class="directory">/lib/udev/devices</filename> also provides an easy 112 workaround for devices that are not supported by the dynamic device 113 handling infrastructure. The bootscript then starts the Udev daemon, 114 <command>udevd</command>, which will act on any uevents it receives. 115 Finally, the bootscript forces the kernel to replay uevents for any 116 devices that have already been registered and then waits for 117 <command>udevd</command> to handle them.</para> 118 119 <para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes 120 care of re-triggering events for subsystems whose rules may rely on 121 filesystems that are not mounted until the <command>mountfs</command> 122 script is run (in particular, /usr and /var may cause this). This script 123 runs after the <command>mountfs</command> script, so those rules (if 124 re-triggered) should succeed the second time around. It is configured 125 from the <filename>/etc/sysconfig/udev_retry</filename> file; any words 126 in this file other than comments are considered subsystem names to 127 trigger at retry time. (To find the subsystem of a device, use 128 <command>udevadm info --attribute-walk</command>.)</para> 83 have been compiled into the kernel directly register their objects with a 84 <systemitem class="filesystem">sysfs</systemitem> (devtmpfs internally) 85 as they are detected by the kernel. For drivers compiled as modules, this 86 registration will happen when the module is loaded. Once the <systemitem 87 class="filesystem">sysfs</systemitem> filesystem is mounted (on /sys), 88 data which the drivers register with <systemitem 89 class="filesystem">sysfs</systemitem> are available to userspace 90 processes and to udevd for processing (including modifications to device 91 nodes).</para> 129 92 130 93 </sect3> … … 133 96 <title>Device Node Creation</title> 134 97 135 <para>In recent version of udev, <command>udevd</command> no longer 136 creates device files in <filename class="directory">/dev</filename>. 137 Instead, this must be handled in the kernel, by the <systemitem 98 <para>Device files are created by the kernel by the <systemitem 138 99 class="filesystem">devtmpfs</systemitem> filesystem. Any driver that 139 100 wishes to register a device node will go through <systemitem … … 141 102 When a <systemitem class="filesystem">devtmpfs</systemitem> instance is 142 103 mounted on <filename class="directory">/dev</filename>, the device node 143 will initially be created with a fixed name, permissions, and owner.</para> 104 will initially be created with a fixed name, permissions, and 105 owner.</para> 144 106 145 107 <para>A short time later, the kernel will send a uevent to <command> … … 148 110 class="directory">/lib/udev/rules.d</filename>, and <filename 149 111 class="directory">/run/udev/rules.d</filename> directories, <command> 150 udevd</command> will create additional symlinks to the device node, 151 orchange its permissions, owner, or group, or modify the internal152 <command>udevd</command> database entry for that object.</para>112 udevd</command> will create additional symlinks to the device node, or 113 change its permissions, owner, or group, or modify the internal 114 <command>udevd</command> database entry (name) for that object.</para> 153 115 154 116 <para>The rules in these three directories are numbered in a similar 155 fashion to the LFS-Bootscripts package ,and all three directories are117 fashion to the LFS-Bootscripts package and all three directories are 156 118 merged together. If <command>udevd</command> can't find a rule for the 157 119 device it is creating, it will leave the permissions and ownership at 158 120 whatever <systemitem class="filesystem">devtmpfs</systemitem> used 159 initially.</para> 121 initially.</para> </sect3> 122 123 <sect3> 124 <title>Udev Bootscripts</title> 125 126 <para>The first LFS bootscript, 127 <filename>/etc/init.d/mountvirtfs</filename> will copy any devices 128 located in <filename class="directory">/lib/udev/devices</filename> to 129 <filename class="directory">/dev</filename>. This is necessary because 130 some devices, directories, and symlinks are needed before the dynamic 131 device handling processes are available during the early stages of 132 booting a system, or are required by <command>udevd</command> itself. 133 Creating static device nodes in <filename 134 class="directory">/lib/udev/devices</filename> also provides an easy 135 workaround for devices that are not supported by the dynamic device 136 handling infrastructure.</para> 137 138 <para>The <filename>/etc/rc.d/init.d/udev</filename> initscript starts 139 <command>udevd</command>, triggers any "coldplug" devices that have 140 already been created by the kernel and waits for any rules to complete. 141 The script also unsets the uevent handler from the default of 142 <filename>/sbin/hotplug </filename>. This is done because the kernel no 143 longer needs to call out to an external binary. Instead 144 <command>udevd</command> will listen on a netlink socket for uevents that 145 the kernel raises.</para> 146 147 <para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes 148 care of re-triggering events for subsystems whose rules may rely on 149 filesystems that are not mounted until the <command>mountfs</command> 150 script is run (in particular, <filename class="directory">/usr</filename> 151 and <filename class="directory">/var</filename> may cause this). This 152 script runs after the <command>mountfs</command> script, so those rules 153 (if re-triggered) should succeed the second time around. It is 154 configured from the <filename>/etc/sysconfig/udev_retry</filename> file; 155 any words in this file other than comments are considered subsystem names 156 to trigger at retry time. To find the subsystem of a device, use 157 <command>udevadm info --attribute-walk <device></command> where 158 <device> is a an absolure path in /dev or /sys such as /dev/sr0 or 159 /sys/class/rtc.</para> 160 160 161 161 </sect3> … … 369 369 </listitem> 370 370 371 <!-- No longer available 371 372 <listitem> 372 373 <para>Pointers to further reading … … 374 375 </para> 375 376 </listitem> 376 377 --> 377 378 </itemizedlist> 378 379
Note:
See TracChangeset
for help on using the changeset viewer.