Files
oam/knowledge base/linux/kernel modules.md
2024-07-24 21:58:10 +02:00

2.2 KiB

Linux kernel modules

  1. TL;DR
  2. Load modules on boot
  3. Permanent modules configuration
  4. Further readings
    1. Sources

TL;DR

# Show what kernel modules are currently loaded.
lsmod

# List all modules built into the currently running kernel.
cat "/lib/modules/$(uname -r)/modules.builtin"

# List all available modules.
find "/lib/modules/$(uname -r)" -type f -name '*.ko*'

# Show information about a module.
modinfo 'module_name'

# List the options set for loaded modules.
systool -v -m 'module_name'

# Show the comprehensive configuration of modules.
modprobe -c
modprobe -c | grep 'module_name'

# List the dependencies of modules or aliases.
# Includes the module itself.
modprobe --show-depends 'module_name'

# Load modules.
modprobe 'module_name'
modprobe 'module_name' 'parameter_1=value' 'parameter_n=value'

# Load modules by file name.
# For those not installed in "/usr/lib/modules/$(uname -r)/".
insmod 'file_name' 'arg_1' 'arg_n'

# Unload modules.
modprobe -r 'module_name'
rmmod 'module_name'

Load modules on boot

If using Systemd, put lists of modules in .conf files in the /etc/modules-load.d/ directory:

$ cat '/etc/modules-load.d/ddcutil.conf'
i2c-dev

Permanent modules configuration

Write the options in a .conf file in /etc/modprobe.d/:

# /etc/modprobe.d/raspi-wifi-workaround.conf
options brcmfmac roamoff=1 feature_disable=0x82000

Further readings

Sources