You are not logged in.
Hi!
I'm searching for a way to execute some commands before the modules are loaded.
I have a Thinkpad 600E and I need to activate my soundcard via
# echo 'activate' > /sys/devices/pnp0/00:06/resources
# echo 'activate' > /sys/devices/pnp0/00:07/resources
as it won't get activated via BIOS.
This needs to be done before the modules get loaded, else the snd-cs4236 won't see the card.
Offline
I suppose you could add that to the initscripts (rc.sysinit) before the modules are loaded.
Offline
Thx! Didn't see that one
Finally I got sound on the Thinkpad 600E .... a miracle!!! :shock:
Offline
just remember that you made that change so that when initscripts get updated you can redo your little mod...
Offline
I think modprobe.conf would be a better place to do this, as it is preserved when module-init-tools is upgraded. Check out man modprobe.conf, in particular the install command.
Offline
This seems like a good idea. I posted the info for install below so you don't have to look it up:
install modulename command...
This is the most powerful primitive in modprobe.conf: it tells
modprobe to run your command instead of inserting the module in
the kernel as normal. The command can be any shell command:
this allows you to do any kind of complex processing you might
wish. For example, if the module "fred" worked better with the
module "barney" already installed (but it didn't depend on it,
so modprobe won't automatically load it), you could say "install
fred /sbin/modprobe barney; /sbin/modprobe --ignore-install
fred", which would do what you wanted. Note the --ignore-
install, which stops the second modprobe from re-running the
same install command. See also remove below.
You can also use install to make up modules which don't other-
wise exist. For example: "install probe-ethernet /sbin/modprobe
e100 || /sbin/modprobe eepro100", which will try first the e100
driver, then the eepro100 driver, when you do "modprobe probe-
ethernet".
If you use the string "$CMDLINE_OPTS" in the command, it will be
replaced by any options specified on the modprobe command line.
This can be useful because users expect "modprobe fred opt=1" to
pass the "opt=1" arg to the module, even if there's an install
command in the configuration file. So our above example becomes
"install fred /sbin/modprobe barney; /sbin/modprobe --ignore-
install fred $CMDLINE_OPTS"
Offline
It does not seem to work from modprobe.conf:
install /bin/echo 'activate' > /sys/devices/pnp0/00:06/resources
install /bin/echo 'activate' > /sys/devices/pnp0/00:07/resources
options snd-cs4236 index=0 port=0x530 cport=0x538 irq=5 dma1=1 dma2=0 isapnp=0
No error messages at all ... devices are just not activated
adding this:
/sbin/rmmod snd-cs4236
/bin/echo 'activate' > /sys/devices/pnp0/00:06/resources
/bin/echo 'activate' > /sys/devices/pnp0/00:07/resources
/sbin/modprobe snd-cs4236
/sbin/modprobe snd-pcm-oss
/sbin/modprobe snd-mixer-oss
/sbin/modprobe snd-seq-oss
/bin/sleep 2
/usr/sbin/alsactl restore
to rc.local does the trick. But its just an "ugly" workaround.
Offline
It does not seem to work from modprobe.conf:
install /bin/echo 'activate' > /sys/devices/pnp0/00:06/resources install /bin/echo 'activate' > /sys/devices/pnp0/00:07/resources options snd-cs4236 index=0 port=0x530 cport=0x538 irq=5 dma1=1 dma2=0 isapnp=0
No error messages at all ... devices are just not activated
adding this:
/sbin/rmmod snd-cs4236 /bin/echo 'activate' > /sys/devices/pnp0/00:06/resources /bin/echo 'activate' > /sys/devices/pnp0/00:07/resources /sbin/modprobe snd-cs4236 /sbin/modprobe snd-pcm-oss /sbin/modprobe snd-mixer-oss /sbin/modprobe snd-seq-oss /bin/sleep 2 /usr/sbin/alsactl restore
to rc.local does the trick. But its just an "ugly" workaround.
You did it wrong:
install snd-cs4236 /bin/echo 'activate' > /sys/devices/pnp0/00:06/resources; /bin/echo 'activate' > /sys/devices/pnp0/00:07/resources; /sbin/modprobe --ignore-install snd-cs4236
something like this should work.
Offline
Stupid me. Thx! Works great now!
Offline