From mboxrd@z Thu Jan 1 00:00:00 1970 From: dhylands@gmail.com (Dave Hylands) Date: Fri, 2 Sep 2011 08:18:59 -0700 Subject: How make modprobe find my kernel module? In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi Parmenides, On Fri, Sep 2, 2011 at 8:12 AM, Parmenides wrote: > Hi, > > ? ?I have write a 'hello, world!' module which is in a directory > rather than the kernel source tree. I compiled it by: > > ? ? ? ? ? ? ? ? ? ? ? make -C /usr/src/linux SUBDIRS=$PWD modules > > and installed it by: > > ? ? ? ? ? ? ? ? ? ? ? make -C /usr/src/linux SUBDIRS=$PWD modules_install > > I find it was installed at /lib/modules/2.6.34/extra. Then, I invoked > > ? ? ? ? ? ? ? ? ? ? ? ?modprobe hello.ko > > to load this module, but get a message: > > ? ? ? ? ? ? ? ? ? ? ? ?FATAL: Module hello.ko not found. > > It seems that my module is not in the modprobe's search path. Is that > true? If so, how can I configure its search path? modprobe uses modules.dep to translate module names into module locations. You can either manually add an entry into that file - found in /lib/modules/$(uname -r) or you can rerun depmod on your device (if its available). Alternatively, you can insmod your module bu providing a fully qualified path to the .ko file. insmod doesn't do any dependancy checking, so it just fails if you need symbols from some other module which isn't loaded. -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com