Changeset 8545

Show
Ignore:
Timestamp:
05/22/08 19:45:45 (6 months ago)
Author:
bryan
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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/BOOK/chapter01/changelog.xml

    r8541 r8545  
    3636    </listitem> 
    3737--> 
     38 
     39    <listitem> 
     40      <para>2008-05-22</para> 
     41      <itemizedlist> 
     42        <listitem> 
     43          <para>[bryan] - Updated Udev to 122, udev-config to 
     44          20080522, and lfs-bootscripts to 20080522.  Also made 
     45          persistent-net rules able to be pre-generated, using 
     46          udevadm test.  Fixes #2057, #2079 (I think), #2170, and 
     47          #2186.</para> 
     48        </listitem> 
     49      </itemizedlist> 
     50    </listitem> 
    3851 
    3952    <listitem> 
  • trunk/BOOK/chapter01/whatsnew.xml

    r8540 r8545  
    180180      <para>Texinfo &texinfo-version;</para> 
    181181    </listitem> 
    182     <!--<listitem> 
     182    <listitem> 
    183183      <para>Udev &udev-version;</para> 
    184     </listitem>--> 
     184    </listitem> 
    185185    <listitem> 
    186186      <para>&udev-config;</para> 
     
    235235    <listitem> 
    236236      <para>&readline-fixes-patch;</para> 
    237     </listitem> 
    238  
    239     <listitem> 
    240       <para>&udev-usbid-patch;</para> 
    241237    </listitem> 
    242238 
  • trunk/BOOK/chapter03/patches.xml

    r8514 r8545  
    189189 
    190190    <varlistentry> 
    191       <term>Udev usb_id Segfault Patch - <token>&udev-usbid-patch-size;</token>:</term> 
    192       <listitem> 
    193         <para>Download: <ulink url="&patches-root;&udev-usbid-patch;"/></para> 
    194         <para>MD5 sum: <literal>&udev-usbid-md5;</literal></para> 
    195       </listitem> 
    196     </varlistentry> 
    197  
    198  
    199     <varlistentry> 
    200191      <term>Vim Fixes Patch - <token>&vim-fixes-patch-size;</token>:</term> 
    201192      <listitem> 
  • trunk/BOOK/chapter06/udev.xml

    r8421 r8545  
    4848 
    4949    <para>Create some devices and directories that Udev cannot handle due to 
    50     them being required very early in the boot process:</para> 
     50    them being required very early in the boot process, or by Udev itself:</para> 
    5151 
    5252<screen><userinput remap="install">install -dv /lib/{firmware,udev/devices/{pts,shm}} 
    5353mknod -m0666 /lib/udev/devices/null c 1 3 
     54mknod -m0600 /lib/udev/devices/kmsg c 1 11 
    5455ln -sv /proc/self/fd /lib/udev/devices/fd 
    5556ln -sv /proc/self/fd/0 /lib/udev/devices/stdin 
     
    5859ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen> 
    5960 
    60     <para><command>usb_id</command> is known to segfault under certain kernel 
    61     configurations.  Fix the issue by applying the following patch:</para> 
    62  
    63 <screen><userinput remap="pre">patch -Np1 -i ../&udev-usbid-patch;</userinput></screen> 
    64  
    6561    <para>Compile the package:</para> 
    6662 
     
    105101    </variablelist> 
    106102 
    107     <para>Udev has to be configured in order to work properly, as it only 
    108     installs a few configuration files by default. First install the 
    109     commonly-used rules files provided by Udev:</para> 
    110  
    111 <screen><userinput remap="install">cp -v etc/udev/rules.d/[0-9]* /etc/udev/rules.d/</userinput></screen> 
    112  
    113     <para>Now install the LFS-specific rules files:</para> 
     103    <para>Udev has to be configured in order to work properly, as its default 
     104    configuration does not cover all devices. Install the (LFS-specific) 
     105    custom rules files:</para> 
    114106 
    115107<screen><userinput remap="install">cd &udev-config; 
     
    130122 
    131123<screen><userinput remap="install">cd .. 
     124install -dv /usr/share/doc/udev-&udev-version; 
    132125install -m644 -v docs/writing_udev_rules/index.html \ 
    133126    /usr/share/doc/udev-&udev-version;/index.html</userinput></screen> 
     
    144137 
    145138      <seglistitem> 
    146         <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware.sh, 
    147         path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle, 
    148         udevtest, udevtrigger, usb_id, vol_id, write_cd_rules, and 
    149         write_net_rules</seg> 
     139        <seg>ata_id, cdrom_id, collect, create_floppy_devices, edd_id, 
     140        firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd, 
     141        usb_id, vol_id, write_cd_rules, and write_net_rules</seg> 
    150142        <seg>libvolume_id</seg> 
    151143        <seg>/etc/udev</seg> 
     
    180172      </varlistentry> 
    181173 
     174      <varlistentry id="collect"> 
     175        <term><command>collect</command></term> 
     176        <listitem> 
     177          <para>Given an ID for the current uevent and a list of 
     178          IDs (for all target uevents), registers the current ID 
     179          and indicates whether all target IDs have been registered</para> 
     180          <indexterm zone="ch-system-udev collect"> 
     181            <primary sortas="b-collect">collect</primary> 
     182          </indexterm> 
     183        </listitem> 
     184      </varlistentry> 
     185 
    182186      <varlistentry id="create_floppy_devices"> 
    183187        <term><command>create_floppy_devices</command></term> 
     
    206210          <indexterm zone="ch-system-udev firmware.sh"> 
    207211            <primary sortas="b-firmware.sh">firmware.sh</primary> 
     212          </indexterm> 
     213        </listitem> 
     214      </varlistentry> 
     215 
     216      <varlistentry id="fstab_import"> 
     217        <term><command>fstab_import</command></term> 
     218        <listitem> 
     219          <para>Finds an entry in <filename>/etc/fstab</filename> that 
     220          matches the current device, and provides its information to 
     221          Udev</para> 
     222          <indexterm zone="ch-system-udev fstab_import"> 
     223            <primary sortas="b-fstab_import">fstab_import</primary> 
    208224          </indexterm> 
    209225        </listitem> 
     
    233249      </varlistentry> 
    234250 
    235       <varlistentry id="udevcontrol"> 
    236         <term><command>udevcontrol</command></term> 
    237         <listitem> 
    238           <para>Configures a number of options for the running 
    239           <command>udevd</command> daemon, such as the log level.</para> 
    240           <indexterm zone="ch-system-udev udevcontrol"> 
    241             <primary sortas="b-udevcontrol">udevcontrol</primary> 
     251      <varlistentry id="udevadm"> 
     252        <term><command>udevadm</command></term> 
     253        <listitem> 
     254          <para>Generic udev administration tool: controls the udevd daemon, 
     255          provides info from the Udev database, monitors uevents, waits for 
     256          uevents to finish, tests Udev configuration, and triggers uevents 
     257          for a given device</para> 
     258          <indexterm zone="ch-system-udev udevadm"> 
     259            <primary sortas="b-udevadm">udevadm</primary> 
    242260          </indexterm> 
    243261        </listitem> 
     
    256274      </varlistentry> 
    257275 
    258       <varlistentry id="udevinfo"> 
    259         <term><command>udevinfo</command></term> 
    260         <listitem> 
    261           <para>Allows users to query the Udev database for 
    262           information on any device currently present on the system; it also 
    263           provides a way to query any device in the <systemitem 
    264           class="filesystem">sysfs</systemitem> tree to help create udev 
    265           rules</para> 
    266           <indexterm zone="ch-system-udev udevinfo"> 
    267             <primary sortas="b-udevinfo">udevinfo</primary> 
    268           </indexterm> 
    269         </listitem> 
    270       </varlistentry> 
    271  
    272       <varlistentry id="udevmonitor"> 
    273         <term><command>udevmonitor</command></term> 
    274         <listitem> 
    275           <para>Prints the event received from the kernel and the environment 
    276           which Udev sends out after rule processing</para> 
    277           <indexterm zone="ch-system-udev udevmonitor"> 
    278             <primary sortas="b-udevmonitor">udevmonitor</primary> 
    279           </indexterm> 
    280         </listitem> 
    281       </varlistentry> 
    282  
    283       <varlistentry id="udevsettle"> 
    284         <term><command>udevsettle</command></term> 
    285         <listitem> 
    286           <para>Watches the Udev event queue and exits if all current uevents 
    287           have been handled</para> 
    288           <indexterm zone="ch-system-udev udevsettle"> 
    289             <primary sortas="b-udevsettle">udevsettle</primary> 
    290           </indexterm> 
    291         </listitem> 
    292       </varlistentry> 
    293  
    294       <varlistentry id="udevtest"> 
    295         <term><command>udevtest</command></term> 
    296         <listitem> 
    297           <para>Simulates a uevent for the given device, and prints out the 
    298           name of the node the real <command>udevd</command> would have created, 
    299           or the name of the renamed network interface</para> 
    300           <indexterm zone="ch-system-udev udevtest"> 
    301             <primary sortas="b-udevtest">udevtest</primary> 
    302           </indexterm> 
    303         </listitem> 
    304       </varlistentry> 
    305  
    306       <varlistentry id="udevtrigger"> 
    307         <term><command>udevtrigger</command></term> 
    308         <listitem> 
    309           <para>Triggers kernel device uevents to be replayed</para> 
    310           <indexterm zone="ch-system-udev udevtrigger"> 
    311             <primary sortas="b-udevtrigger">udevtrigger</primary> 
    312           </indexterm> 
    313         </listitem> 
    314       </varlistentry> 
    315  
    316276      <varlistentry id="usb_id"> 
    317277        <term><command>usb_id</command></term> 
  • trunk/BOOK/chapter07/network.xml

    r8299 r8545  
    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> 
  • trunk/BOOK/chapter07/symlinks.xml

    r8426 r8545  
    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> 
  • trunk/BOOK/chapter07/udev.xml

    r7970 r8545  
    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 <filenam
    110       class="directory">/lib/udev/devices</filename> also provides an easy 
    111       workaround for devices that are not supported by the dynamic devic
    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 devic
     110      nodes in <filename class="directory">/lib/udev/devices</filename> also 
     111      provides an easy workaround for devices that are not supported by th
     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> 
  • trunk/BOOK/general.ent

    r8536 r8545  
    11<?xml version="1.0" encoding="ISO-8859-1"?> 
    2 <!ENTITY version "SVN-20080423"> 
    3 <!ENTITY releasedate "April 23, 2008"> 
     2<!ENTITY version "SVN-20080522"> 
     3<!ENTITY releasedate "May 22, 2008"> 
    44<!ENTITY milestone "7.0"> 
    55<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" --> 
  • trunk/BOOK/packages.ent

    r8540 r8545  
    284284<!ENTITY less-ch6-sbu "0.1 SBU"> 
    285285 
    286 <!ENTITY lfs-bootscripts-version "20070813"> 
    287 <!ENTITY lfs-bootscripts-size "39 KB"> 
     286<!ENTITY lfs-bootscripts-version "20080522"> 
     287<!ENTITY lfs-bootscripts-size "42 KB"> 
    288288<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2"> 
    289 <!ENTITY lfs-bootscripts-md5 "0ecbdd3b774d519fc535a0a595aa5b86"> 
     289<!ENTITY lfs-bootscripts-md5 "2f29eb04b3373de58b770e3946575751"> 
    290290<!ENTITY lfs-bootscripts-home " "> 
    291291<!ENTITY lfs-bootscripts-ch7-du "0.4 MB"> 
     
    489489<!ENTITY texinfo-ch6-sbu "0.2 SBU"> 
    490490 
    491 <!ENTITY udev-version "113"> 
    492 <!ENTITY udev-size "191 KB"> 
     491<!ENTITY udev-version "122"> 
     492<!ENTITY udev-size "207 KB"> 
    493493<!ENTITY udev-url "&kernel;linux/utils/kernel/hotplug/udev-&udev-version;.tar.bz2"> 
    494 <!ENTITY udev-md5 "cb9a227206b9d85ae8cfc88fc51c1710"> 
     494<!ENTITY udev-md5 "aca509d0a286c06d897f9de67f527ace"> 
    495495<!ENTITY udev-home "&kernel;linux/utils/kernel/hotplug/udev.html"> 
    496 <!ENTITY udev-ch6-du "5.8 MB"> 
     496<!ENTITY udev-ch6-du "7.6 MB"> 
    497497<!ENTITY udev-ch6-sbu "0.1 SBU"> 
    498498 
    499 <!ENTITY udev-config "udev-config-20070731"> 
     499<!ENTITY udev-config "udev-config-20080522"> 
    500500<!ENTITY udev-config-size "13 KB"> 
    501501<!ENTITY udev-config-url "&downloads-root;&udev-config;.tar.bz2"> 
    502 <!ENTITY udev-config-md5 "49c72e712f38c18884bd11a9a3b7e968"> 
     502<!ENTITY udev-config-md5 "cb5126322dacf38fe1770c28119208d5"> 
    503503<!ENTITY udev-config-home " "> 
    504504 
  • trunk/BOOK/patches.ent

    r8514 r8545  
    105105 
    106106 
    107 <!ENTITY udev-usbid-patch "udev-&udev-version;-usb_id-1.patch"> 
    108 <!ENTITY udev-usbid-md5 "247614818827422b99672ea8bf3909ec"> 
    109 <!ENTITY udev-usbid-patch-size "3.2 KB"> 
    110  
    111  
    112107<!ENTITY vim-fixes-patch "vim-&vim-version;-fixes-6.patch"> 
    113108<!ENTITY vim-fixes-patch-md5 "a1e9ed80bac0ac8175bc3ed89867ca2e">