Linux kernel: Difference between revisions

imported>Tobias.bora
No edit summary
imported>Tobias.bora
No edit summary
Line 148: Line 148:
</syntaxHighlight>
</syntaxHighlight>


and the module will be automatically loaded after a reboot. If you want instead to load it at stage 1 (before the root is even mounted), you need to add it to `boot.initrd.availableKernelModules` and `boot.initrd.kernelModules`.
and the module will be automatically loaded after a reboot. If you want instead to load it at stage 1 (before the root is even mounted), you need to add it to <code>boot.initrd.availableKernelModules</code> and <code>boot.initrd.kernelModules</code>.


Note that if you don't reboot, you can still load manually the module using `modprobe yourmodulename`, and to automatically enable a module during configuration switch/reboot, you can put `modprobe yourmodulename || true` inside the script of a systemctl service (it is for example what does wireguard).
Note that if you don't reboot, you can still load manually the module using <code>modprobe yourmodulename></code>, and to automatically enable a module during configuration switch/reboot, you can put <code>modprobe yourmodulename || true</code> inside the script of a systemctl service (it is for example what does wireguard).


Finally, if you want to define some options by default (used when you load manually a module using `modprobe`, or when the system boots), you can specify them in:
Finally, if you want to define some options by default (used when you load manually a module using <code>modprobe</code>, or when the system boots), you can specify them in:


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>