Changeset 61e63d3 for chapter07


Ignore:
Timestamp:
05/23/2008 01:45:45 AM (16 years ago)
Author:
Bryan Kadzban <bryan@…>
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, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 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:
9faa3e2
Parents:
1c6f1c1
Message:

Upgrade Udev to 122, udev-config to 20080522, and lfs-bootscripts to 20080522. Replace "write_net_rules all_interfaces" with a "udevadm test" loop. Fix several typos. Remove the usb_id segfault patch, as it's included in Udev now. Add /lib/udev/devices/kmsg, as udevd uses /dev/kmsg to log a message at startup. Replace udevtrigger/udevinfo with "udevadm trigger" and "udevadm info" in the text.

Should fix #2057, #2079, #2170, and #2186.

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

Location:
chapter07
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chapter07/network.xml

    r1c6f1c1 r61e63d3  
    4040    same devices at every boot, including the first:</para>
    4141
    42 <screen><userinput>/lib/udev/write_net_rules all_interfaces</userinput></screen>
     42<screen><userinput>for NIC in /sys/class/net/* ; do
     43    INTERFACE=${NIC##*/} udevadm test --action=add --subsystem=net $NIC
     44done</userinput></screen>
    4345
    4446    <para>Now, inspect the <filename>/etc/udev/rules.d/70-persistent-net.rules</filename>
     
    4951    <para>The file begins with a comment block followed by two lines for each
    5052    NIC. The first line for each NIC is a commented description showing its
    51     hardware IDs (e.g. its PC vendor and device IDs, if it's a PCI card),
     53    hardware IDs (e.g. its PCI vendor and device IDs, if it's a PCI card),
    5254    along with its driver in parentheses, if the driver can be found. Neither
    5355    the hardware ID nor the driver is used to determine which name to give an
    54     interface. The second line is the Udev rule that matches this NIC and
    55     actually assigns it a name.</para>
     56    interface; this information is only for reference. The second line is the
     57    Udev rule that matches this NIC and actually assigns it a name.</para>
    5658
    5759    <para>All Udev rules are made up of several keys, separated by commas and
    58     optional whitespace. This rule's keys and an explanations of each of them
     60    optional whitespace. This rule's keys and an explanation of each of them
    5961    are as follows:</para>
    6062
     
    6365        <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore
    6466        devices that are not network cards.</para>
     67      </listitem>
     68      <listitem>
     69        <para><literal>ACTION=="add"</literal> - This tells Udev to ignore this
     70        rule for a uevent that isn't an add ("remove" and "change" uevents also
     71        happen, but don't need to rename network interfaces).</para>
    6572      </listitem>
    6673      <listitem>
     
    7178      </listitem>
    7279      <listitem>
    73         <para><literal>ATTRS{type}=="1"</literal> - Optional. This key will
    74         only be added if this NIC is a wireless NIC whose driver creates
    75         multiple virtual interfaces; it ensures the rule only matches the
    76         primary interface. The secondary interfaces are not matched for the
    77         same reason that VLAN and bridge sub-interfaces are not matched: there
    78         would be a name collision.</para>
    79       </listitem>
    80       <listitem>
    81         <para><literal>ATTRS{address}</literal> - The value of this key is the
     80        <para><literal>ATTR{address}</literal> - The value of this key is the
    8281        NIC's MAC address.</para>
     82      </listitem>
     83      <listitem>
     84        <para><literal>ATTR{type}=="1"</literal> - This ensures the rule only
     85        matches the primary interface in the case of certain wireless drivers,
     86        which create multiple virtual interfaces. The secondary interfaces are
     87        skipped for the same reason that VLAN and bridge sub-interfaces are
     88        skipped: there would be a name collision otherwise.</para>
     89      </listitem>
     90      <listitem>
     91        <para><literal>KERNEL=="eth*"</literal> - This key was added to the
     92        Udev rule generator to handle machines that have multiple network
     93        interfaces, all with the same MAC address (the PS3 is one such
     94        machine).  If the independent interfaces have different basenames,
     95        this key will allow Udev to tell them apart.  This is generally not
     96        necessary for most Linux From Scratch users, but does not hurt.</para>
    8397      </listitem>
    8498      <listitem>
  • chapter07/symlinks.xml

    r1c6f1c1 r61e63d3  
    6464    run a command similar to the following:</para>
    6565
    66 <screen role="nodump"><userinput>udevtest /sys/block/hdd</userinput></screen>
     66<screen role="nodump"><userinput>udevadm test /sys/block/hdd</userinput></screen>
    6767
    6868    <para>Look at the lines containing the output of various *_id programs.
     
    125125    vendor and product IDs and/or serial numbers work):</para>
    126126
    127 <screen role="nodump"><userinput>udevinfo -a -p /sys/class/video4linux/video0</userinput></screen>
     127<screen role="nodump"><userinput>udevadm info -a -p /sys/class/video4linux/video0</userinput></screen>
    128128
    129129    <para>Then write rules that create the symlinks, e.g.:</para>
  • chapter07/udev.xml

    r1c6f1c1 r61e63d3  
    106106      class="directory">/dev</filename>. This is necessary because some devices,
    107107      directories, and symlinks are needed before the dynamic device handling
    108       processes are available during the early stages of booting a system.
    109       Creating static device nodes in <filename
    110       class="directory">/lib/udev/devices</filename> also provides an easy
    111       workaround for devices that are not supported by the dynamic device
    112       handling infrastructure. The bootscript then starts the Udev daemon,
    113       <command>udevd</command>, which will act on any uevents it receives.
    114       Finally, the bootscript forces the kernel to replay uevents for any
    115       devices that have already been registered and then waits for
     108      processes are available during the early stages of booting a system, or
     109      are required by <command>udevd</command> itself.  Creating static device
     110      nodes in <filename class="directory">/lib/udev/devices</filename> also
     111      provides an easy workaround for devices that are not supported by the
     112      dynamic device handling infrastructure. The bootscript then starts the
     113      Udev daemon, <command>udevd</command>, which will act on any uevents it
     114      receives. Finally, the bootscript forces the kernel to replay uevents for
     115      any devices that have already been registered and then waits for
    116116      <command>udevd</command> to handle them.</para>
    117117
     
    156156      might contain the string
    157157      <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>.
    158       The rules that LFS installs will cause <command>udevd</command> to call
    159       out to <command>/sbin/modprobe</command> with the contents of the
    160       <envar>MODALIAS</envar> uevent environment variable (that should be the
     158      The default rules provided with Udev will cause <command>udevd</command>
     159      to call out to <command>/sbin/modprobe</command> with the contents of the
     160      <envar>MODALIAS</envar> uevent environment variable (which should be the
    161161      same as the contents of the <filename>modalias</filename> file in sysfs),
    162162      thus loading all modules whose aliases match this string after wildcard
     
    269269      example, a poorly-writen rule can match both a SCSI disk (as desired)
    270270      and the corresponding SCSI generic device (incorrectly) by vendor.
    271       Find the offending rule and make it more specific.</para>
     271      Find the offending rule and make it more specific, with the help of the
     272      <command>udevadm info</command> command.</para>
    272273
    273274    </sect3>
     
    282283      <systemitem class="filesystem">sysfs</systemitem> attribute and appending
    283284      it to the <filename>/etc/udev/rules.d/10-wait_for_sysfs.rules</filename>
    284       file. Please notify the LFS Development list if you do so and it
    285       helps.</para>
     285      file (create this file if it does not exist). Please notify the LFS
     286      Development list if you do so and it helps.</para>
    286287
    287288    </sect3>
Note: See TracChangeset for help on using the changeset viewer.