I would like to load a custom kernel module upon startup on my system (Debian 9). The vermagic string of this module does not exactly match my kernel version, but I can load it using modprobe -f module_name
or insmod -f /path/to/module
and it seems to work fine.
If I just add the name of the module to /etc/modules-load.d/modules.conf
it does not work, systemctl shows that systemd-modules-load.service gets an error upon trying to load the module.
Can I tell systemd to force load the module?
Best Answer
You should be able to override the install behaviour using a configuration file in
/etc/modprobe.d
, for example/etc/modprobe.d/module_name.conf
:This instructs the module loading code to run
/sbin/modprobe -i -f module_name
when a request is made to installmodule_name
.-i
tellsmodprobe
to ignoreinstall
directives when processing the command (otherwise we’d end up with a loop).