[Pkg-alsa-devel] [Debian ALSA CVS] debian/alsa-driver/debian (3 files)

Steve Kowalik stevenk@haydn.debian.org
Tue, 22 Jun 2004 06:12:10 -0600


    Date: Tuesday, June 22, 2004 @ 06:12:10
  Author: stevenk
    Path: /cvsroot/pkg-alsa/debian/alsa-driver/debian

Modified: alsa-base.apm alsa-base.init changelog

Remove XSIims in alsa-base's init script.
Since users are evidently unable to either write shell code, or think for themselves, sit down and reimplement force-stop in the init script. No, this isn't what is in the changelog. Yes, I'm pissed off about this change.


----------------+
 alsa-base.apm  |    1 +
 alsa-base.init |   28 +++++++++++++++++++++++++++-
 changelog      |   13 ++++++++++---
 3 files changed, 38 insertions(+), 4 deletions(-)


Index: debian/alsa-driver/debian/alsa-base.apm
diff -u debian/alsa-driver/debian/alsa-base.apm:1.9 debian/alsa-driver/debian/alsa-base.apm:1.10
--- debian/alsa-driver/debian/alsa-base.apm:1.9	Wed Jun  2 18:49:03 2004
+++ debian/alsa-driver/debian/alsa-base.apm	Tue Jun 22 06:12:09 2004
@@ -9,6 +9,7 @@
     if [ -d /proc/asound ]; then
 	fuser -k -STOP $devices || :
 	sleep 1
+	/etc/init.d/alsa force-stop
     fi
 elif [ "$1" = resume ]; then
     if [ -d /proc/asound ]; then
Index: debian/alsa-driver/debian/alsa-base.init
diff -u debian/alsa-driver/debian/alsa-base.init:1.44 debian/alsa-driver/debian/alsa-base.init:1.45
--- debian/alsa-driver/debian/alsa-base.init:1.44	Thu Apr 29 16:43:51 2004
+++ debian/alsa-driver/debian/alsa-base.init	Tue Jun 22 06:12:09 2004
@@ -4,7 +4,8 @@
 
 PATH=/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin
 
-if [ "$(id -u)" != "0" -a "$1" != "--help" -a "$1" != "help" -a ! -z "$1" ]; then
+if [ "$(id -u)" != "0" ] && [ "$1" != "--help" ] &&
+   [ "$1" != "help" ] && [ ! -z "$1" ]; then
     echo "$0: To $1 ALSA, you must be root."
     exit 1
 fi
@@ -39,6 +40,31 @@
 		fi
 	    fi
 	fi
+	;;
+    force-stop)
+	procs_using_sound="$(lsof +D /dev -F rt | awk '/^p/ {pid=$1} /^t/ {type=$1} /^r0x(74|e)..$/ && type == "tCHR" {print pid}' | cut -c 2- | uniq)"
+	if [ ! -z "$procs_using_sound" ]; then
+	    printf "Terminating processes ... "
+	    kill $procs_using_sound
+	    sleep 2
+	    kill -9 $procs_using_sound
+	    echo "done"
+	fi
+	$0 stop
+	rmmod=""
+	case "$(modprobe --version 2>&1)" in
+	    modprobe*)
+		rmmod="rmmod -r"
+		;;
+	    module-init-tools*)
+		rmmod="modprobe -r"
+		;;
+	esac
+	printf "Unloading modules ... "
+	for i in $(lsmod | awk '/^snd/ {print $1}'); do
+	    $rmmod $i >/dev/null 2>&1 || :
+	done
+	echo "done"
 	;;
     restart|reload)
 	$0 stop && $0 start
Index: debian/alsa-driver/debian/changelog
diff -u debian/alsa-driver/debian/changelog:1.252 debian/alsa-driver/debian/changelog:1.253
--- debian/alsa-driver/debian/changelog:1.252	Wed Jun  9 17:40:09 2004
+++ debian/alsa-driver/debian/changelog	Tue Jun 22 06:12:10 2004
@@ -1,8 +1,15 @@
 alsa-driver (1.0.5a-2) unstable; urgency=low
 
-  * Unreleased
-
- -- David B. Harris <dbharris@debian.org>  Wed,  9 Jun 2004 19:39:44 -0400
+  * Steve Kowalik:
+    - Remove XSIims in alsa-base's init script. (Closes: #254622)
+      (thanks, Clint Adams)
+    - Heaven forbid that we actually remove features from the package, so
+      reimplement force-stop in the init script, and tell the apm script
+      to run force-stop on suspend. Getting modules to load on resume is
+      left as an exercise for the user. (Closes: #249541, #253980)
+  * Unreleased, and stuff.
+  
+ -- Steve Kowalik <stevenk@debian.org>  Tue, 22 Jun 2004 22:08:14 +1000
 
 alsa-driver (1.0.5a-1) unstable; urgency=low