Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 258496 - sys-apps/module-init-tools-3.6 breaks the media-sound/alsa-utils init script
Summary: sys-apps/module-init-tools-3.6 breaks the media-sound/alsa-utils init script
Status: RESOLVED DUPLICATE of bug 258930
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://git.kernel.org/?p=linux/kernel...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 19:29 UTC by Todd Merrill
Modified: 2009-02-20 22:48 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed fix (alsasound.patch,990 bytes, patch)
2009-02-12 06:20 UTC, Tiago Santos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Todd Merrill 2009-02-10 19:29:57 UTC
After upgrading to module-init-tools-3.6, I receive the following output when trying to start the alsasound init script:

* Loading ALSA modules...
*   Loading: snd-card-0...                                                [ ok ]
*   Loading: snd-card-1...                                                [ ok ]
*   Loading: snd-card-0...                                                [ ok ]
*   Loading: snd-card-1...                                                [ ok ]
*   Loading: kernelsnd-mixer-oss...
FATAL: Module kernelsnd_mixer_oss not found.                              [ !! ]
*   Loading: kernelsnd-pcm-oss...
FATAL: Module kernelsnd_pcm_oss not found.                                [ !! ]
*   Loading: kernelsnd-seq-oss...
FATAL: Module kernelsnd_seq_oss not found.                                [ !! ]
*   Loading: kernelsnd-seq...
FATAL: Module kernelsnd_seq not found.                                    [ ok ]
* Restoring Mixer Levels...                                               [ ok ]

It turns out that modprobe no longer gives the absolute pathnames for the modules by default (please refer to the URL). Therefore the output of 'modprobe -l' will look something like this:
kernel/sound/core/oss/snd-mixer-oss.ko

Compared to previous versions, which will output something like this:
/lib/modules/2.6.28.4/kernel/sound/core/oss/snd-mixer-oss.ko

This change breaks lines like this in /etc/init.d/alsasound (line 31 here):
DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.*oss/ s:\/.*\/\(.*\).ko:\1:p')"

With module-init-tools-3.5, the above line will give the following output:
snd-pcm-oss
snd-mixer-oss
snd-seq-oss

Versus this from module-init-tools-3.6:
kernelsnd-mixer-oss
kernelsnd-pcm-oss
kernelsnd-seq-oss

Reproducible: Always

Steps to Reproduce:
Comment 1 Todd Merrill 2009-02-10 21:55:50 UTC
I'm no sed expert, but changing:
modprobe -l | sed -n -e '/snd.*oss/ s:\/.*\/\(.*\).ko:\1:p'

to:
modprobe -l | sed -n -e '/snd.*oss/ s:.*\/\(.*\).ko:\1:p'

Fixes the problem. However, I don't know how to make this backwards compatible.
Comment 2 Mike Auty (RETIRED) gentoo-dev 2009-02-11 00:47:02 UTC
I've assigned it to the baselayout guys because this change may affect more than just alsa-utils, but I've CCed the alsa team in case they want to investigate possible sed changes.
Comment 3 Tony Vroon (RETIRED) gentoo-dev 2009-02-11 00:53:51 UTC
This code has been problematic for a long time and will more likely be removed then patched up further.
Comment 4 Tony Vroon (RETIRED) gentoo-dev 2009-02-11 00:54:54 UTC
Ah wait, now loading has been broken as well. Great.
Comment 5 SpanKY gentoo-dev 2009-02-11 01:08:47 UTC
does this really need changes to module-init-tools ?  i imagine the alsa script could detect whether the path starts with a / and if it doesnt, prepend /lib/modules/`uname -r`/ ...

i'll talk to upstream to see how things should go
Comment 6 Tiago Santos 2009-02-12 06:20:33 UTC
Created attachment 181750 [details, diff]
Proposed fix

The fix seems pretty simple, just remove the obrigatory / at the beggining of the expressions

Patch attached
Comment 7 Tiago Santos 2009-02-12 06:22:37 UTC
(In reply to comment #1)
> I'm no sed expert, but changing:
> modprobe -l | sed -n -e '/snd.*oss/ s:\/.*\/\(.*\).ko:\1:p'
> 
> to:
> modprobe -l | sed -n -e '/snd.*oss/ s:.*\/\(.*\).ko:\1:p'
> 
> Fixes the problem. However, I don't know how to make this backwards compatible.
> 

Sorry, didn't see your reply, the patch i posted does exactly that, and it is backwards compatible, see:

~ $ echo "/lib/modules/2.6.28-gentoo-r1/kernel/sound/core/oss/snd-mixer-oss.ko" | sed -n -e '/snd.*oss/ s:.*\/\(.*\).ko:\1:p'
snd-mixer-oss

~ $ echo "kernel/sound/core/oss/snd-mixer-oss.ko" | sed -n -e '/snd.*oss/ s:.*\/\(.*\).ko:\1:p'
snd-mixer-oss

Comment 8 SpanKY gentoo-dev 2009-02-12 06:34:48 UTC
maybe i'm missing something, but why are you escaping the / in the replacement expression ?  you're using a : as a delimiter, so there's no need for / to be escaped.
Comment 9 Tiago Santos 2009-02-12 06:52:16 UTC
(In reply to comment #8)
> maybe i'm missing something, but why are you escaping the / in the replacement
> expression ?  you're using a : as a delimiter, so there's no need for / to be
> escaped.
> 

You're right, it isn't needed, but it was there for the first time, so i just kept
Comment 10 SpanKY gentoo-dev 2009-02-12 06:58:47 UTC
fair enough.  please 2 remove though as all of the \/\/\/\/\/ makes me cry ;).
Comment 11 Mike Auty (RETIRED) gentoo-dev 2009-02-20 22:48:59 UTC
Ok, sadly there's two bugs open for this.  Since the other bug has an identical patch, but without the \/'s I'm going to mark this one as the duplicate, even though it was technically filed earlier...

So, are we now just waiting for someone from the alsa herd to apply it?

*** This bug has been marked as a duplicate of bug 258930 ***