3

The answers in Are driver modules loaded and unloaded automatically? describe how Linux kernel modules are auto loaded at boot based on the hardware in the system.

My question is, can this be short circuited? In other words, how can I ensure that the auto load doesn't take place for the LKM's I'm writing, so that I can do the loading manually during early testing phase?

1 Answers1

1

Don't put your module in the directory under /lib/modules where modprobe goes to look for module files.

If there's a module there that would handle this device and you want to skip it in favor of your module, blacklist the module by writing a file /etc/modprobe.d/my-blacklist.conf (the name can be anything “reasonable” with the .conf extension) containing

blacklist nameofthemodule