View previous topic :: View next topic |
Author |
Message |
DooBeDooBeDo Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/3480172233e4656d3ae1d3.gif)
Joined: 21 Aug 2002 Posts: 220 Location: UK
|
Posted: Tue Feb 04, 2014 8:29 pm Post subject: [SOLVED]How to pass parameters to an auto-loaded module? |
|
|
I've just got a new DVB card (Tevii S464). At boot it auto-loads a bunch of modules:
Quote: | $ modprobe --show-depends cx8802
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/v4l2-core/videobuf-core.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/v4l2-core/videobuf-dma-sg.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/common/btcx-risc.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/common/tveeprom.ko
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/pci/cx88/cx88xx.ko <-- I need to pass an argument to this one
insmod /lib/modules/3.10.17-gentoo/kernel/drivers/media/pci/cx88/cx8802.ko |
Can anyone tell me how to do this in the sanest way?
Last edited by DooBeDooBeDo on Wed Feb 05, 2014 4:34 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
albright Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/524660825462570600c7fb.jpg)
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Tue Feb 04, 2014 8:54 pm Post subject: |
|
|
adding the module (or a set of them) to /etc/modprobe.d/blacklist.conf
and then loading it (or them) via /etc/conf.d/modules might work
for example (taken from my own files)
Code: | /etc/modprobe.d $ cat blacklist.conf
#blacklist e1000e
blacklist thinkpad_acpi |
and
Code: | /etc/conf.d $ cat modules
modules="thinkpad_acpi snd_hda_intel snd_hda_codec_realtek"
module_thinkpad_acpi_args="fan_control=1"
module_snd_hda_intel_args="index=2" |
_________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
DooBeDooBeDo Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/3480172233e4656d3ae1d3.gif)
Joined: 21 Aug 2002 Posts: 220 Location: UK
|
Posted: Tue Feb 04, 2014 11:11 pm Post subject: |
|
|
Despite the modules being blacklisted they were loaded anyway. I've created a /etc/local.d/tevii_s464.start
Code: | /sbin/modprobe -r cx8800 cx8802 cx88xx btcx_risc videobuf_dma_sg videobuf_core tveeprom
/sbin/modprobe cx88xx card=86
/sbin/modprobe cx8800
/sbin/modprobe cx8802 |
Not ideal but it works :/. I'd like to know how to do this properly though. It's been quite a while since I had to mess around like this... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
BitJam Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 12 Aug 2003 Posts: 2513 Location: Silver City, NM
|
Posted: Wed Feb 05, 2014 9:19 am Post subject: |
|
|
This is explained in "man modprobe.d": Code: | Because the modprobe command can add or remove more than one module, due to
modules having dependencies, we need a method of specifying what options are to
be used with those modules. All files underneath the /etc/modprobe.d directory
which end with the .conf extension specify those options as required. [...]
options modulename option...
This command allows you to add options to the module modulename (which might
be an alias) every time it is inserted into the kernel: whether directly
(using modprobemodulename or because the module being inserted depends on
this module. |
This man page also explains how to blacklist modules. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
xaviermiller Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/18949772545903151f2312b.jpg)
Joined: 23 Jul 2004 Posts: 8723 Location: ~Brussels - Belgique
|
Posted: Wed Feb 05, 2014 9:33 am Post subject: |
|
|
You can pass module parameters in /etc/modprobe.d
take a look at alsa.conf for example ![Wink ;)](images/smiles/icon_wink.gif) _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
DooBeDooBeDo Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/3480172233e4656d3ae1d3.gif)
Joined: 21 Aug 2002 Posts: 220 Location: UK
|
Posted: Wed Feb 05, 2014 3:08 pm Post subject: |
|
|
Cool, that's much better . I didn't like my nasty hack even though it worked. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|