This article will cover the methods for managing kernel modules.
For a module to be recognized as such, it has to be compiled as a module in the kernel configuration (the line related to the module will therefore display the letter M).
The Template:Codeline command handles the addition and removal of modules from the Linux kernel.
The Template:Filename directory can be used to pass module settings to udev, which will use Template:Codeline to manage the loading of the modules during system boot. You can use configuration files with any name in the directory, given that they end with the Template:Filename extension. It is not recommended to use the Template:Filename file, since it will be likely deprecated in the future (see Template:Codeline).
To manually load (or add) a module, run:
# modprobe module_name
Occasionally you could need to remove (or unload) a module; in this case use the following command:
# modprobe -r module_name
# rmmod module_name
Blacklisting when referring to Kernel modules is a mechanism to stop the kernel module loading. This is either when the associated hardware is not required to be used, or loading that module causes problems.
For example there may be a two kernel modules, that if they get loaded together try to control the same piece of hardware resulting in a conflict.
Some modules are loaded as part of the initramfs. Template:Codeline will print out all autodetected modules. To avoid initramfs from loading those modules you wish to blacklist, then blacklist them in Template:Filename. Running Template:Codeline will list all modules pulled in by the various hooks (i.e. filesystem hook, SCSI hook, etc). Remember to rebuild initramfs once you've blacklisted the modules.
Using files in Template:Filename
You can blacklist modules using the Template:Codeline keyword:
Alternatively, one can force nothing to be installed to "blacklist" that module and any that depend on it:
Using kernel command line
You can also blacklist modules on the kernel command line using the following syntax:
For example using GRUB:
The Template:Codeline option blacklists modules loaded by that name only. But if some other module depends on that module, that module will get loaded because blacklisting does not match dependent modules.
The following commands can help determine the dependencies of a module from the module itself.
- Format the contents of Template:Filename and show what kernel modules are currently loaded:
$ modinfo MODULE_1
- Use Template:Codeline to show information about Template:Codeline (including aliases and install commands):
$ modprobe --show-depends MODULE_2