LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-21-2010, 02:56 PM   #1
kerneluser
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
Question how can I load a kernel 2.6 module with the -f force option ?


I have a loadable module, simple enough I believe it should run on any 2.6 kernel. I want to force the load and test that assumption. How can I do it?

ismod does not seem to notice the -f in 2.7
modprobe has -f but cannot locate the module.


I tried: modprobe -f ./MYMODULE.ko

No go. So I read the manpage for modprobe which says: modprobe looks in the module directory /lib/modules/'uname -r'

So I copied MYMODULE.ko to /lib/modules/2.6.(the only directory in here) and type: modprobe -f MYMODULE.ko

Still can't locate MYMODULE.ko.

I notice there are no other .ko modules in that directory; so I go in deeper to kernel/drivers/char, guessing about the char directory, and copy MYMODULE.ko there.

modprobe -f MYMODULE.ko

Can't locate MYMODULE.ko
-------------------------------------

Why can't modprobe find the module?

If modprobe does find it, will modprobe -f work?

I don't have any dependencies. Is there any way to make insmod -f work?
 
Old 01-22-2010, 01:23 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
After you build your module, you can copy it to /lib/modules:
Code:
cp MYMODULE.ko /lib/modules/$(uname -r)/kernel/drivers/MYDEVICE/
Ideally you should make your own directory under the drivers directory, but for testing, it can go pretty much anywhere in the /lib/modules/$(uname -r) hierarchy.

Then you need to run depmod so that modprobe can find the driver and its dependencies:
Code:
depmod -a
The '-a' flag makes it search /lib/modules and regenerate the modules database.

Then you should be ready to modprobe.

Last edited by neonsignal; 01-22-2010 at 01:27 AM.
 
  


Reply

Tags
modprobe


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile and load kernel module automatically after boot? (Intel NIC module) touser Linux - Newbie 3 08-29-2009 08:45 PM
Optimizing the Kernel - Loadable Module Support Option? boler Linux - Software 1 01-02-2009 03:02 PM
How to force remove a kernel module duyuyang Linux - Kernel 6 11-27-2008 01:42 AM
How Can I Force Removal of a Kernel Module (ERROR: Module usb_storage is in use) klearview Linux - Software 2 10-10-2008 09:20 PM
Kernel compilation: Is it posiible to change built-in[] option to module<> ravime Linux - Kernel 4 07-30-2007 08:12 AM


All times are GMT -5. The time now is 07:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration