Ticket #1804: udev-096.diff

File udev-096.diff, 4.5 KB (added by dnicholson@…, 18 years ago)

udev-096 changes

  • chapter06/udev.xml

     
    9797    <para>Udev's configuration is far from ideal by default, so install
    9898    the configuration files here:</para>
    9999
    100 <!-- FIXME: 90-bug.rules should be removed from the tarball once the book is released -->
    101100<screen><userinput>cp -v &udev-config;/[0-9]* /etc/udev/rules.d/</userinput></screen>
    102101
    103     <para>Now install a helper script that is not included in the main Udev
    104     tarball:</para>
    105 
    106 <screen><userinput>install -v -m 744 &udev-config;/write_cd_aliases /lib/udev/</userinput></screen>
    107 
    108102    <para>Install the documentation that explains how to create Udev rules:</para>
    109103
    110104<screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html \
    111105    /usr/share/doc/udev-&udev-version;/index.html</userinput></screen>
    112106
    113     <important>
    114 
    115       <para>When Udev is started by the LFS-Bootscripts, a replay of all kernel
    116       device events happens. These events tell Udev what devices exist.
    117       Sometimes the Udev bootscript doesn't wait long enough for
    118       <command>udevd</command> to process all of the replayed events and
    119       consequently the devices for those missed events are not created before the
    120       script exits. Since <command>udevd</command> is still running in the
    121       background, the devices will be created a few milliseconds later, but the
    122       next bootscript to run may require a device to exist before it has been
    123       created. To avoid such missed events, and to avoid hardcoding an overly
    124       long wait time, It is recommended that you run the following commands to
    125       aid the LFS development team in debugging these missed events and finding
    126       an acceptable solution more quickly.</para>
    127 
    128       <para>First, create a simple C file:</para>
    129 
    130 <screen><userinput>cat &gt; bug.c &lt;&lt; EOF
    131 <literal>/* Simple event recorder */
    132 #define _GNU_SOURCE
    133 #include &lt;sys/types.h&gt;
    134 #include &lt;sys/stat.h&gt;
    135 #include &lt;fcntl.h&gt;
    136 #include &lt;unistd.h&gt;
    137 #include &lt;stdlib.h&gt;
    138 #include &lt;argz.h&gt;
    139 int main(int argc, char * argv[])
    140 {
    141   char * envar;
    142   char * envz;
    143   size_t len;
    144   int bug;
    145   bug = open("/dev/bug", O_WRONLY | O_APPEND);
    146   if (bug == -1)
    147     return 0;
    148 
    149   /* Ignore everything USB-related to avoid spamming the list */
    150   envar = getenv("PHYSDEVPATH");
    151   if (envar &amp;&amp; strstr(envar, "usb"))
    152     return 0;
    153   envar = getenv("DEVPATH");
    154   if (envar &amp;&amp; strstr(envar, "usb"))
    155     return 0;
    156 
    157   setenv("_SEPARATOR", "-------------------------------", 1);
    158   argz_create(environ, &amp;envz, &amp;len);
    159   argz_stringify(envz, len, '\n');
    160   envz[len-1]='\n';
    161   write(bug, envz, len);
    162   close(bug);
    163   free(envz);
    164   return 0;
    165 }</literal>
    166 EOF</userinput></screen>
    167 
    168       <para>Now compile it:</para>
    169 
    170 <screen><userinput>gcc -o /lib/udev/bug bug.c</userinput></screen>
    171 
    172       <para>When booting the new LFS system, if any events are missed, a warning
    173       message will appear and a <filename>/dev/bugreport</filename> file will be
    174       created. The warning message will tell you where to send feedback.</para>
    175 
    176     </important>
    177 
    178107  </sect2>
    179108
    180109  <sect2 id="contents-udev" role="content">
  • packages.ent

     
    482482<!ENTITY texinfo-ch6-du "16.6 MB">
    483483<!ENTITY texinfo-ch6-sbu "0.2 SBU">
    484484
    485 <!ENTITY udev-version "092">
     485<!ENTITY udev-version "096">
    486486<!ENTITY udev-size "190 KB">
    487487<!ENTITY udev-url "&kernel;linux/utils/kernel/hotplug/udev-&udev-version;.tar.bz2">
    488 <!ENTITY udev-md5 "5e9ff419ac0132531990a7c5db80ef3e">
     488<!ENTITY udev-md5 "f4effef7807ce1dc91ab581686ef197b">
    489489<!ENTITY udev-home "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html">
    490490<!ENTITY udev-ch6-du "6.8 MB">
    491491<!ENTITY udev-ch6-sbu "0.1 SBU">
    492492
    493 <!ENTITY udev-config "udev-config-20060515">
     493<!ENTITY udev-config "udev-config-20060607-try2">
    494494<!ENTITY udev-config-size "4 KB">
     495<!-- Temporarily in Alexander's home dir
    495496<!ENTITY udev-config-url "http://downloads.linuxfromscratch.org/&udev-config;.tar.bz2">
    496 <!ENTITY udev-config-md5 "0caf192fcbcc535f1201df838a675c50">
     497-->
     498<!ENTITY udev-config-url "http://www.linuxfromscratch.org/~alexander/udev-config/&udev-config;.tar.bz2">
     499<!ENTITY udev-config-md5 "f31c14bd181dfecb95c2f0a06f938b86">
    497500<!ENTITY udev-config-home " ">
    498501
    499502<!ENTITY util-linux-version "2.12r">