--- /usr/portage/media-sound/alsa-driver/files/alsasound 2003-03-05 01:22:55.000000000 +0100 +++ /usr/portage/media-sound/alsa-driver/files/alsasound 2004-05-05 08:39:32.000000000 +0200 @@ -43,7 +43,7 @@ start() { # Start driver if it isn't already up. - if [ -d /proc/asound ] + if [ -f /proc/modules -a -d /proc/asound ] then eerror "ALSA driver is already running." return 1 @@ -55,25 +55,28 @@ ebegin "Initialising ALSA." - drivers="`/sbin/modprobe -c | \ - grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \ - awk '{print $3}'`" - for i in $drivers; do - if [ "$i" != off ]; then - einfon "Starting sound driver: $i " - /sbin/modprobe $i - eend 0 - fi - done - # The next line is a hack around output race condition (Gentoo bug #12524). - echo " " - # - # insert sequencer modules - # - if [ x"$START_ALSA_SEQ" = xyes -a -r /proc/asound/seq/drivers ]; then - t="`cut -d , -f 1 /proc/asound/seq/drivers`" - if [ "x$t" != "x" ]; then - /sbin/modprobe $t + if [ -f /proc/modules ] + then + drivers="`/sbin/modprobe -c | \ + grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \ + awk '{print $3}'`" + for i in $drivers; do + if [ "$i" != off ]; then + einfon "Starting sound driver: $i " + /sbin/modprobe $i + eend 0 + fi + done + # The next line is a hack around output race condition (Gentoo bug #12524). + echo " " + # + # insert sequencer modules + # + if [ x"$START_ALSA_SEQ" = xyes -a -r /proc/asound/seq/drivers ]; then + t="`cut -d , -f 1 /proc/asound/seq/drivers`" + if [ "x$t" != "x" ]; then + /sbin/modprobe $t + fi fi fi # @@ -157,12 +160,15 @@ # # remove all sound modules # - /sbin/lsmod | grep -E "^snd" | grep -Ev "^(snd-page-alloc|snd-hammerfall-mem)" | while read line; do \ - /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \ - done - # remove the 2.2 soundcore module (if possible) - /sbin/rmmod soundcore 2> /dev/null - /sbin/rmmod gameport 2> /dev/null + if [ -f /proc/modules ] + then + /sbin/lsmod | grep -E "^snd" | grep -Ev "^(snd-page-alloc|snd-hammerfall-mem)" | while read line; do \ + /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \ + done + # remove the 2.2 soundcore module (if possible) + /sbin/rmmod soundcore 2> /dev/null + /sbin/rmmod gameport 2> /dev/null + fi # # remove lockfile if lockdir exists