06-B.6: Kernel Modules - Configuration
- Page ID
- 32788
Kernel Module Configuration
The modprobe command can add or remove modules. Since modules have dependencies, we need a method of specifying what options are to be used with those modules. All .conf files within the /etc/modprobe.d directory extension specify the options required for the various modules. The configuration files can be used to create aliases (alternate names for a module), or they can override the normal modprobe behavior altogether for those with special requirements. The default location of the .conf files are in the /etc/modprobe.d directory. In older versions of Linux these configurations were in the /etc/modprobe.conf file.
This video discusses a bit about the /etc/modprobe.d directory and the dmesg command, which we will see in a couple of pages.
Loadable modules can be defined in .conf files in the /etc/modules.d directory in order to load them during the init portion of the system boot process. Each module is listed one per-line. For example the /etc/modules.d/networking.conf file contains a list of 3 modules that should be loaded at boot time.
tun
e1000e
brcmfmac
To avoid a module from loading, add it by name to a file in /etc/modprobe.d/ and precede each module name with the blacklist keyword:
blacklist uhci_hcd
blacklist nvidia
There is also the capability to create aliases for module names. Aliases are alternate names for a module. In the following example we have a /etc/modprobe.d/myalias.conf file that contains a very short alias mymod, instead of the long module name.
alias mymod really_long_module_name
Adapted from:
"Kernel modules" by Multiple contributors, Gentoo is licensed under CC BY-SA 3.0