Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 50071 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/media-sound/alsa-driver/files/alsasound (-26 / +32 lines)
Lines 43-49 Link Here
43
start() {
43
start() {
44
44
45
  # Start driver if it isn't already up.
45
  # Start driver if it isn't already up.
46
  if [ -d /proc/asound ]
46
  if [ -f /proc/modules -a -d /proc/asound ]
47
  then
47
  then
48
    eerror "ALSA driver is already running."
48
    eerror "ALSA driver is already running."
49
    return 1
49
    return 1
Lines 55-79 Link Here
55
55
56
  ebegin "Initialising ALSA."
56
  ebegin "Initialising ALSA."
57
57
58
  drivers="`/sbin/modprobe -c | \
58
  if [ -f /proc/modules ]
59
    grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \
59
  then
60
    awk '{print $3}'`"
60
    drivers="`/sbin/modprobe -c | \
61
  for i in $drivers; do
61
      grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \
62
    if [ "$i" != off ]; then
62
      awk '{print $3}'`"
63
      einfon "Starting sound driver: $i "
63
    for i in $drivers; do
64
      /sbin/modprobe $i
64
      if [ "$i" != off ]; then
65
      eend 0
65
        einfon "Starting sound driver: $i "
66
    fi
66
        /sbin/modprobe $i
67
  done
67
        eend 0
68
  # The next line is a hack around output race condition (Gentoo bug #12524).
68
      fi
69
  echo " "
69
    done
70
  #
70
    # The next line is a hack around output race condition (Gentoo bug #12524).
71
  # insert sequencer modules
71
    echo " "
72
  #
72
    #
73
  if [ x"$START_ALSA_SEQ" = xyes -a -r /proc/asound/seq/drivers ]; then
73
    # insert sequencer modules
74
    t="`cut -d , -f 1 /proc/asound/seq/drivers`"
74
    #
75
    if [ "x$t" != "x" ]; then
75
    if [ x"$START_ALSA_SEQ" = xyes -a -r /proc/asound/seq/drivers ]; then
76
      /sbin/modprobe $t
76
      t="`cut -d , -f 1 /proc/asound/seq/drivers`"
77
      if [ "x$t" != "x" ]; then
78
        /sbin/modprobe $t
79
      fi
77
    fi
80
    fi
78
  fi
81
  fi
79
  #
82
  #
Lines 157-168 Link Here
157
  #
160
  #
158
  # remove all sound modules
161
  # remove all sound modules
159
  #
162
  #
160
  /sbin/lsmod | grep -E "^snd" | grep -Ev "^(snd-page-alloc|snd-hammerfall-mem)" | while read line; do \
163
  if [ -f /proc/modules ]
161
     /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \
164
  then
162
  done
165
    /sbin/lsmod | grep -E "^snd" | grep -Ev "^(snd-page-alloc|snd-hammerfall-mem)" | while read line; do \
163
  # remove the 2.2 soundcore module (if possible)
166
       /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \
164
  /sbin/rmmod soundcore 2> /dev/null
167
    done
165
  /sbin/rmmod gameport 2> /dev/null
168
    # remove the 2.2 soundcore module (if possible)
169
    /sbin/rmmod soundcore 2> /dev/null
170
    /sbin/rmmod gameport 2> /dev/null
171
  fi
166
172
167
  #
173
  #
168
  # remove lockfile if lockdir exists
174
  # remove lockfile if lockdir exists

Return to bug 50071