Click to See Complete Forum and Search --> : rc.modules and Slack 8 question
Digital Froggy
07-12-2001, 08:49 PM
I compiled a new kernel and compiled somethings as modules. If I edit the rc.modules file to load these certain modules will it load the modules from the old kernel or the new kernel? I'm kinda confused on this one. Do I have to update the rc.modules script to look for modules from my new kernel? Thanks for your help!
The rc.modules script establishes which kernel version you are running and only looks for modules under that particular kernel. So yes, you will have to edit the script to match your current kernel config. Otherwise, you forget that you have the script loading 'emu10k1' when you removed it from the kernel config, you'll get 'module not found' errors on startup. Its a nuisance but not a real threat. Just remember which mods you want loaded at startup and edit the script accordingly.
I should mention that if you configure the kernel to use 'kmod' you will eliminate the majority of manual module loading at startup or elsewhere; kmod will dynamically load most modules when the kernel calls for them.
Digital Froggy
07-12-2001, 09:25 PM
Is that fairly easy do to? Can you give me a basic idea on how to do that? Thanks!
Edit: I also forgot to mention that when I compiled the kernel I edited the script to load some of the modules I compiled too. Example: I compiled the tulip driver as a module and edited the rc.modules script to load it. Needless to say it didn't work.
[ 12 July 2001: Message edited by: Digital Froggy ]
Well, sounds like you have the basic idea. Just open rc.modules up in your favorite editor (read: vim) and add/remove modules as you wish. Now, the way you call modules in the script is to use the command:
/sbin/modprobe modulename
So when the script runs, it calls /sbin/modprobe into play, and that loads the module. What I do is edit the file in such a way that the top portion of the script (the important part, where it decides what kernel version its running and then runs depmod) is intact and the bottom portion (the listing of modules) is either commented out or deleted. Then I just add my own modules at the bottom of the script like so:
/sbin/modprobe emu10k1
/sbin/modprobe 3c59x
...etc...
This is the way I used to do it for most things and nowadays I pretty much rely on kmod to load mods dynamically. You can do either, but the intention of modules is to keep the system load down and only load those drivers when they're needed, removing them when they arent being used. Just loading them all at startup is the antithesis of that idea; if all the mods are loaded up at startup anyway, you may as well build them into the kernel statically. YMMV.
Digital Froggy
07-12-2001, 10:09 PM
So let me get this straight: I don't have to change anything at the top of the rc.modules script like pointing it to the new kernel? All I have to do is go through the script and comment all the modules that were being loaded with the old kernel. Then at the end of the script add /sbin/modprobe modulename for each of the modules I created with the new kernel. Have I got the right idea? Thanks for being patient with my newbie butt! :D
Edit:
modprobe loads modules at startup
kmod loads and unloads modules as they are needed
How do I configure the kernel to use kmod?
[ 12 July 2001: Message edited by: Digital Froggy ]
MBMarduk
07-12-2001, 10:49 PM
Originally posted by Digital Froggy:
<STRONG>How do I configure the kernel to use kmod?
</STRONG>
Try reading the kernel documentation...can't remember exactly where but try 'find /usr/src/linux/ -name kmod.txt'
IIRC it'll prolly be in ./Documentation
I hope someone gives you a straight answer on this one...you wouldn't BELIEVE how much of a pain in the a55 it's been and still not know if KMOD is operating OK!
I've been at it with KMOD since December!
If I don't get it soon I'm gonna fscking DIE!
Digital Froggy
07-13-2001, 08:25 PM
^bump^
armando86
07-14-2001, 01:04 AM
<STRONG>So let me get this straight: I don't have to change anything at the top of the rc.modules script like pointing it to the new kernel? </STRONG>
Yup.
<STRONG>All I have to do is go through the script and comment all the modules that were being loaded with the old kernel.</STRONG>
Yeah, you could but I never do, nothing bad ever happened.
<STRONG>Then at the end of the script add /sbin/modprobe modulename for each of the modules I created with the new kernel.</STRONG>
Exactly :)
[qb]Edit:
modprobe loads modules at startup
kmod loads and unloads modules as they are needed
How do I configure the kernel to use kmod?[qb]
My understanding of kmod is that you don't do anything at all to configure it. For example as the kernel is booting up it automagically loads all the needed modules. But I don't use modules much so I could be wrong..
[ 14 July 2001: Message edited by: armando86 ]