diff --git a/.vscode/settings.json b/.vscode/settings.json index 4e1fcf4..a3f0693 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -83,6 +83,7 @@ "radeon", "replicatedctl", "rfkill", + "rmmod", "rootlv", "rootvg", "runcmd", @@ -95,6 +96,7 @@ "swapfile", "swapon", "sysrc", + "systool", "tclsh", "templating", "tfvars", diff --git a/knowledge base/linux kernel modules.md b/knowledge base/linux kernel modules.md new file mode 100644 index 0000000..41af315 --- /dev/null +++ b/knowledge base/linux kernel modules.md @@ -0,0 +1,67 @@ +# Linux kernel modules + +## Table of contents + +1. [TL:DR](#tldr) +1. [Permanent modules configuration](#permanent-modules-configuration) +1. [Further readings](#further-readings) +1. [Sources](#sources) + +## TL:DR + +```sh +# Show what kernel modules are currently loaded. +lsmod + +# 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' +``` + +## Permanent modules configuration + +Write the options in a `.conf` file in `/etc/modprobe.d/`: + +```conf +# /etc/modprobe.d/raspi-wifi-workaround.conf +options brcmfmac roamoff=1 feature_disable=0x82000 +``` + +## Further readings + +## Sources + +All the references in the [further readings] section, plus the following: + +- The [Kernel module] page in the [Arch wiki] + + + + +[further readings]: #further-readings + + +[arch wiki]: https://wiki.archlinux.org +[kernel module]: https://wiki.archlinux.org/title/Kernel_module