Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure modprobe to find my module?

I'm trying to get a kernel module to load at boot.

If I run insmod /path/to/module.ko, it works fine. But this has to be repeated every time I reboot.

If I run modprobe /path/to/module.ko, it can't find the module. I know modprobe uses a configuration file, but I can't get it to load the module even after adding /path/to/module.ko to /etc/modules.

What is the proper configuration?

like image 999
sep332 Avatar asked Oct 22 '08 13:10

sep332


People also ask

How do I add modules to modprobe?

In order to insert a new module into the kernel, execute the modprobe command with the module name. Following example loads vmhgfs module to Linux kernel on Ubuntu. Once a module is loaded, verify it using lsmod command as shown below. The module files are with .

How do I find my kernel modules?

You need to use modinfo command to display or show information about a Linux Kernel loaded modules. Use the lsmod command to obtain list of loaded modules in the Linux kernel.

Where is modprobe located?

modprobe looks in the module directory /lib/modules/`uname -r` for all the modules and other files, except for the optional configuration files in the /etc/modprobe.


1 Answers

You can make a symbolic link of your module to the standard path, so depmod will see it and you'll be able load it as any other module.

sudo ln -s /path/to/module.ko /lib/modules/`uname -r` sudo depmod -a sudo modprobe module 

If you add the module name to /etc/modules it will be loaded any time you boot.

Anyway I think that the proper configuration is to copy the module to the standard paths.

like image 154
Jaime Soriano Avatar answered Oct 05 '22 00:10

Jaime Soriano