ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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)
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...
/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'.
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?
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?
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?
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$
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.