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

Steve Kowalik stevenk@haydn.debian.org
Tue, 20 Apr 2004 15:34:27 -0600


    Date: Tuesday, April 20, 2004 @ 15:34:27
  Author: stevenk
    Path: /cvsroot/pkg-alsa/debian/alsa-driver/debian

   Added: alsa-base.discover alsa-base.hotplug alsa-base.modprobe.d
          alsa-base.modutils
Modified: alsa-base.NEWS alsa-base.apm alsa-base.conf alsa-base.config
          alsa-base.dirs alsa-base.docs alsa-base.init alsa-base.postinst
          alsa-base.postrm alsa-base.templates

This is the New World Order for ALSA.
Change the init script to no longer insert modules.
Also change the APM script, since we can't touch modules.
Drastically rewrite the debconfage associated with alsa-base.
Add automagic loading for OSS modules, and blacklist or skip OSS drivers.
Fix random files, such as .dirs, .docs.


----------------------+
 alsa-base.NEWS       |   14 +++
 alsa-base.apm        |   30 +------
 alsa-base.conf       |   10 --
 alsa-base.config     |  209 ++-----------------------------------------------
 alsa-base.dirs       |    4 
 alsa-base.discover   |   48 +++++++++++
 alsa-base.docs       |    1 
 alsa-base.hotplug    |   48 +++++++++++
 alsa-base.init       |  150 +++--------------------------------
 alsa-base.modprobe.d |    1 
 alsa-base.modutils   |    1 
 alsa-base.postinst   |  151 ++++++++---------------------------
 alsa-base.postrm     |   12 --
 alsa-base.templates  |   39 ---------
 14 files changed, 191 insertions(+), 527 deletions(-)


Index: debian/alsa-driver/debian/alsa-base.NEWS
diff -u debian/alsa-driver/debian/alsa-base.NEWS:1.2 debian/alsa-driver/debian/alsa-base.NEWS:1.3
--- debian/alsa-driver/debian/alsa-base.NEWS:1.2	Thu Jul  3 18:10:03 2003
+++ debian/alsa-driver/debian/alsa-base.NEWS	Tue Apr 20 15:34:26 2004
@@ -1,3 +1,17 @@
+alsa-driver (1.0.4-2) unstable; urgency=low
+
+  * Steve Kowalik:
+    - No longer load modules in the alsa init script. Loading modules is now
+      the responsibility of the user, or a program such as discover or hotplug.
+    - Provide /etc/hotplug/blacklist.d/alsa-base, which blacklists every OSS
+      sound driver.
+    - Also provide an alsa-base.discover file in /usr/share/doc/alsa-base, 
+      which skips every OSS sound driver. It can not be added to the discover 
+      config file automatically, since Policy prohibits us from modifying 
+      another package's config files.
+
+ -- Steve Kowalik <stevenk@debian.org>  Sun, 18 Apr 2004 21:34:25 +1000
+
 alsa-driver (0.9.3a-2) unstable; urgency=low
 
   * David B Harris:
Index: debian/alsa-driver/debian/alsa-base.apm
diff -u debian/alsa-driver/debian/alsa-base.apm:1.7 debian/alsa-driver/debian/alsa-base.apm:1.8
--- debian/alsa-driver/debian/alsa-base.apm:1.7	Sun Apr 18 14:08:37 2004
+++ debian/alsa-driver/debian/alsa-base.apm	Tue Apr 20 15:34:26 2004
@@ -4,31 +4,15 @@
 
 set -e
 
-if [ -e /etc/default/alsa ]; then
-	. /etc/default/alsa
-fi
-
 devices=$(find /dev -type c | xargs stat -c '%t %n' | sed -n 's/^e //p; s/^74 //p')
 if [ "$1" = suspend ]; then
-	if [ "$force_stop_modules_before_suspend" = "forcibly-unload-driver" ]; then
-		alsactl store || true
-		sleep 1
-		/etc/init.d/alsa force-stop || true
-	elif [ "$force_stop_modules_before_suspend" = "stop-procs" ]; then
-		if [ -d /proc/asound ]; then
-			fuser -k -STOP $devices
-		fi
-	fi
-	sleep 1
+    if [ -d /proc/asound ]; then
+	fuser -k -STOP $devices
+    fi
+    sleep 1
 elif [ "$1" = resume ]; then
-	if [ "$force_stop_modules_before_suspend" = "forcibly-unload-driver" ]; then
-		/etc/init.d/alsa start || true
-		sleep 1
-        alsactl restore || true
-	elif [ "$force_stop_modules_before_suspend" = "stop-procs" ]; then
-		if [ -d /proc/asound ]; then
-			fuser -k -CONT $devices
-		fi
-	fi
+    if [ -d /proc/asound ]; then
+	fuser -k -CONT $devices
+    fi
 fi
 
Index: debian/alsa-driver/debian/alsa-base.conf
diff -u debian/alsa-driver/debian/alsa-base.conf:1.3 debian/alsa-driver/debian/alsa-base.conf:1.4
--- debian/alsa-driver/debian/alsa-base.conf:1.3	Thu Feb 26 17:17:53 2004
+++ debian/alsa-driver/debian/alsa-base.conf	Tue Apr 20 15:34:26 2004
@@ -1,18 +1,8 @@
 # Example configuration file for alsa-base.
 
-# Set as true if you want to unload alsa modules before 
-# your system suspends. This is currently useful if your
-# machine hangs after resuming.
-force_stop_modules_before_suspend=false
-
 # Set as false if you don't want the init script running
 # 'alsactl store' on shutdown.
 alsactl_store_on_shutdown=true
-
-# Uncomment if you always want to stop alsa modules forcibly in
-# /etc/init.d/alsa stop or restart by killing all of running
-# applications which use sound devices.
-#ALSA_KILL_MODE="force"
 
 # runlevels_save is used to determine in which runlevels (and from which
 # runlevels) mixer settings will be saved. The default value of '[2-5]' will
Index: debian/alsa-driver/debian/alsa-base.config
diff -u debian/alsa-driver/debian/alsa-base.config:1.38 debian/alsa-driver/debian/alsa-base.config:1.39
--- debian/alsa-driver/debian/alsa-base.config:1.38	Sat Feb 28 12:32:14 2004
+++ debian/alsa-driver/debian/alsa-base.config	Tue Apr 20 15:34:26 2004
@@ -1,203 +1,16 @@
-#! /usr/bin/perl -w
+#!/bin/sh
 
-package Debconf::Client::ConfModuleX;
+set -e
 
-# Ripped right out of libapache-sessionx-perl, thanks to Angus Lees.
+. /usr/share/debconf/confmodule
+db_version 2.0
 
-#
-# Add the error checking behaviour that I think
-# Debconf::Client::ConfModule should have anyway
-#
+for i in what_version_is_your_config move_config_to_new_location start_oss_layer force_stop_alsa_before_suspend alsa-base/current_card alsa-base/card_list ; do
+  if db_get "alsa-base/$i" || false ; then
+    db_unregister "alsa-base/$i" || true
+  fi
+done
 
-use Debconf::Client::ConfModule;
-
-use base qw(Exporter);
-
-BEGIN {
-  *EXPORT_OK = \@Debconf::Client::ConfModule::EXPORT_OK;
-  *EXPORT_TAGS = \%Debconf::Client::ConfModule::EXPORT_TAGS;
-}
-
-sub AUTOLOAD {
-  my $cmd = our $AUTOLOAD;
-  $cmd =~ s|.*:||;
-
-  my ($ret, $text) = &{"Debconf::Client::ConfModule::$cmd"}(@_);
-  if ($ret == 0 or $ret >= 30 && $ret < 100) {
-    # expected return values
-    return wantarray ? ($ret, $text) : $text;
-  }
-
-  $cmd = uc $cmd;
-  my $msg = $text ? "$text ($ret)" : "code $ret";
-
-  require Carp;
-  if ($ret < 10 || $ret >= 110) {
-    Carp::confess("Debconf $cmd returned reserved error code? $msg");
-  } elsif ($ret < 20) {
-    # Dump @_ ?
-    Carp::croak("Debconf $cmd: invalid parameters: $msg");
-  } elsif ($ret < 30) {
-    Carp::confess("Debconf $cmd: syntax error: $msg");
-  } else { # $ret < 110
-    Carp::confess("Debconf $cmd: debconf internal error: $msg");
-  }
-}
-
-1;
-
-package main;
-
-BEGIN { Debconf::Client::ConfModuleX->import(qw(:all)) }
-
-use strict;
-
-version('2.0'); # We be a clever config!
-capb('backup'); # We can even reverse parallel park!
-
-my @alsa_modules = metaget("alsa-common/card-list", "choices");
-my %alsa_modules_list = ();
-foreach (split(/, /, $alsa_modules[1])) {
-  /^([^\s]+)\s(.+)/;
-  $alsa_modules_list{$1} = $2;
-}
-$alsa_modules_list{done} = "";
-
-my @to_unregister = ("what_version_is_your_config", "move_config_to_new_location", "start_oss_layer");
-foreach (@to_unregister) {
-  my @ret = Debconf::Client::ConfModule::get("alsa-base/$_");
-  unregister("alsa-base/$_") if $ret[0] == 0;
-}
-
-my @alsa_file = ();
-if (-f "/etc/alsa/modutils/1.0") {
-
-  open(ALSAFILE, "</etc/alsa/modutils/1.0");
-  @alsa_file = grep(/^\s*alias snd-card-/, <ALSAFILE>);
-  close ALSAFILE;
-
-} elsif (-f "/etc/alsa/modutils/0.9") {
-
-  open(ALSAFILE, "</etc/alsa/modutils/0.9");
-  @alsa_file = grep(/^\s*alias snd-card-/, <ALSAFILE>);
-  close ALSAFILE;
-
-}
-
-my @file_cards_untouched = ();
-
-foreach (@alsa_file) {
-  my @cur_line = split(/\s/, $_);
-  $cur_line[-1] =~ s/snd-//;
-  push(@file_cards_untouched, $cur_line[-1]);
-}
-push(@file_cards_untouched, "done");
-
-my @ret = get("alsa-base/card_list");
-my @deb_cards_untouched = split(/ /, $ret[1]);
-
-my @file_cards = ();
-my @deb_cards = ();
-
-# Remove duplicates.
-if ($ARGV[1] ne "") {
-  system("dpkg --compare-versions $ARGV[1] lt 0.9.2-6");
-  if ($? == 0) {
-    my %seen = ();
-    foreach (@file_cards_untouched) {
-      push(@file_cards, $_) unless $seen{$_}++;
-    }
-    %seen = ();
-    foreach (@deb_cards_untouched) {
-      push(@deb_cards, $_) unless $seen{$_}++;
-    }
-  }
-} 
-@deb_cards = @deb_cards_untouched;
-@file_cards = @file_cards_untouched;
-
-if (@file_cards != @deb_cards) {
-  @file_cards = @deb_cards;
-}
-
-subst("alsa-base/current_card", "alsa_modules", $alsa_modules[1]);
-
-my @selected_cards = ();
-
-my $counter = 0;
-my $cur_card = "";
-while ($cur_card ne "done") {
-  if (exists($file_cards[$counter])) {
-    set("alsa-base/current_card", "$file_cards[$counter] $alsa_modules_list{$file_cards[$counter]}");
-  } else {
-    set("alsa-base/current_card", "done");
-  }
-  if ($counter == 0) {
-    subst("alsa-base/current_card", "alsa_cards", "");
-  } else {
-    my $cur_join_list = join(' ', @selected_cards);
-    subst("alsa-base/current_card", "alsa_cards", $cur_join_list);
-  }
-  input("medium", "alsa-base/current_card");
-  my @go_return = go();
-  @ret = get("alsa-base/current_card");
-  if ($go_return[0] == 0) {
-    if ($ret[0] == 0) {
-      my @tmp = split(/ /, $ret[1]);
-      push(@selected_cards, $tmp[0]);
-      $cur_card = $tmp[0];
-    }
-    $counter++;
-  } elsif ($go_return[0] == 30) {
-    if ($counter > 0) {
-      pop(@selected_cards);
-      if ($#selected_cards > 0) {
-	$cur_card = $selected_cards[-1];
-      } else {
-	$cur_card = "";
-      }
-      $counter--;
-    } else {
-      $cur_card = "";
-    }
-  }
-}
-
-my $joinedcards = "";
-foreach (@selected_cards) {
-  my @cur_line = split(/ /, $_);
-  $joinedcards .= $cur_line[0] . " ";
-}
-$joinedcards =~ s/ $//;
-set("alsa-base/card_list", $joinedcards);
-
-my @alsabase = ();
-my $filename = "";
-if (-f "/etc/default/alsa") {
-  $filename = "/etc/default/alsa";
-} elsif (-f "/etc/alsa/alsa-base.conf") {
-  $filename = "/etc/alsa/alsa-base.conf";
-} elsif (-f "/etc/alsa-base.conf") {
-  $filename = "/etc/alsa-base.conf";
-}
-if ($filename ne "") {
-  open(BASECONF, "<$filename");
-  @alsabase = <BASECONF>;
-  close BASECONF;
-}
-
-my $tmp_set = "";
-foreach (@alsabase) {
-  if (/^force_stop_modules_before_suspend=(.*)$/) {
-	$tmp_set = $1;
-    set("alsa-base/force_stop_alsa_before_suspend", $tmp_set);
-  } elsif (/^alsactl_store_on_shutdown=(.*)$/) {
-    $tmp_set = $1;
-    set("alsa-base/alsactl_store_on_shutdown", $tmp_set);
-  }
-}
-
-input("low", "alsa-base/force_stop_alsa_before_suspend");
-input("low", "alsa-base/alsactl_store_on_shutdown");
-go();
+db_input low alsa-base/alsactl_store_on_shutdown || true
+db_go
 
Index: debian/alsa-driver/debian/alsa-base.dirs
diff -u debian/alsa-driver/debian/alsa-base.dirs:1.2 debian/alsa-driver/debian/alsa-base.dirs:1.3
--- debian/alsa-driver/debian/alsa-base.dirs:1.2	Mon Sep  8 16:48:04 2003
+++ debian/alsa-driver/debian/alsa-base.dirs	Tue Apr 20 15:34:26 2004
@@ -1,7 +1,9 @@
 usr/share/alsa-base
 var/lib/alsa-base
+etc/hotplug/blacklist.d
 etc/modutils
 etc/modprobe.d
-etc/alsa/modutils
 etc/apm/event.d
 etc/devfs/conf.d
+usr/share/linda/overrides
+usr/share/lintian/overrides
Index: debian/alsa-driver/debian/alsa-base.discover
diff -u /dev/null debian/alsa-driver/debian/alsa-base.discover:1.1
--- /dev/null	Tue Apr 20 15:34:27 2004
+++ debian/alsa-driver/debian/alsa-base.discover	Tue Apr 20 15:34:26 2004
@@ -0,0 +1,48 @@
+skip ac97
+skip ac97_codec
+skip ac97_plugin_ad1980
+skip aci
+skip ad1848
+skip ad1889
+skip adlib_card
+skip aedsp16
+skip ali5455
+skip btaudio
+skip cmpci
+skip cs4232
+skip cs4281
+skip cs46xx
+skip emu10k1
+skip es1370
+skip es1371
+skip esssolo1
+skip forte
+skip gus
+skip i810_audio
+skip kahlua
+skip mad16
+skip maestro
+skip maestro3
+skip maui
+skip mpu401
+skip nm256_audio
+skip opl3
+skip opl3sa
+skip opl3sa2
+skip pas2
+skip pss
+skip rme96xx
+skip sb
+skip sb_lib
+skip sgalaxy
+skip sonicvibes
+skip sound
+skip sscape
+skip trident
+skip trix
+skip uart401
+skip uart6850
+skip v_midi
+skip via82cxxx_audio
+skip wavefront
+skip ymfpci
Index: debian/alsa-driver/debian/alsa-base.docs
diff -u debian/alsa-driver/debian/alsa-base.docs:1.1 debian/alsa-driver/debian/alsa-base.docs:1.2
--- debian/alsa-driver/debian/alsa-base.docs:1.1	Mon Mar 24 17:56:40 2003
+++ debian/alsa-driver/debian/alsa-base.docs	Tue Apr 20 15:34:26 2004
@@ -2,3 +2,4 @@
 FAQ
 README
 WARNING
+debian/alsa-base.discover
Index: debian/alsa-driver/debian/alsa-base.hotplug
diff -u /dev/null debian/alsa-driver/debian/alsa-base.hotplug:1.1
--- /dev/null	Tue Apr 20 15:34:27 2004
+++ debian/alsa-driver/debian/alsa-base.hotplug	Tue Apr 20 15:34:26 2004
@@ -0,0 +1,48 @@
+ac97
+ac97_codec
+ac97_plugin_ad1980
+aci
+ad1848
+ad1889
+adlib_card
+aedsp16
+ali5455
+btaudio
+cmpci
+cs4232
+cs4281
+cs46xx
+emu10k1
+es1370
+es1371
+esssolo1
+forte
+gus
+i810_audio
+kahlua
+mad16
+maestro
+maestro3
+maui
+mpu401
+nm256_audio
+opl3
+opl3sa
+opl3sa2
+pas2
+pss
+rme96xx
+sb
+sb_lib
+sgalaxy
+sonicvibes
+sound
+sscape
+trident
+trix
+uart401
+uart6850
+v_midi
+via82cxxx_audio
+wavefront
+ymfpci
Index: debian/alsa-driver/debian/alsa-base.init
diff -u debian/alsa-driver/debian/alsa-base.init:1.42 debian/alsa-driver/debian/alsa-base.init:1.43
--- debian/alsa-driver/debian/alsa-base.init:1.42	Thu Apr 15 07:20:53 2004
+++ debian/alsa-driver/debian/alsa-base.init	Tue Apr 20 15:34:26 2004
@@ -9,160 +9,42 @@
     exit 1
 fi
 
-# Which version of the tools are we using?
-rmmod=""
-modfile=""
-case "$(modprobe --version 2>&1)" in
-	modprobe*)
-		rmmod="rmmod -r"
-		modfile="/etc/modules.conf"
-	;;
-	module-init-tools*)
-		rmmod="modprobe -r"
-		if [ -s /lib/modules/modprobe.conf ]; then
-			modfile="/lib/modules/modprobe.conf"
-		else
-			modfile="/etc/modules.conf"
-		fi
-	;;
-esac
-
-# Auto detect starting OSS layer
-if [ ! -f /proc/sys/kernel/modprobe -o -c /dev/.devfsd -o -f /dev/.udev.tdb ]; then
-	startosslayer="true"
-else
-	startosslayer="false"
-fi
-# Populate some defaults in case /etc/default/alsa goes for a wander.
-force_stop_modules_before_suspend="false"
-alsactl_store_on_shutdown="true"
+# Default settings
+alsactl_store_on_shutdown="autosave always"
 runlevels_save='[2-5]'
 
 [ -e /etc/default/alsa ] && . /etc/default/alsa
-# $ALSA_KILL_OVERRIDE is only for use by this script, please don't set it
-# yourself in /etc/default/alsa :)
-if [ "$ALSA_KILL_OVERRIDE" = "force" ]; then
-    export ALSA_KILL_OVERRIDE
-    ALSA_KILL_MODE=force
-elif [ ! -z "$ALSA_KILL_OVERRIDE" ]; then
-    export ALSA_KILL_OVERRIDE
-    ALSA_KILL_MODE=none
-fi
 
 case "$1" in
     start)
-	if [ ! -f /proc/asound/version ] ; then
-	    modprobe snd > /dev/null 2>&1
-	    sleep 1  # Temporary hack so that this works with udev.
-	fi
-	if [ -f /proc/asound/version ]; then
-	    alsa_version="$(head -1 /proc/asound/version | cut -f7 -d" " | sed 's/\(.*\)\.$/\1/')"
+	printf "Restoring ALSA mixer settings ... "
+	if alsactl restore > /dev/null 2>&1; then
+	    echo "done."
 	else
-	    echo "Starting ALSA (unknown version): failed - ALSA modules not installed"
+	    echo "failed:"
+	    echo "       You may want to run 'alsactl restore' manually to view any errors."
 	    exit 1
 	fi
-
-	printf "Starting ALSA (version %s):" "$alsa_version"
-
-	module_list="$(grep -E "^[[:space:]]*(alias|probe)[[:space:]]+snd-card-[0-9]+" \
-		       $modfile | grep -Ev '\b(off|none)\b' | sort -u | awk '{print $3}')"
-	cards_exist=false
-	if [ -d /proc/asound/card0 ]; then
-		printf " ALSA appears to be compiled statically"
-		cards_exist=true
-	elif [ -z "$module_list" ]; then
-		printf " warning, no drivers defined in %s" "$modfile"
-	else
-	    for module in $module_list; do
-		module_name="${module#*-}"
-		if modprobe "$module" > /dev/null 2>&1; then
-		    printf " %s" "$module_name"
-		    cards_exist=true
-		else
-		    printf " %s-failed" "$module_name"
-		fi
-	    done
-	fi
-	if [ "$cards_exist" = "true" ]; then
-	    echo "."
-	else
-	    echo " failed"
-	    exit
-	fi
-	
-	if [ ! -L /dev/sndstat ] && [ ! -e /dev/.devfsd ]; then
-	    rm -f /dev/sndstat && ln -s /proc/asound/oss/sndstat /dev/sndstat
-	fi
-
-	if [ "$startosslayer" = "true" ]; then
-	    for module in mixer pcm seq; do
-		modprobe "snd-${module}-oss" > /dev/null 2>&1 || true
-	    done
-	fi
-
-	if [ "$alsactl_store_on_shutdown" = "true" ]; then
-	    printf "Restoring ALSA mixer settings ... "
-	    if alsactl restore > /dev/null 2>&1; then
-		echo "done."
-	    else
-		echo "failed:"
-		echo "       You may want to run 'alsactl restore' manually to view any errors."
-		exit 1
-	    fi
-	fi
 	;;
     stop)
-	if [ -d /proc/asound ]; then
-	    if [ "$alsactl_store_on_shutdown" = "true" ]; then
-		if runlevel | grep -E "^$runlevels_save " > /dev/null 2>&1 \
-		  || runlevel | grep -E " $runlevels_save\$" > /dev/null 2>&1; then
-		    printf "Storing ALSA mixer settings ... "
-		    if alsactl store > /dev/null 2>&1; then
-			sleep 1
-			echo "done."
-		    else
-			echo "failed"
-		    fi
-		fi
-	    fi
-
-	    if [ -f /proc/asound/version ]; then
-		alsa_version="$(head -1 /proc/asound/version | cut -f7 -d" " | sed 's/\(.*\)\.$/\1/')"
-	    else
-		echo "Shutting down ALSA (unknown version): failed - internal error 3"
-		exit 1
-	    fi
-
-	    printf "Shutting down ALSA (version %s): " "$alsa_version"
-	    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
-		if [ "$ALSA_KILL_MODE" = force ]; then
-		    printf "(terminating processes) "
-		    kill $procs_using_sound
-		    sleep 2
-		    kill -9 $procs_using_sound
+	if [ "$alsactl_store_on_shutdown" != "never autosave" ]; then
+	    if runlevel | grep -E "^$runlevels_save " > /dev/null 2>&1 \
+	    || runlevel | grep -E " $runlevels_save\$" > /dev/null 2>&1; then
+		printf "Storing ALSA mixer settings ... "
+		if alsactl store > /dev/null 2>&1; then
+		    sleep 1
+		    echo "done."
 		else
-		    printf "aborting. (sound used by PIDs %s)\n" "$procs_using_sound"
-		    exit 1
+		    echo "failed"
 		fi
 	    fi
-
-	    for i in $(lsmod | awk '/^snd/ {print $1}'); do
-			$rmmod $i >/dev/null 2>&1 || :
-		done
-	    echo "done."
-	else
-	    echo "Shutting down ALSA (unknown version): not running"
 	fi
 	;;
     restart|reload)
 	$0 stop && $0 start
 	;;
-    force-*)
-	ALSA_KILL_OVERRIDE="force" $0 "${1#*-}"
-	;;
     *)
-	echo "Usage: /etc/init.d/alsa {start|stop|restart|reload|force-stop|force-restart|force-reload}"
+	echo "Usage: /etc/init.d/alsa {start|stop|restart|reload}"
 	exit 1
 	;;
 esac
Index: debian/alsa-driver/debian/alsa-base.modprobe.d
diff -u /dev/null debian/alsa-driver/debian/alsa-base.modprobe.d:1.1
--- /dev/null	Tue Apr 20 15:34:27 2004
+++ debian/alsa-driver/debian/alsa-base.modprobe.d	Tue Apr 20 15:34:26 2004
@@ -0,0 +1 @@
+install snd-pcm /sbin/modprobe --ignore-install snd-pcm && /sbin/modprobe snd-pcm-oss
Index: debian/alsa-driver/debian/alsa-base.modutils
diff -u /dev/null debian/alsa-driver/debian/alsa-base.modutils:1.1
--- /dev/null	Tue Apr 20 15:34:27 2004
+++ debian/alsa-driver/debian/alsa-base.modutils	Tue Apr 20 15:34:26 2004
@@ -0,0 +1 @@
+above snd-pcm snd-pcm-oss
Index: debian/alsa-driver/debian/alsa-base.postinst
diff -u debian/alsa-driver/debian/alsa-base.postinst:1.34 debian/alsa-driver/debian/alsa-base.postinst:1.35
--- debian/alsa-driver/debian/alsa-base.postinst:1.34	Thu Apr 15 07:20:54 2004
+++ debian/alsa-driver/debian/alsa-base.postinst	Tue Apr 20 15:34:26 2004
@@ -3,14 +3,15 @@
 set -e
 		
 if [ "$1" = "configure" ]; then
+    filename=""
     if [ ! -f /etc/default/alsa ]; then
 	if [ -f /etc/alsa/alsa-base.conf ]; then
-	    printf "Note: Moving /etc/alsa/alsa-base.conf to /etc/default/alsa\n"
-	    mv /etc/alsa/alsa-base.conf /etc/default/alsa
+	    filename="/etc/alsa/alsa-base.conf"
 	elif [ -f /etc/alsa-base.conf ]; then
-	    printf "Note: Moving /etc/alsa-base.conf to /etc/default/alsa\n"
-	    mv /etc/alsa-base.conf /etc/default/alsa
+	    filename="/etc/alsa-base.conf"
 	fi
+	printf "Note: Moving $filename to /etc/default/alsa\n"
+	mv $filename /etc/default/alsa
     fi
 fi
 
@@ -18,125 +19,43 @@
 db_version 2.0
 
 case "$1" in
-	configure)
-		db_get alsa-base/card_list || true
-		cards="$RET"
-		counter=0
-		tempfile="$(tempfile)"
-		for i in $cards ; do
-		    if [ "$i" != "done" ]; then
-			echo "alias snd-card-$counter snd-$i" >> "$tempfile"
-			counter=$(( $counter + 1 ))
-		    fi
-		done
-		echo "" >> "$tempfile"
-		if [ "$counter" -gt 0 ]; then
-			counter=$(( $counter - 1 ))
-			for i in $(seq 0 $counter) ; do
-		    	echo "alias snd-slot-$i snd-card-$i" >> "$tempfile"
-			echo "alias sound-slot-$i snd-slot-$i" >> "$tempfile"
-			done
-		fi
-		debconfbit="$(tempfile)"
-		printf "### DEBCONF MAGIC\n# This file was automatically generated by alsa-base's debconf stuff\n\n" > "$debconfbit"
-		filetodumpto="$(tempfile)"
-		cat "$debconfbit" /usr/share/alsa-base/modules-snippet.conf "$tempfile" > "$filetodumpto"
-		if dpkg --compare-versions "$2" lt "1.0+0beta10-1"; then
-			if [ -f /etc/alsa/modutils/0.9 -a ! -f /etc/alsa/modutils/1.0 ]; then
-				echo "Moving ALSA 0.9 configuration file to ALSA 1.0 location"
-				echo "(/etc/alsa/modutils/0.9 -> /etc/alsa/modutils/1.0)"
-				mv /etc/alsa/modutils/0.9 /etc/alsa/modutils/1.0
-			fi
-		fi
-		if [ ! -f /etc/alsa/modutils/1.0 ] || grep -Eq \
-            "^[[:space:]]*### DEBCONF MAGIC$" /etc/alsa/modutils/1.0 ; then
-			if [ -f /etc/alsa/modutils/1.0 ]; then
-		    	mv /etc/alsa/modutils/1.0 /etc/alsa/modutils/1.0.debconf-backup
-			fi
-		    cp $filetodumpto /etc/alsa/modutils/1.0
-		    chmod 644 /etc/alsa/modutils/1.0
-			echo "Wrote ALSA configuration to /etc/alsa/modutils/1.0"
-		else
-			echo "/etc/alsa/modutils/1.0 does not have an autoconfiguration tag, if you would"
-			echo "like this file to be automatically generated, please read point #5 of"
-			echo "/usr/share/doc/alsa-base/README.Debian"
-		fi
-		rm -f "$tempfile" "$debconfbit" "$filetodumpto"
-		if [ ! -f /etc/default/alsa ]; then
-			cp /usr/share/alsa-base/alsa-base.conf /etc/default/alsa
-		else
-			db_get alsa-base/force_stop_alsa_before_suspend
-			force_stop_modules_before_suspend="$RET"
-			db_get alsa-base/alsactl_store_on_shutdown
-			alsactl_store_on_shutdown="$RET"
-			sed -e "s/force_stop_modules_before_suspend=.*/force_stop_modules_before_suspend=$force_stop_modules_before_suspend/" \
-			-e "s/alsactl_store_on_shutdown=.*/alsactl_store_on_shutdown=$alsactl_store_on_shutdown/" /etc/default/alsa > /etc/default/alsa.tmp
-			mv /etc/default/alsa /etc/default/alsa.debconf-backup
-			mv /etc/default/alsa.tmp /etc/default/alsa
-		fi
-		if [ -x /usr/sbin/update-devfsd ]; then
-			/usr/sbin/update-devfsd >&2
-		fi
-		if [ ! -c /dev/audio -a ! -c /dev/dsp -a ! -c /dev/amixer ] || [ -h /dev/snd -o ! -d /dev/snd ]; then
-			if [ ! -e /dev/.devfsd -a ! -e /dev/.udev.tdb ]; then
-				/usr/share/alsa-base/snddevices > /dev/null
-			fi
-		fi
-		;;
-	abort-upgrade|abort-remove|abort-deconfigure)
-		exit 0
-		;;
-	*)
-		echo "postinst called with unknown argument \`$1'" >&2;
-		exit 0;
+    configure)
+	if [ ! -f /etc/default/alsa ]; then
+	    cp /usr/share/alsa-base/alsa-base.conf /etc/default/alsa
+	else
+	    db_get alsa-base/alsactl_store_on_shutdown
+	    alsactl_store_on_shutdown="$RET"
+	    sed -e "s/alsactl_store_on_shutdown=.*/alsactl_store_on_shutdown=\"$alsactl_store_on_shutdown\"/" /etc/default/alsa > /etc/default/alsa.tmp
+	    mv /etc/default/alsa /etc/default/alsa.debconf-backup
+	    mv /etc/default/alsa.tmp /etc/default/alsa
+	fi
+	if [ ! -c /dev/audio -a ! -c /dev/dsp -a ! -c /dev/amixer ] || [ -h /dev/snd -o ! -d /dev/snd ]; then
+	    if [ ! -e /dev/.devfsd -a ! -e /dev/.udev.tdb ]; then
+		/usr/share/alsa-base/snddevices > /dev/null
+	    fi
+	fi
+	;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+	exit 0
+	;;
+    *)
+	echo "postinst called with unknown argument \`$1'" >&2;
+	exit 0;
 	;;
 esac
 
 if [ -z "$alsactl_store_on_shutdown" -o "$alsactl_store_on_shutdown" = 'true' ]; then
-	alsactl store >/dev/null 2>&1 || true
+    alsactl store >/dev/null 2>&1 || true
 fi
 
-modprobe_target="$(LC_ALL=C stat -c%N /etc/modprobe.d/alsa | sed "s#^\`/etc/modprobe\.d/alsa' -> \`\(/etc/alsa/modutils/0\.9\)'#\1#")"
-modutils_target="$(LC_ALL=C stat -c%N /etc/modutils/alsa | sed "s#^\`/etc/modutils/alsa' -> \`\(/etc/alsa/modutils/0\.9\)'#\1#")"
-if [ ! -e /etc/modutils/alsa ] || [ "$modutils_target" = "/etc/alsa/modutils/0.9" ]; then
-	ln -sf /etc/alsa/modutils/1.0 /etc/modutils/alsa
-fi
-if [ ! -e /etc/modprobe.d/alsa ] || [ "$modprobe_target" = "/etc/alsa/modutils/0.9" ]; then
-	ln -sf /etc/alsa/modutils/1.0 /etc/modprobe.d/alsa
-fi
-/sbin/update-modules >/dev/null 2>&1
-
-#DEBHELPER#
 
-if [ $1 = "configure" -a -n "$2" ]; then
-	if dpkg --compare-versions $2 lt 1.0.2-1; then
-		for i in 0 1 6 ; do
-			if [ -h /etc/rc$i.d/K20alsa ]; then
-				mv /etc/rc$i.d/K20alsa /etc/rc$i.d/K21alsa
-			fi
-		done
-	fi
+if dpkg --compare-versions "$2" lt "1.0.4-2"; then
+    rm -rf /etc/alsa/modutils /etc/alsa/0.9 /etc/alsa/1.0 /etc/modutils/alsa \
+    /etc/modprobe.d/alsa
+    if [ -x /sbin/update-modules ]; then
+	/sbin/update-modules
+    fi
 fi
 
-# Stolen from ripped out code to stop this fuckage once and for all.
-# Reason that debhelper is above: we want the driver running when we try 
-# this.
-
-case "$1" in
-	configure)
-		if dpkg --compare-versions "$2" lt "0.9.0rc5-0.4"; then
-			sound_devs_dev=`find /dev -type c 2> /dev/null | \
-			xargs ls -l 2> /dev/null | awk -F' ' '{print $5,$10;}' | \
-			awk '/^14,/ || /^116,/ {printf "%s\n", $2;}'| sort | uniq | \
-			tr '\n' ' '`
-			for file in $sound_devs_dev; do
-				if [ -O /var/lib/alsa-base/$file -a -e $file ]; then
-					perm=$(cat /var/lib/alsa-base/$file)
-					rm /var/lib/alsa-base/$file
-					chmod $perm $file
-				fi
-			done
-		fi
-	;;
-esac
+#DEBHELPER#
 
Index: debian/alsa-driver/debian/alsa-base.postrm
diff -u debian/alsa-driver/debian/alsa-base.postrm:1.9 debian/alsa-driver/debian/alsa-base.postrm:1.10
--- debian/alsa-driver/debian/alsa-base.postrm:1.9	Sat Feb 28 18:41:49 2004
+++ debian/alsa-driver/debian/alsa-base.postrm	Tue Apr 20 15:34:26 2004
@@ -14,15 +14,9 @@
 	if [ -x /usr/sbin/update-devfsd ]; then
 		/usr/sbin/update-devfsd >&2
 	fi
-	if [ -f /etc/alsa/alsa-base.conf ]; then
-		rm -f /etc/alsa/alsa-base.conf
-	fi
-	if [ -f /etc/default/alsa ]; then
-		rm -f /etc/default/alsa
-	fi
-	if [ -f /etc/defaults/alsa.debconf-backup ]; then
-		rm -f /etc/defaults/alsa.debconf-backup
-	fi
+	rm -f /etc/alsa/alsa-base.conf
+	rm -f /etc/default/alsa
+	rm -f /etc/defaults/alsa.debconf-backup
 	for file in /etc/alsa/modutils/1.0 /etc/alsa/modutils/0.9 \
 	    /etc/alsa/modutils/1.0.debconf-backup /etc/alsa/modutils/0.9.debconf-backup \
 	    /etc/modprobe.d/alsa /etc/modutils/alsa; do
Index: debian/alsa-driver/debian/alsa-base.templates
diff -u debian/alsa-driver/debian/alsa-base.templates:1.7 debian/alsa-driver/debian/alsa-base.templates:1.8
--- debian/alsa-driver/debian/alsa-base.templates:1.7	Thu Nov 27 23:07:22 2003
+++ debian/alsa-driver/debian/alsa-base.templates	Tue Apr 20 15:34:26 2004
@@ -1,42 +1,9 @@
-Template: alsa-base/force_stop_alsa_before_suspend
-Type: select
-_Choices: forcibly-unload-driver, stop-procs, none
-_Default: none
-_Description: Stop ALSA drivers forcibly before suspend?
- With some chipsets, the kernel may hang after your machine is resumed by
- Advanced Power Management (APM).
- .
- If this feature is enabled, the Debian ALSA system will unload the driver
- before suspending the machine, in order to prevent that kernel hanging. If
- you don't suspend your laptop, or your laptop doesn't hang after resuming,
- then you don't need to force stop.
- .
- Note: If you want to use this feature, you need to install the apmd package.
-
 Template: alsa-base/alsactl_store_on_shutdown
-Type: boolean
-Default: true
+Type: select
+_Choices: autosave always, autosave once at next shutdown, never autosave
+_Default: autosave always
 _Description: Save mixer settings across reboots?
  Should the ALSA init script store your mixer settings on shutdown? This 
  option is for people who change their mixer settings, and want to keep their
  changes across reboots. If enabled, the init script will run "alsactl store"
  on shutdown.
-
-Template: alsa-base/current_card
-Type: select
-_Choices: done, ${alsa_modules}
-_Default: done
-_Description: What driver-modules do your cards use?
- You are currently configuring ALSA's boot script. Select those
- driver-modules you want loaded at boot-time.
- .
- You have selected "${alsa_cards}" so far.
- .
- When you are finished selecting driver-modules to load, select "done".
-
-Template: alsa-base/card_list
-Type: string
-Default: done
-Description: This is a dummy question.
- This question is merely a placeholder, and is not meant to be asked.
-