# [SOLVED]How to pass parameters to an auto-loaded module?

## DooBeDooBeDo

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 
> ...

 

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

----------

## albright

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)

```
/etc/modprobe.d $ cat blacklist.conf 

#blacklist e1000e

blacklist thinkpad_acpi
```

and 

```
/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"
```

----------

## DooBeDooBeDo

Despite the modules being blacklisted they were loaded anyway. I've created a /etc/local.d/tevii_s464.start

```
/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...

----------

## BitJam

This is explained in "man modprobe.d":

```
       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.

----------

## xaviermiller

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

take a look at alsa.conf for example  :Wink: 

----------

## DooBeDooBeDo

Cool, that's much better  :Smile: . I didn't like my nasty hack even though it worked.

----------

