Bug 972315

Summary: Yast2-sound does not properly load kernel modules when clicking 'Ok'
Product: [openSUSE] openSUSE Distribution Reporter: Christian Ehrlicher <ch.ehrlicher>
Component: YaST2Assignee: Christopher Hofmann <cwh>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: cwh
Version: Leap 42.1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Christian Ehrlicher 2016-03-23 10:30:23 UTC
When configuring a sound card with Yast2, all works fine. The test sound can be played etc.
But when finishing the configuration with a click on 'Ok', Yast2 unloads the sound kernel modules (which is fine) and tries to reload them with the help of the 'alsadrivers' script (from package yast2-sound).
The offending line is in the get_drivers() function:

get_drivers() {
  /sbin/modprobe -c | \
    grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | sort -u | \
    while read a b card; do
        echo $card
    done
}

It looks like modprobe changed it's output a little bit. With openSUSE 13.2 and Leap 42.1, 'modprobe -c' converts all '-' to '_'. This can be easily tested by simply adding a new alias to /etc/modprobe.d/99-local.conf:
alias test-chris chris

-> 'modprobe -c | grep chris' results in 'alias test_chris chris'

Therefore '+snd-card-' needs be changed to '+snd_card_' in the grep statement.
Doing the same with a very old openSUSE version (11.3 in this case) results in 'alias test-chris chris'. Don't know when the output 'modprobe -c' was changed ... but somewhere inbetween 11.3 and 13.2 :)

This also affects SLE12 / SLE12 SP1

btw:
This may be related to bug #954824
Comment 1 Stefan Hundhammer 2016-03-23 15:29:23 UTC
Thanks.

I guess that 'grep' call could be changed to make it work in both cases: Check for [-_] (or is it [_-] ? or does the '-' need to be escaped there?).
Comment 2 Christian Ehrlicher 2016-03-23 16:07:16 UTC
grep -E "^[[:space:]]*alias[[:space:]]+snd[_-]card[_-][[:digit:]]"
works for me on 42.1 and 11.3
Comment 3 Christopher Hofmann 2016-03-23 17:16:47 UTC
Will be fixed in yast2-sound-3.1.9