Date: Sat, 29 Apr 2006 08:25:35 GMT From: Rostislav Krasny <rosti.bsd@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/96501: [PATCH] etc/rc.d/mixer script may reset mixer values to their defaults Message-ID: <200604290825.k3T8PZwc031162@www.freebsd.org> Resent-Message-ID: <200604290830.k3T8UGJA021987@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 29 08:30:16 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Rostislav Krasny >Release: 6.1-RC >Organization: >Environment: FreeBSD saturn.lan 6.1-RC FreeBSD 6.1-RC #0: Fri Apr 28 18:55:32 IDT 2006 root@saturn.lan:/usr/obj/usr/src/sys/MYKERNEL i386 >Description: 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. >How-To-Repeat: 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 >Fix: 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 @@ mixer_save() { local dev + local uptime dev="/dev/${1}" + 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" \; fi } @@ -71,6 +76,7 @@ file="/var/db/${1}-state" if [ -r ${dev} -a -r ${file} ]; then /usr/sbin/mixer -f ${dev} `cat ${file}` > /dev/null + touch -m ${file} fi } >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604290825.k3T8PZwc031162>