[Pkg-alsa-devel] Bug#237003: marked as done (alsa-base: /etc/init.d/alsa contains messy duplicated code (+ doesn't work with udev))

Debian Bug Tracking System owner@bugs.debian.org
Sun, 25 Apr 2004 23:03:12 -0700


Your message dated Mon, 26 Apr 2004 01:47:05 -0400
with message-id <E1BHyxN-0002uS-00@newraff.debian.org>
and subject line Bug#237003: fixed in alsa-driver 1.0.4-2
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 9 Mar 2004 08:43:39 +0000
>From martins@ozlabs.org Tue Mar 09 00:43:39 2004
Return-path: <martins@ozlabs.org>
Received: from ozlabs.org [203.10.76.45] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1B0cpu-0005AC-00; Tue, 09 Mar 2004 00:43:38 -0800
Received: by ozlabs.org (Postfix, from userid 1004)
	id E603C2BD53; Tue,  9 Mar 2004 19:43:36 +1100 (EST)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Martin Schwenke <martin@meltin.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: alsa-base: /etc/init.d/alsa contains messy duplicated code (+ doesn't work
 with udev)
Reply-To: Martin Schwenke <martin@meltin.net>
X-Mailer: reportbug 2.50
Date: Tue, 09 Mar 2004 13:13:27 +1100
Message-Id: <20040309084336.E603C2BD53@ozlabs.org>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_08 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-4.2 required=4.0 tests=DATE_IN_PAST_06_12,
	HAS_PACKAGE autolearn=no version=2.60-bugs.debian.org_2004_03_08
X-Spam-Level: 

Package: alsa-base
Version: 1.0.3-1
Severity: minor


While trying to add a "sleep 1" as a workaround for a race condition
that occurs when using udev as /dev, I found that /etc/init.d/alsa
contains some messy duplicated code.  Here's a patch:

--------8<---------8<-------- CUT HERE --------8<---------8<--------
--- /tmp/alsa.init.d	2004-03-09 09:46:44.000000000 +1100
+++ /etc/init.d/alsa	2004-03-09 13:00:57.000000000 +1100
@@ -50,17 +50,14 @@
 
 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/')"
-	elif modprobe snd > /dev/null 2>&1; then
-	    if [ -f /proc/asound/version ]; then
-		alsa_version="$(head -1 /proc/asound/version | cut -f7 -d" " | sed 's/\(.*\)\.$/\1/')"
-	    else
-		echo "Starting ALSA (unknown version): failed - internal error 1"
-		exit 1
-	    fi
 	else
-	    echo "Starting ALSA (unknown version): failed - ALSA modules not installed"
+	    echo "Starting ALSA (unknown version): failed - internal error 1"
 	    exit 1
 	fi
 
--------8<---------8<-------- CUT HERE --------8<---------8<--------

This way setting $alsa_version is only done in one place (so if the
logic changes, it only needs to be changed once).  Similarly, the
error message is only printed once.  You could argue that information
is lost, but "internal error" is about as useful/useless as any
message you can print here.  :-)

The "sleep 1" is probably a bad hack, but it works for me...  :-)

peace & happiness,
martin

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.4-rc1-bk3
Locale: LANG=C, LC_CTYPE=C

Versions of packages alsa-base depends on:
pn  alsa-utils                               Not found.
ii  debconf                      1.4.14      Debian configuration management sy
ii  debianutils                  2.7.2       Miscellaneous utilities specific t
ii  lsof                         4.70-1      List open files.
ii  module-init-tools            3.0-pre10-1 tools for managing Linux kernel mo
ii  modutils                     2.4.26-1    Linux module utilities
ii  procps                       1:3.2.0-1   The /proc file system utilities
ii  psmisc                       21.4-1      Utilities that use the proc filesy

-- debconf information:
  alsa-common/card-list: 
* alsa-base/alsactl_store_on_shutdown: true
* alsa-base/current_card: done
* alsa-base/force_stop_alsa_before_suspend: none
  alsa-base/card_list: cs46xx done


---------------------------------------
Received: (at 237003-close) by bugs.debian.org; 26 Apr 2004 05:53:05 +0000
>From katie@ftp-master.debian.org Sun Apr 25 22:53:05 2004
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1BHz3B-0003aK-00; Sun, 25 Apr 2004 22:53:05 -0700
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1BHyxN-0002uS-00; Mon, 26 Apr 2004 01:47:05 -0400
From: Steve Kowalik <stevenk@debian.org>
To: 237003-close@bugs.debian.org
X-Katie: $Revision: 1.49 $
Subject: Bug#237003: fixed in alsa-driver 1.0.4-2
Message-Id: <E1BHyxN-0002uS-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Mon, 26 Apr 2004 01:47:05 -0400
Delivered-To: 237003-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 
X-CrossAssassin-Score: 10

Source: alsa-driver
Source-Version: 1.0.4-2

We believe that the bug you reported is fixed in the latest version of
alsa-driver, which is due to be installed in the Debian FTP archive:

alsa-base_1.0.4-2_all.deb
  to pool/main/a/alsa-driver/alsa-base_1.0.4-2_all.deb
alsa-driver_1.0.4-2.diff.gz
  to pool/main/a/alsa-driver/alsa-driver_1.0.4-2.diff.gz
alsa-driver_1.0.4-2.dsc
  to pool/main/a/alsa-driver/alsa-driver_1.0.4-2.dsc
alsa-headers_1.0.4-2_all.deb
  to pool/main/a/alsa-driver/alsa-headers_1.0.4-2_all.deb
alsa-source_1.0.4-2_all.deb
  to pool/main/a/alsa-driver/alsa-source_1.0.4-2_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 237003@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Steve Kowalik <stevenk@debian.org> (supplier of updated alsa-driver package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 26 Apr 2004 15:27:55 +1000
Source: alsa-driver
Binary: alsa-source alsa-headers alsa-base
Architecture: source all
Version: 1.0.4-2
Distribution: unstable
Urgency: low
Maintainer: Debian ALSA Maintainers <pkg-alsa-devel@lists.alioth.debian.org>
Changed-By: Steve Kowalik <stevenk@debian.org>
Description: 
 alsa-base  - ALSA sound driver common files
 alsa-headers - ALSA sound driver header files
 alsa-source - ALSA sound driver source
Closes: 191501 195516 199739 203491 210440 218655 229486 232380 232854 237003 237452 238278 238694 238994 240125 240594 240594 242720 243876 244068 245031 245783
Changes: 
 alsa-driver (1.0.4-2) unstable; urgency=low
 .
   * Steve Kowalik:
     - Actually do some work on this package!
     - Check for the presence of either devfs or udev before creating device
       nodes in alsa-base's postinst. (Closes: #243876)
     - Rewrite the init script to not load modules. Loading modules is now
       the responsibility of the user, or hotplug.
       (Closes: #195516, #203491, #210440, #232380, #237003, #237452, #240594)
       (Closes: #244068, #245783)
     - Stop alsa-base depending on lsof and procps.
     - Change the description for alsa-base to no longer mention module
       loading.
     - Rewrite the debconf-age for alsa-base:
       + Stop asking which modules to load. (Closes: #199739, #218655)
       + Only ask one question about saving mixer settings, in the style of
         setserial.
       + This means we can stop doing vile things to the debconf templates in
         debian/rules.
       + This also means that alsa can restore on bootup, and not save on
         shutdown. (Closes: #191501, #232854)
     - Remove the files under /etc/alsa/modutils, and the symlinks
       into /etc/modprobe.d and /etc/modutils.
     - Provide an alsa-base file under /etc/modprobe.d and /etc/modutils
       which will load the OSS compatibility modules.
       (Closes: #229486, #240594)
     - Blacklist (for hotplug) and skip (for discover) the OSS sound modules.
       Note that we can include the blacklist automatically for hotplug, but
       discover doesn't contain the infrastructure for that, so the file for
       discover is in /usr/share/doc/alsa-base.
       (Closes: #238278, #238694, #240125, #242720)
     - Due to the fact that the init script no longer touches modules, this
       script has been gutted to a shadow of its former self. (Closes: #238994)
     - Stop using install -d so liberally in debian/rules.
     - Rename debian/po/no.po to debian/po/nb.po.
     - Correct typo in debian/po/fr.po. (Closes: #245031) (thanks,
       Pierre Machard)
     - Remove debian/alsa-path, I can't see anything at all that references it.
   * Unreleased and untested.
Files: 
 d6e7b7fad0ff1f319377dfe1ee4583ec 805 sound optional alsa-driver_1.0.4-2.dsc
 32b5582e8c4aca3db9d856983f79b124 133458 sound optional alsa-driver_1.0.4-2.diff.gz
 421623be15597077ac2f2b8241ea69cd 45680 sound optional alsa-base_1.0.4-2_all.deb
 e3fb94c3d3f6683b33a9ebc8966b444d 1819260 sound optional alsa-source_1.0.4-2_all.deb
 bc2169190003c566e7523a020878244a 55920 sound optional alsa-headers_1.0.4-2_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAjJ8yCfB0CMh//C8RAuDhAKDOw+UJxM1HA4lUSj5z2nD9F3gKXQCdG6hM
HXdppa/6Ew9HAsCreguhWTc=
=YZy3
-----END PGP SIGNATURE-----