[Bug 1019] Restore ALSA volumes reliably when udev is installed

blfs-bugs at linuxfromscratch.org blfs-bugs at linuxfromscratch.org
Wed Nov 10 09:53:07 PST 2004


http://blfs-bugs.linuxfromscratch.org/show_bug.cgi?id=1019





------- Additional Comments From bryan at kadzban.is-a-geek.net  2004-11-10 10:53 -------
Could we create some sort of dual-dependency setup using hotplug and the dev.d
directory?  We'd create a dev.d handler for Alsa, and also a new
/etc/hotplug/fsmounted.agent.  Then udev would call our dev.d handler, and we
could have the mountfs init script call the fsmounted.agent (with "/sbin/hotplug
fsmounted").

Both scripts would check for a "flag" file somewhere.  (It will probably have to
be on a ramfs.)  If it does not exist, then this script is executing first, so
it creates the flag file and exits.  If the file does exist, then the script
deletes the file and calls alsactl restore.

There is a small race window between checking for the file's existence and
creating it, but shell has no way to use O_CREAT | O_EXCL when opening files. 
We could write a short C program that would take a filename on its command line,
open it with O_CREAT | O_EXCL, then exit(0) if successful, and exit(1) if not
(there is no race condition this way).  We could call that C program from each
script.

This works in all cases for factors 1 and 2 referenced above.  In any case,
alsactl restore is only called after the devices are created AND mountfs has run.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.



More information about the blfs-book mailing list