/etc/modules seems to be loaded by /etc/init/module-init-tools.conf. The first argument is the module name, other arguments are the parameters. Adding the following to /etc/modules seems fine:
thinkpad_acpi fan_control=1
To load this module and set these parameters in the very early stage of boot, add the previous line to /etc/initramfs-tools/modules file. After a change in that file, you need to regenerate the ramdisk:
sudo update-initramfs -u
As a possible alternative, you can try to add the options to the kernel line (I haven't tested it myself, but it seems to work for settings like i915.modeset=1. Edit /etc/default/grub and find the line with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash". Replace it by something like:
Setting module options using files in /etc/modprobe.d/
Files in /etc/modprobe.d/ directory can be used to pass module settings to udev, which will use modprobe to manage the loading of the modules during system boot. Configuration files in this directory can have any name, given that they end with the .conf extension. The syntax is:
/etc/modprobe.d/thinkfan.conf
---------------------------------------------------------
# On ThinkPads, this lets the 'thinkfan' daemon control fan speed
options thinkpad_acpi fan_control=1
As far as I know, you can use the mentioned method for modules that are automatically loaded at boot time (to avoid unloading and reloading modules with special parameters, as this might be the case for driver modules), and the /etc/modules file for modules that are not automatically loaded at boot time.
With Ubuntu 16.04 one can no longer include kernel module parameters in /etc/modules. An error is generated in the boot log saying it can't find "my_kernel_mod myparam=x".
Instead one needs to put only the kernel module name in /etc/modules and put the options in /etc/modprobe.d/myfilename.conf (as suggested above).
/etc/modules
seems to be loaded by/etc/init/module-init-tools.conf
. The first argument is the module name, other arguments are the parameters. Adding the following to/etc/modules
seems fine:To load this module and set these parameters in the very early stage of boot, add the previous line to
/etc/initramfs-tools/modules
file. After a change in that file, you need to regenerate the ramdisk:As a possible alternative, you can try to add the options to the kernel line (I haven't tested it myself, but it seems to work for settings like
i915.modeset=1
. Edit/etc/default/grub
and find the line withGRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
. Replace it by something like:To get a list of options for a kernel module:
This did not work for
i915
, for that I had to run:To get the current value of a module parameter, run:
For the
fan_control
parameter of thethinkpad_acpi
module, you have to run:If this function returns an error, check if the module was loaded and whether the option exist or not.
Setting module options using files in /etc/modprobe.d/
Files in /etc/modprobe.d/ directory can be used to pass module settings to udev, which will use modprobe to manage the loading of the modules during system boot. Configuration files in this directory can have any name, given that they end with the .conf extension. The syntax is:
For example:
Source:Kernel modules - ArchWiki
As far as I know, you can use the mentioned method for modules that are automatically loaded at boot time (to avoid unloading and reloading modules with special parameters, as this might be the case for driver modules), and the
/etc/modules
file for modules that are not automatically loaded at boot time.With Ubuntu 16.04 one can no longer include kernel module parameters in
/etc/modules
. An error is generated in the boot log saying it can't find "my_kernel_mod myparam=x".Instead one needs to put only the kernel module name in
/etc/modules
and put the options in /etc/modprobe.d/myfilename.conf (as suggested above).