Author: archaic
Date: 2006-04-17 17:39:05 -0600 (Mon, 17 Apr 2006)
New Revision: 7535

Added:
   trunk/bootscripts/lfs/init.d/udev_retry
Modified:
   trunk/bootscripts/CHANGELOG
   trunk/bootscripts/Makefile
   trunk/bootscripts/lfs/init.d/udev
Log:
Updated the udev script to use udevsettle. Added udev_retry script. Thanks to 
Alex Patrakov for the scripts.

Modified: trunk/bootscripts/CHANGELOG
===================================================================
--- trunk/bootscripts/CHANGELOG 2006-04-17 18:17:40 UTC (rev 7534)
+++ trunk/bootscripts/CHANGELOG 2006-04-17 23:39:05 UTC (rev 7535)
@@ -1,3 +1,8 @@
+n/a - April 17, 2006
+       * Updated udev script to use the new udevsettle program.
+       * Added udev_retry script for systems that have /usr on a different
+         partition or for some other reason fail the initial replay.
+
 n/a - April 15, 2006
        * Cleaned up contrib directory.  Removed: contrib/init.d, 
           contrib/enhanced, contrib/livecd, contrib/hotplug, and raq2 

Modified: trunk/bootscripts/Makefile
===================================================================
--- trunk/bootscripts/Makefile  2006-04-17 18:17:40 UTC (rev 7534)
+++ trunk/bootscripts/Makefile  2006-04-17 23:39:05 UTC (rev 7535)
@@ -41,6 +41,7 @@
        install -m ${MODE} lfs/init.d/sysctl        ${EXTDIR}/rc.d/init.d/
        install -m ${MODE} lfs/init.d/template      ${EXTDIR}/rc.d/init.d/
        install -m ${MODE} lfs/init.d/udev          ${EXTDIR}/rc.d/init.d/
+       install -m ${MODE} lfs/init.d/udev_retry    ${EXTDIR}/rc.d/init.d/
        ln -sf ../init.d/network     ${EXTDIR}/rc.d/rc0.d/K80network
        ln -sf ../init.d/sysklogd   ${EXTDIR}/rc.d/rc0.d/K90sysklogd
        ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc0.d/S60sendsignals
@@ -71,6 +72,7 @@
        ln -sf ../init.d/swap        ${EXTDIR}/rc.d/rcsysinit.d/S20swap
        ln -sf ../init.d/checkfs     ${EXTDIR}/rc.d/rcsysinit.d/S30checkfs
        ln -sf ../init.d/mountfs     ${EXTDIR}/rc.d/rcsysinit.d/S40mountfs
+       ln -sf ../init.d/udev_retry  ${EXTDIR}/rc.d/rcsysinit.d/S45udev_retry
        ln -sf ../init.d/cleanfs     ${EXTDIR}/rc.d/rcsysinit.d/S50cleanfs
        ln -sf ../init.d/setclock    ${EXTDIR}/rc.d/rcsysinit.d/S60setclock
        ln -sf ../init.d/console     ${EXTDIR}/rc.d/rcsysinit.d/S70console

Modified: trunk/bootscripts/lfs/init.d/udev
===================================================================
--- trunk/bootscripts/lfs/init.d/udev   2006-04-17 18:17:40 UTC (rev 7534)
+++ trunk/bootscripts/lfs/init.d/udev   2006-04-17 23:39:05 UTC (rev 7535)
@@ -4,9 +4,9 @@
 #
 # Description : Udev cold-plugging script
 #
-# Authors     : Zack Winkles
+# Authors     : Zack Winkles, Alexander E. Patrakov
 #
-# Version     : 00.01
+# Version     : 00.02
 #
 # Notes       :
 #
@@ -52,7 +52,7 @@
                echo > /proc/sys/kernel/hotplug
 
                # Copy static device nodes to /dev
-               cp -ar /lib/udev/devices/* /dev
+               cp -a /lib/udev/devices/* /dev
 
                # Start the udev daemon to continually watch for, and act on,
                # uevents
@@ -60,24 +60,12 @@
 
                # Now traverse /sys in order to "coldplug" devices that have
                # already been discovered
-               mkdir -p /dev/.udev/queue
                /sbin/udevtrigger
 
-               # until we know how to do better, just wait for _all_ events 
-               #to finish
-               loop=300
-               confirm=0
-               while true ; do
-                       sleep 0.1
-                       test -d /dev/.udev/queue && confirm=0 || \
-                       confirm=$(( $confirm + 1 ))
-                       loop=$(( $loop - 1 ))
-                       test $loop -gt 0 || break
-                       test $confirm -lt 60 || break
-               done
-               > /dev/bug
-               test "$loop" -gt 0
+               # Now wait for udevd to process the uevents we triggered
+               /sbin/udevsettle
                failed="${?}"
+               > /dev/bug
                sleep 6
                if test -s /dev/bug; then
                        mv /dev/bug /dev/bugreport
@@ -89,9 +77,9 @@
                evaluate_retval
 
                if [ "${failed}" -eq "2" ]; then
-                       boot_mesg "Please paste the /dev/bugreport file to" 
${FAILURE}
-                       boot_mesg 
"http://wiki.linuxfromscratch.org/lfs/ticket/1720";
-                       boot_mesg "Otherwise, the next version of LFS may be 
unbootable on your system!"
+                       boot_mesg "Some uevents escaped from the \"udevsettle\" 
program" ${FAILURE}
+                       boot_mesg "This is a bug either in the kernel or in the 
program itself."
+                       boot_mesg "Please mail the /dev/bugreport file to 
[EMAIL PROTECTED]"
                        echo_failure
                        sleep 10
                        exit 1

Added: trunk/bootscripts/lfs/init.d/udev_retry
===================================================================
--- trunk/bootscripts/lfs/init.d/udev_retry                             (rev 0)
+++ trunk/bootscripts/lfs/init.d/udev_retry     2006-04-17 23:39:05 UTC (rev 
7535)
@@ -0,0 +1,59 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/udev_retry
+#
+# Description : Udev cold-plugging script (retry)
+#
+# Authors     : Alexander E. Patrakov
+#
+# Version     : 00.02
+#
+# Notes       :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+       start)
+               boot_mesg "Retrying failed uevents, if any..."
+               # Re-trigger the failed uevents in hope they will succeed now
+               # If there are none, the "No such file or directory" error
+               # goes to /dev/null
+               for file in /dev/.udev/failed/*/uevent ; do
+                       echo "add" >"${file}"
+               done 2>/dev/null
+               
+               # Now wait for udevd to process the uevents we triggered
+               /sbin/udevsettle
+               failed="${?}"
+               > /dev/bug
+               sleep 6
+               if test -s /dev/bug; then
+                       mv /dev/bug /dev/bugreport
+                       failed="2"
+               else
+                       rm -f /dev/bug
+               fi
+               (exit "${failed}")
+               evaluate_retval
+
+               if [ "${failed}" -eq "2" ]; then
+                       boot_mesg "Some uevents escaped from the \"udevsettle\" 
program." ${FAILURE}
+                       boot_mesg "This is a bug either in the kernel or in the 
program itself."
+                       boot_mesg "Please mail the /dev/bugreport file to 
[EMAIL PROTECTED]"
+                       echo_failure
+                       sleep 10
+                       exit 1
+               fi
+
+               ;;
+
+       *)
+               echo "Usage ${0} {start}"
+               exit 1
+               ;;
+esac
+
+# End $rc_base/init.d/udev_retry

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to