Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]How to pass parameters to an auto-loaded module?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DooBeDooBeDo
Apprentice
Apprentice


Joined: 21 Aug 2002
Posts: 220
Location: UK

PostPosted: Tue Feb 04, 2014 8:29 pm    Post subject: [SOLVED]How to pass parameters to an auto-loaded module? Reply with quote

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
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Tue Feb 04, 2014 8:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
DooBeDooBeDo
Apprentice
Apprentice


Joined: 21 Aug 2002
Posts: 220
Location: UK

PostPosted: Tue Feb 04, 2014 11:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2513
Location: Silver City, NM

PostPosted: Wed Feb 05, 2014 9:19 am    Post subject: Reply with quote

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
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8723
Location: ~Brussels - Belgique

PostPosted: Wed Feb 05, 2014 9:33 am    Post subject: Reply with quote

You can pass module parameters in /etc/modprobe.d

take a look at alsa.conf for example ;)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
DooBeDooBeDo
Apprentice
Apprentice


Joined: 21 Aug 2002
Posts: 220
Location: UK

PostPosted: Wed Feb 05, 2014 3:08 pm    Post subject: Reply with quote

Cool, that's much better :). I didn't like my nasty hack even though it worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum