Changeset 5cef314


Ignore:
Timestamp:
10/02/2012 10:40:39 PM (12 years ago)
Author:
Bruce Dubbs <bdubbs@…>
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
Message:

Update udev explanation.
Be consistent with ln options.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10015 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • chapter05/bash.xml

    rce935eb r5cef314  
    8787    a shell:</para>
    8888
    89 <screen><userinput remap="install">ln -vs bash /tools/bin/sh</userinput></screen>
     89<screen><userinput remap="install">ln -sv bash /tools/bin/sh</userinput></screen>
    9090
    9191  </sect2>
  • chapter05/gcc-pass1.xml

    rce935eb r5cef314  
    239239    <filename>libgcc_eh.a</filename>:</para>
    240240
    241 <screen><userinput remap="install">ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&amp;_eh/'`</userinput></screen>
     241<screen><userinput remap="install">ln -sv libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&amp;_eh/'`</userinput></screen>
    242242
    243243  </sect2>
  • chapter05/gcc-pass2.xml

    rce935eb r5cef314  
    211211    which C compiler to install:</para>
    212212
    213 <screen><userinput remap="install">ln -vs gcc /tools/bin/cc</userinput></screen>
     213<screen><userinput remap="install">ln -sv gcc /tools/bin/cc</userinput></screen>
    214214
    215215  <caution>
  • chapter07/udev.xml

    rce935eb r5cef314  
    7777      <title>Sysfs</title>
    7878
    79       <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was
    80       mentioned briefly above. One may wonder how <systemitem
     79      <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem
     80      was mentioned briefly above. One may wonder how <systemitem
    8181      class="filesystem">sysfs</systemitem> knows about the devices present on
    8282      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>
    12992
    13093    </sect3>
     
    13396      <title>Device Node Creation</title>
    13497
    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
    13899      class="filesystem">devtmpfs</systemitem> filesystem.  Any driver that
    139100      wishes to register a device node will go through <systemitem
     
    141102      When a <systemitem class="filesystem">devtmpfs</systemitem> instance is
    142103      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>
    144106
    145107      <para>A short time later, the kernel will send a uevent to <command>
     
    148110      class="directory">/lib/udev/rules.d</filename>, and <filename
    149111      class="directory">/run/udev/rules.d</filename> directories, <command>
    150       udevd</command> will create additional symlinks to the device node,
    151       or change its permissions, owner, or group, or modify the internal
    152       <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>
    153115
    154116      <para>The rules in these three directories are numbered in a similar
    155       fashion to the LFS-Bootscripts package, and all three directories are
     117      fashion to the LFS-Bootscripts package and all three directories are
    156118      merged together. If <command>udevd</command> can't find a rule for the
    157119      device it is creating, it will leave the permissions and ownership at
    158120      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 &lt;device&gt;</command> where
     158      &lt;device&gt; is a an absolure path in /dev or /sys such as /dev/sr0 or
     159      /sys/class/rtc.</para>
    160160
    161161    </sect3>
     
    369369      </listitem>
    370370
     371<!--  No longer available
    371372      <listitem>
    372373        <para>Pointers to further reading
     
    374375        </para>
    375376      </listitem>
    376 
     377-->
    377378    </itemizedlist>
    378379
Note: See TracChangeset for help on using the changeset viewer.