misc/96501: [PATCH] etc/rc.d/mixer script may reset mixer values to their defaults

Rostislav Krasny rosti.bsd at gmail.com
Sat Apr 29 08:30:17 UTC 2006

>Number:         96501
>Category:       misc
>Synopsis:       [PATCH] etc/rc.d/mixer script may reset mixer values to their defaults
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 29 08:30:16 GMT 2006
>Originator:     Rostislav Krasny
>Release:        6.1-RC
FreeBSD saturn.lan 6.1-RC FreeBSD 6.1-RC #0: Fri Apr 28 18:55:32 IDT 2006     root at saturn.lan:/usr/obj/usr/src/sys/MYKERNEL  i386
The etc/rc.d/mixer script saves and restores mixer values on shutdown and boot
respectively. If system booted in a single user mode and then rebooted the mixer
values might be resetted to their defaults.
Make sure your mixer values are different to their defaults.
Boot into a single user mode, like you do before 'make installworld':

fsck -p
mount -u /
mount -a -t ufs
swapon -a
adjkerntz -i

.. and then just reboot:

shutdown -r now

Boot normaly and check your mixer values by running /usr/sbin/mixer
The etc/rc.d/mixer script patch:

--- mixer.orig	Sun Dec 18 18:06:28 2005
+++ mixer	Sat Apr 29 00:58:13 2006
@@ -53,10 +53,15 @@
 	local dev
+	local uptime
+	uptime=$((`date +"%s"` - \
+		`sysctl kern.boottime | awk '{ printf("%d", $5) }'`))
 	if [ -r ${dev} ]; then
-		/usr/sbin/mixer -f ${dev} -s > /var/db/${1}-state 2>/dev/null
+		find /var/db/ -name ${1}-state -mtime -${uptime}s -maxdepth 1 \
+			-exec sh -c "/usr/sbin/mixer -f ${dev} -s > {} \
+				2>/dev/null" \;
@@ -71,6 +76,7 @@
 	if [ -r ${dev} -a -r ${file} ]; then
 		/usr/sbin/mixer -f ${dev} `cat ${file}` > /dev/null
+		touch -m ${file}


More information about the freebsd-bugs mailing list