# Load kernel module with parameters

## tava

Hello,

I've a problem to load a module with paramaters, specially the module thinkpad_acpi. The option for that module is fan_control=1. When I load that module in the command line, everything works fine. If I add the following lines into the /etc/conf.d/modules

modules="thinkpad_acpi"

module_thinkpad_acpi_args="fan_control=1"

the module will be loaded, but the option fan_control will be ignored. I use a 64bit installation with baselayout-2.0.3.

Have anybody an idea?

Thanks

----------

## bjlockie

Did you run 

```
update-modules
```

?

Check  /etc/modules.conf

----------

## pste

I had essentially the same problem (apparently) -> I wanted to disable autosuspend for all usb devices (due to spurious disconnects when usb-harddrives enter powersaving modes...) and I found that things worked rather well when manually issuing:

```
echo -1 > /sys/module/usbcore/parameters/autosuspend
```

 since all later plugged in usb devices then get this setting. But the following lines in /etc/conf.d/modules does not work for me, just as for tava:

```
modules="usbcore"

module_usbcore_args="autosuspend=-1
```

The usbcore module shows up alright during init as an autoloaded module, but it does not get the autosuspend value (it has the default value of 2) - is there a syntax error?

@bjlockie - what about /etc/modules.conf? I have no such a file on my system and according to http://www.gentoo.org/doc/en/openrc-migration.xml module settings should be placed into /etc/conf.d/modules precisely as tava and me tried... *Quote:*   

> Kernel modules
> 
> Normally, when you want certain kernel modules automatically loaded at boot, you place them into /etc/modules.autoload.d/kernel-2.6 along with any parameters you wanted to pass to them. In baselayout-2, this file is not used anymore. Instead, autoloaded modules and module parameters are placed in one file, /etc/conf.d/modules, no matter the kernel version. 

 

[An Alternative Solution]

However, to me the solution was to add a file I called usbcore.conf to /etc/modprobe.d/ with this content:

```
# disable usb powersave by default

options usbcore autosuspend=-1
```

 and I would suggest tava to try a similar approach. Although, I still think it is curious that the documented way in the openrc guide doesn't work...

/pste

----------

## Hu

If I recall correctly, USB suspend is a kernel option that can be disabled.  If you never want to suspend your USB devices, then you should just compile out that feature.

----------

## pste

@Hu, yes of course you can disable certain things completely with kernel settings, but I personally like to keep some options open for alteration without kernel recomplilation and rebooting  :Cool: 

Besides, the main question was about how to get module options loaded by default and my usb situation was just one example similar to the original post. And I still think it's curious that the (openrc) documented way doesn't seem to work...

/pste

----------

