You are not logged in.

#1 2010-10-09 21:04:04

masutu
Member
Registered: 2010-01-30
Posts: 40

Automatically execute command after modprobe

Hi,

i'm searching for a proper solution for executing commands after modprobing a module.
I had some issues with my soundcard. Automuting the internal speakers when plugging in a headphone jack did not work. I found a workaround in this thread:
https://bugs.launchpad.net/ubuntu/+sour … bug/580006
So you need to execute the following commands to make the soundcard work properly:

echo 0x1d 0x411111f0 > /sys/class/sound/hwC0D0/user_pin_configs
echo 1 > /sys/class/sound/hwC0D0/reconfig

What i did is creating a file under "/etc/modprobe.d":

#/etc/modprobe.d/sound.conf
options snd-hda-intel model=auto
install snd-hda-intel /sbin/modprobe --ignore-install snd-hda-intel $CMDLINE_OPTS; { echo 0x1d 0x411111f0 > /sys/class/sound/hwC0D0/user_pin_configs; echo 1 > /sys/class/sound/hwC0D0/reconfig; }

This works, but the man-page of modprobe.d says

install modulename command...
...
The  long term future of this command as a solution to the problem of providing additional module dependencies is not assured and it is intended to replace this command with a warning about its eventual removal or deprecation at some point in a future release.
...

So the "install modulename command..." approach doesn't seem to be the best solution. Does anybody know how to solve this problem in a more elegant way?

Offline

#2 2010-10-09 21:37:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Automatically execute command after modprobe

Have you tried putting them in /etc/rc.local?

Offline

Board footer

Powered by FluxBB