LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 03-02-2004, 11:23 PM   #1
eshwar_ind
Member
 
Registered: Feb 2004
Location: Bangalore
Distribution: Redhat
Posts: 144

Rep: Reputation: 15
How modprobe works?


Can anybody tell me how modprobe knows where my module is located?
How can we change that path?
Thanks in advance.
bye,
Eshwar
 
Old 03-03-2004, 02:00 AM   #2
chewysplace
Member
 
Registered: Sep 2003
Distribution: Slackware 10 w/ Kernel 2.6.8
Posts: 176

Rep: Reputation: 30
just type in a console "man modprobe" it tells you what you need to know. the config file is /etc/modprobe.conf incase you need that too. it looks under /lib/modules/2.X.X/kernel for the main modules
 
Old 03-03-2004, 05:30 AM   #3
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
modprobe is a program that can be deleted if ya want to (i did), its just a symlink to insmod (with some tag i think), but for simplest module loading just type
insmod (modname)
like:
insmod unix (for unix domain sockets)
insmod isofs (cdrom files system suport)
 
Old 03-03-2004, 05:34 AM   #4
eshwar_ind
Member
 
Registered: Feb 2004
Location: Bangalore
Distribution: Redhat
Posts: 144

Original Poster
Rep: Reputation: 15
I know that friend i am asking about modprobe probing Path.
its ok i have found it. But i dont know how to change it.
if you know please let me know.
 
Old 12-17-2008, 11:37 AM   #5
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
can you tell me how this "modprobe" fetch the module path?
 
Old 12-17-2008, 12:17 PM   #6
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
The path "/lib/modules" is hardcoded into modprobe.
 
Old 12-17-2008, 01:39 PM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
The complete module path includes the kernel version number like what the command 'uname -r' returns

The path to modprobe itself is configurable directly in the kernel:
'cat /proc/sys/kernel/modprobe' will tell you the current value. You can do:
'echo /path/to/my/mdoprobe > /proc/sys/kernel/modprobe'
to change that value.

modprobe is not the same as insmod -even if modprobe is a symlink to insmod. if the program is called as modprobe, then it does module resolution, first installing any modules needed by the one you are trying to load.

This is a really, really old thread you revived...
 
Old 12-17-2008, 11:27 PM   #8
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
yes...its old thread...i am newbie...so i want to know from which path the kernel will load all the modules while booting..?
 
Old 12-18-2008, 12:57 AM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
/lib/modules/current-kernel
That is, modutils is aware of the version of the running kernel and uses whichever path matches that. The last part of that path would always be what matches the output from the command 'uname -r'.
 
Old 12-18-2008, 04:34 AM   #10
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
The content of /lib/modules/2.6.26 is

sharief@sharief-desktop:~$ cd /lib/modules/
sharief@sharief-desktop:/lib/modules$ ls
2.6.26
sharief@sharief-desktop:/lib/modules$ cd 2.6.26/
sharief@sharief-desktop:/lib/modules/2.6.26$ ls
build modules.dep modules.ofmap modules.symbols
kernel modules.ieee1394map modules.order modules.usbmap
modules.alias modules.inputmap modules.pcimap source
modules.ccwmap modules.isapnpmap modules.seriomap
sharief@sharief-desktop:/lib/modules/2.6.26$


in this which will the correct file used to load the modules when kernel boots?
 
Old 12-18-2008, 06:00 AM   #11
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Those mapfiles are used to alias the location of the modules. They are not the mdoules themselves. modprobe uses configuration files under /etc when they are present /etc/modules.conf or under /etc/modules.d
What is it exactly that you want to know or change?
 
Old 12-18-2008, 06:54 AM   #12
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
i didnt have any file called /etc/modules.conf or module.d...

i have only this files under /etc:
modprobe.d
modules
modutils

in this which file you are telling?

Last edited by shariefbe; 12-18-2008 at 06:55 AM.
 
Old 12-18-2008, 11:02 AM   #13
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
It can be anyone of those. modprobe can use several different ways to find out how to load modules and the names of the files and location have change some over the years. You still don't say what you are trying to do. I can't really help you if I don't know what you want. Do you need to force loading of certain modules, or pass parameters to modprobe for certain modules?
If your system uses hotplug or udev, then those systems are responsable for loading most modules, so it gets even more complicated. What was your question again?
 
Old 12-19-2008, 12:05 AM   #14
shariefbe
Member
 
Registered: Aug 2008
Location: Tiruchirappalli, India
Distribution: UBUNTU 11.04
Posts: 368

Rep: Reputation: 31
Actually my question is from which path the kernel loads the "modules" when kernel boots?its from which path..you told that "/lib/modules/uname -r"...under that directory there is lots of files...i want specific file under that directory....and how it loads..thats my question....

The o/p of /etc/modules is:

sharief@sharief-desktop:~$ cd /etc
sharief@sharief-desktop:/etc$ cat modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

fuse
lp
sharief@sharief-desktop:/etc$


The o/p of /etc/modutils/ is

sharief@sharief-desktop:/etc$ cd modutils/
sharief@sharief-desktop:/etc/modutils$ ls
bluez nvidia-kernel-nkc
sharief@sharief-desktop:/etc/modutils$


The o/p of /etc/modprobe.d/ is

sharief@sharief-desktop:/etc$ cd modprobe.d/
sharief@sharief-desktop:/etc/modprobe.d$ ls
aliases blacklist-framebuffer bluez lrm-video
alsa-base blacklist-modem fuse nvidia-kernel-nkc
arch blacklist-oss ipw3945 options
arch-aliases blacklist-scanner isapnp thinkpad_acpi.modprobe
blacklist blacklist-watchdog libpisock9 toshiba_acpi.modprobe
sharief@sharief-desktop:/etc/modprobe.d$


which is correct one in the above file and directories...i am not sure..Thats why..Thanks

Last edited by shariefbe; 12-19-2008 at 12:12 AM.
 
Old 12-29-2008, 12:55 PM   #15
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
shariefbe: no need to dig up old threads when you've started your own. Please continue the discussion here:

http://www.linuxquestions.org/questi...-works-691267/
 
  


Closed Thread



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
Mounting works, playing music works, reading tags doesn't Celettu Linux - Newbie 7 08-23-2006 12:27 PM
sound works, sorta, must modprobe -r then reload. jdblick Linux - Newbie 1 09-21-2004 01:23 PM
Making modprobe pcspkr stick with modprobe.preload? gm4jjj Fedora 3 06-16-2004 03:27 AM
modprobe: modprobe: Couldn't locate module nvnet.o/nvaudio.o xiojqwnko Linux - Newbie 2 12-08-2003 05:41 PM
modprobe: modprobe can't locate module ppp0 in redhat 7.1 while shutting down. cyberdude3k Linux - Networking 1 09-08-2003 12:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:18 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration