Fix the udev_retry script, and add an explanation

for how to configure it.


git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9614 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Bruce Dubbs 2011-10-06 15:35:49 +00:00
parent b777a9ed50
commit 2a1c1e03a4
7 changed files with 67 additions and 28 deletions

View File

@ -1,4 +1,11 @@
2100-09-18 2011-10-06 Bryan Kadzban <bryan@linuxfromscratch.org>
* Add configuration for udev_retry, and remove --type=failed (which does
not work with recent udev versions anyway, since no events can possibly
trigger it). Start with just the "rtc" subsystem. BLFS should eventually
add "sound" to this file, and perhaps others.
2011-09-18
* Review and update of changes made in previous change. * Review and update of changes made in previous change.
** Rename /etc/sysconfig/init_params to /etc/sysconfig/rc.site. ** Rename /etc/sysconfig/init_params to /etc/sysconfig/rc.site.
** Move network services to /lib/services. ** Move network services to /lib/services.

View File

@ -60,6 +60,9 @@ files: create-dirs
if [ ! -f ${EXTDIR}/sysconfig/modules ]; then \ if [ ! -f ${EXTDIR}/sysconfig/modules ]; then \
install -m ${CONFMODE} lfs/sysconfig/modules ${EXTDIR}/sysconfig/ ;\ install -m ${CONFMODE} lfs/sysconfig/modules ${EXTDIR}/sysconfig/ ;\
fi fi
if [ ! -f ${EXTDIR}/sysconfig/udev_retry ]; then \
install -m ${CONFMODE} lfs/sysconfig/udev_retry ${EXTDIR}/sysconfig/ ;\
fi
if [ ! -f ${EXTDIR}/sysconfig/rc ]; then \ if [ ! -f ${EXTDIR}/sysconfig/rc ]; then \
install -m ${CONFMODE} lfs/sysconfig/rc ${EXTDIR}/sysconfig/ ;\ install -m ${CONFMODE} lfs/sysconfig/rc ${EXTDIR}/sysconfig/ ;\
fi fi

View File

@ -7,6 +7,7 @@
# Authors : Alexander E. Patrakov # Authors : Alexander E. Patrakov
# DJ Lucas - dj@linuxfromscratch.org # DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# Bryan Kadzban -
# #
# Version : LFS 7.0 # Version : LFS 7.0
# #
@ -44,8 +45,14 @@ case "${1}" in
rm -f $file rm -f $file
done done
# Re-trigger the failed uevents in hope they will succeed now # Re-trigger the uevents that may have failed,
/sbin/udevadm trigger --type=failed --action=add # in hope they will succeed now
/bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \
while read line ; do
for subsystem in $line ; do
/sbin/udevadm trigger --subsystem-match=$subsystem --action=add
done
done
# Now wait for udevd to process the uevents we triggered # Now wait for udevd to process the uevents we triggered
/sbin/udevadm settle /sbin/udevadm settle

View File

@ -36,6 +36,16 @@
</listitem> </listitem>
--> -->
<listitem>
<para>2011-10-06</para>
<itemizedlist>
<listitem>
<para>[bryan] - Fix the udev_retry script, and add an explanation
for how to configure it.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem> <listitem>
<para>2011-10-05</para> <para>2011-10-05</para>
<itemizedlist> <itemizedlist>

View File

@ -93,40 +93,52 @@
</sect3> </sect3>
<sect3> <sect3>
<title>Udev Bootscript</title> <title>Udev Bootscripts</title>
<para>The <command>/etc/rc.d/init.d/udev</command> initscript takes care of creating <para>The <command>/etc/rc.d/init.d/udev</command> initscript takes care
device nodes when Linux is booted. The script unsets the uevent handler of creating device nodes when Linux is booted. The script unsets the
from the default of <command>/sbin/hotplug</command>. This is done uevent handler from the default of <command>/sbin/hotplug</command>.
because the kernel no longer needs to call out to an external binary. This is done because the kernel no longer needs to call out to an
Instead <command>udevd</command> will listen on a netlink socket for external binary. Instead <command>udevd</command> will listen on a
uevents that the kernel raises. Next, the bootscript copies any static netlink socket for uevents that the kernel raises. Next, the bootscript
device nodes that exist in <filename copies any static device nodes that exist in <filename
class="directory">/lib/udev/devices</filename> to <filename class="directory">/lib/udev/devices</filename> to <filename
class="directory">/dev</filename>. This is necessary because some devices, class="directory">/dev</filename>. This is necessary because some
directories, and symlinks are needed before the dynamic device handling devices, directories, and symlinks are needed before the dynamic device
processes are available during the early stages of booting a system, or handling processes are available during the early stages of booting a
are required by <command>udevd</command> itself. Creating static device system, or are required by <command>udevd</command> itself. Creating
nodes in <filename class="directory">/lib/udev/devices</filename> also static device nodes in <filename
provides an easy workaround for devices that are not supported by the class="directory">/lib/udev/devices</filename> also provides an easy
dynamic device handling infrastructure. The bootscript then starts the workaround for devices that are not supported by the dynamic device
Udev daemon, <command>udevd</command>, which will act on any uevents it handling infrastructure. The bootscript then starts the Udev daemon,
receives. Finally, the bootscript forces the kernel to replay uevents for <command>udevd</command>, which will act on any uevents it receives.
any devices that have already been registered and then waits for Finally, the bootscript forces the kernel to replay uevents for any
devices that have already been registered and then waits for
<command>udevd</command> to handle them.</para> <command>udevd</command> to handle them.</para>
<para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes
care of re-triggering events for subsystems whose rules may rely on
filesystems that are not mounted until the <command>mountfs</command>
script is run (in particular, /usr and /var may cause this). This script
runs after the <command>mountfs</command> script, so those rules (if
re-triggered) should succeed the second time around. It is configured
from the <filename>/etc/sysconfig/udev_retry</filename> file; any words
in this file other than comments are considered subsystem names to
trigger at retry time. (To find the subsystem of a device, use
<command>udevadm info --attribute-walk</command>.)</para>
</sect3> </sect3>
<sect3> <sect3>
<title>Device Node Creation</title> <title>Device Node Creation</title>
<para>To obtain the right major and minor number for a device, Udev relies <para>To obtain the right major and minor number for a device, Udev
on the information provided by <systemitem relies on the information provided by <systemitem
class="filesystem">sysfs</systemitem> in <filename class="filesystem">sysfs</systemitem> in <filename
class="directory">/sys</filename>. For example, class="directory">/sys</filename>. For example,
<filename>/sys/class/tty/vcs/dev</filename> contains the string <filename>/sys/class/tty/vcs/dev</filename> contains the string
<quote>7:0</quote>. This string is used by <command>udevd</command> <quote>7:0</quote>. This string is used by <command>udevd</command> to
to create a device node with major number <emphasis>7</emphasis> and minor create a device node with major number <emphasis>7</emphasis> and minor
<emphasis>0</emphasis>. The names and permissions of the nodes created <emphasis>0</emphasis>. The names and permissions of the nodes created
under the <filename class="directory">/dev</filename> directory are under the <filename class="directory">/dev</filename> directory are
determined by rules specified in the files within the <filename determined by rules specified in the files within the <filename

View File

@ -1,5 +1,5 @@
<!ENTITY version "SVN-20111005"> <!ENTITY version "SVN-20111006">
<!ENTITY releasedate "Oc5 5, 2011"> <!ENTITY releasedate "Oct 6, 2011">
<!ENTITY copyrightdate "1999-2011"><!-- jhalfs needs a literal dash, not &ndash; --> <!ENTITY copyrightdate "1999-2011"><!-- jhalfs needs a literal dash, not &ndash; -->
<!ENTITY milestone "7.0"> <!ENTITY milestone "7.0">
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" --> <!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->

View File

@ -298,7 +298,7 @@
<!ENTITY less-ch6-du "3.5 MB"> <!ENTITY less-ch6-du "3.5 MB">
<!ENTITY less-ch6-sbu "less than 0.1 SBU"> <!ENTITY less-ch6-sbu "less than 0.1 SBU">
<!ENTITY lfs-bootscripts-version "20110926"> <!-- Scripts depend on this format --> <!ENTITY lfs-bootscripts-version "20111006"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!-- Updated in Makefile --> <!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!-- Updated in Makefile -->
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2"> <!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!-- Updated in Makefile --> <!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!-- Updated in Makefile -->