]> git.pld-linux.org Git - packages/alsa-utils.git/commitdiff
- now really works on kernel 2.6 using /etc/modprobe.conf
authorhavner <havner@pld-linux.org>
Fri, 21 Nov 2003 10:36:47 +0000 (10:36 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- fixed some error messages in strange cases

Changed files:
    alsasound.init -> 1.6

alsasound.init

index 0f2e9d8ab8f163d253ee0282ec90e4b0ad6f3855..f131d1c43ede3b308c8f837633ca89fec012ec1e 100644 (file)
 
 alsactl=/usr/sbin/alsactl
 
-if [ -r /etc/modules.conf ]; then
-MODULES_CONF=/etc/modules.conf
+if [ $(kernelverser) = "002006" ]; then
+       MODULES_CONF=/etc/modprobe.conf
+elif [ -r /etc/modules.conf ]; then
+       MODULES_CONF=/etc/modules.conf
 else
-MODULES_CONF=/etc/conf.modules
+       MODULES_CONF=/etc/conf.modules
 fi
 
+echo $MODULES_CONF
+
 driver_start()
 {
   #
@@ -46,7 +50,14 @@ driver_start()
   if OLDLOGLEV=$(awk '{print $1}' < /proc/sys/kernel/printk 2> /dev/null); then
        /sbin/loglevel 1
   fi
-  awk '$1 == "alias" && $3 != "off" && ($2 ~ /^snd-card-[0-9]$/ || $2 ~ /^sound-service-[0-9]-[0-9]+$/) {print $2}' < $MODULES_CONF | \
+  awk '$1 == "alias" && $3 != "off" && ($2 ~ /^snd-card-[0-9]$/) {print $2}' < $MODULES_CONF | \
+    while read line; do \
+      msg_starting "sound driver: $line"
+      busy
+      /sbin/modprobe $line
+      ok
+    done
+  awk '$1 == "alias" && $3 != "off" && ($2 ~ /^sound-service-[0-9]-[0-9]+$/) {print $2}' < $MODULES_CONF | \
     while read line; do \
       msg_starting "sound driver: $line"
       busy
@@ -71,15 +82,9 @@ detect_stop()
   #
   # remove all sound modules
   #
-  for module in `/sbin/lsmod | awk '/^snd/ { print $1 }'`; do
-       /sbin/rmmod `echo $module | cut -d ' ' -f 1` > /dev/null 2>&1
-       if [ $? == 1 ]; then
-               echo
-               show "ERROR: unable to umount module : "$module
-               return 1
-       fi
+  /sbin/lsmod | awk '/^snd/ { print $0 }' | while read line; do \
+     /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \
   done
-  return 0
 }
 
 driver_stop()
@@ -96,7 +101,6 @@ driver_stop()
   # remove all sound modules
   #
   detect_stop
-  return $?
 }
 
 detect_start()
@@ -130,16 +134,7 @@ case "$1" in
                                exit 1
                        fi
                else
-                       if [ $(kernelverser) == 002004 ]; then
-                               driver_start
-                               if [ -d /proc/asound ]; then
-                                       touch /var/lock/subsys/alsasound
-                               else
-                                       exit 1
-                               fi
-                       else
-                               msg_already_running "ALSA driver"
-                       fi
+                       msg_already_running "ALSA driver"
                fi
        fi
        ;;
@@ -148,18 +143,12 @@ case "$1" in
        if [ -d /proc/asound ]; then
                show "Shutting down sound driver:"
                busy
-
                if [ -f /proc/asound/detect ]; then
                        detect_stop
                else
                        driver_stop
-                       if [ $? == 1 ]; then
-                               fail
-                               exit 1
-                       fi
                fi
-               
-               (rmmod isapnp; rmmod soundcore) > /dev/null 2>&1
+               (rmmod isapnp; rmmod soundcore) 2> /dev/null
                if [ -d /var/lock/subsys ]; then
                        rm -f /var/lock/subsys/alsasound
                fi
This page took 0.028889 seconds and 4 git commands to generate.