29

I have a third party module to go with a frame grabber. I've downloaded the kernel source, followed the vendor's instructions to compile it, and have the resulting module, arvdrv.ko, sitting in a folder.

The vendor has supplied a script that loads the module into the kernel and it works when I run it; the module is loaded but only until the next boot. The script does not use modprobe. I can access the frame grabber when the module is installed.

It appears to me that modprobe maintains a list of many modules. One can edit /etc/modules to add a module name and it will load at boot but the module arvdrv is not in modprobe's list.

My question is how to let modprobe know of the module? Does it need to be copied to a new location and if so where?

38

Using sudo:

  1. Edit the /etc/modules file and add the name of the module (without the .ko extension) on its own line. On boot, the kernel will try to load all the modules named in this file.

  2. Copy the module to a suitable folder in /lib/modules/`uname -r`/kernel/drivers. In my case this was /lib/modules/`uname -r`/kernel/drivers/pci. This will place the module in modprobe's database. I don't know if this can be a link.

  3. Run depmod. This will find all the dependencies of your module.

  4. At this point, I rebooted and then run lsmod | grep module-name to confirm that the module was loaded at boot.

See the man pages for modprobe, lsmod, and depmod for more information.

| improve this answer | |
  • 4
    I did follow your instructions but nothing worked until the vendor supplied some debugged code!!! Your answer is complete, simple, and I believe it would have worked had there not been vendor errors. Yes, I will accept it. – Nate Lockwood Jul 13 '14 at 15:21
  • 1
    Very helpful. I'd add that in 2020 (from what version?), one can (should?) add the module(s) in a .conf file, in /etc/modules-load.d/, instead of /etc/modules. – e2-e4 Aug 4 at 5:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.