Confused about modprobe and insmod?
First of all, the "man" page tells us:- modprobe - program to add and remove modules from the Linux Kernel
- insmod - simple program to insert a module into the Linux Kernel
"modeprobe" is much more sophisticated, it has many options, can insert/remove modules from the kernel. It can also find module dependencies.
Differences:
- "modprobe" calculates all of the module dependencies and then load the module along with the dependencies, while "insmod" does not care, it only loads the module. The scene behind the calculation is the "/lib/modules/`uname -r`/modules.dep" file. This file is generated by "depmod" command when system is booted or when you run "depmod -a". An example, module1 depends on module2 and module3, in "modules.dep" file you will see module1: module2 module3. "modprobe" reads modules.dep file.- "modprobe" only deals with modules in /lib/modules/`uname -r`. So if you want to load an external module, you have to create a soft link from /path/to/module.ko to /lib/modules/`uname -r`/, for example:
# ln -s /path/to/module.ko /lib/modules/`uname -r` # depmod -a
No comments:
Post a Comment