See the attached patch for what I propose we do, at least in the short
term, or possibly longer as well.

It changes udev_retry to (in addition to using --type=failed) read
/etc/sysconfig/udev_retry (name TBD, but this works for me?) and pull
subsystem names from there, then trigger "add" events for those
subsystems at boot time.  I've tested this with sound, and running the
udev_retry script does overwrite any alsamixer changes made since the
last "alsactl store" run.  I have not yet rebooted, to see if this works
with the setclock script, but that will happen tomorrow, before I plan
on committing this in any event.

Longer term, we can remove the --type=failed invocation entirely,
although maybe that's better done as part of this change?

Comments?

(Should this go into the lsb-bootscripts tree as well?)
Index: lfs/sysconfig/udev_retry
===================================================================
--- lfs/sysconfig/udev_retry    (revision 0)
+++ lfs/sysconfig/udev_retry    (revision 0)
@@ -0,0 +1,19 @@
+########################################################################
+# Begin /etc/sysconfig/udev_retry
+#
+# Description : udev_retry script configuration
+#
+# Authors     :
+#
+# Version     : 00.00
+#
+# Notes       : Each subsystem that may need to be re-triggered after mountfs
+#               runs should be listed in this file.  Probable subsystems to be
+#               listed here are rtc (due to /var/lib/hwclock/adjtime) and sound
+#               (due to both /var/lib/alsa/asound.state and /usr/sbin/alsactl).
+#               Entries are whitespace-separated.
+########################################################################
+
+rtc
+
+# End /etc/sysconfig/udev_retry
Index: lfs/init.d/udev_retry
===================================================================
--- lfs/init.d/udev_retry       (revision 9611)
+++ lfs/init.d/udev_retry       (working copy)
@@ -46,6 +46,14 @@
 
       # Re-trigger the failed uevents in hope they will succeed now
       /sbin/udevadm trigger --type=failed --action=add
+      # Additionally, re-trigger uevents in any configured subsystem, in the
+      # hope that 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
       /sbin/udevadm settle
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 9611)
+++ ChangeLog   (working copy)
@@ -1,4 +1,10 @@
-2100-09-18
+2011-10-04  Bryan Kadzban <[email protected]>
+   * Add configuration for udev_retry, to eventually 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.
    ** Rename /etc/sysconfig/init_params to /etc/sysconfig/rc.site.
    ** Move network services to /lib/services.
Index: Makefile
===================================================================
--- Makefile    (revision 9611)
+++ Makefile    (working copy)
@@ -60,6 +60,9 @@
        if [ ! -f ${EXTDIR}/sysconfig/modules     ]; then \
           install -m ${CONFMODE} lfs/sysconfig/modules     
${EXTDIR}/sysconfig/ ;\
         fi
+       if [ ! -f ${EXTDIR}/sysconfig/udev_retry  ]; then \
+          install -m ${CONFMODE} lfs/sysconfig/udev_retry  
${EXTDIR}/sysconfig/ ;\
+        fi
        if [ ! -f ${EXTDIR}/sysconfig/rc          ]; then \
           install -m ${CONFMODE} lfs/sysconfig/rc          
${EXTDIR}/sysconfig/ ;\
         fi

Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to