Rupert Heesom on Thu, 12 Apr 2001 14:40:12 -0400

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] HELP: Handling kernel modules

Hi all:

I've had some feedback from some of you re upgrading my RH7 system to
kernel 2.4.3, which is now done semi successfully.   The only thing I'm
struggling with, is getting most of the kernel modules to work!  I've
ended up recompiling most of the modules back into the kernel for stuff
to work.

When I upgraded RH from 6.2 to 7, everything seemed to work fine.   RH
usually uses a lot of modules in it's stock kernels.

When I compile a kernel to include modules, RH has a hard time finding /
loading the modules.
I think it has something to do with a lack of understanding how kmod,
depmod, modprobe, /etc/modules.conf work together.

I've found the HOWTO's and other docs I've found on kernel modules to be
somewhat lacking in it's detail, so that I still end up somewhat
confused about how my system should work.  The fact that all the docs
are based on older kernels (and that I know kerneld has been replaced by
kmod) makes me wonder how the modern kernels are supposed to work.

As I understand kernel modules, kmod is supposed to take requests for
modules from the kernel itself.  Kmod then uses modprobe (which in turn
uses insmod) to load the module itself.  

Now, depmod & modprobe are in the /sbin directory, but is kmod part of
the kernel itself?  
I can't find kmod on the system anywhere,except for "/etc/cron.d/kmod",
which has contents -

# rmmod -a is a two-hand sweep module cleaner
*/10 * * * *    root    /sbin/rmmod -as

I've noticed that if I run "/sbin/modprobe -c | less" it gives me a
listing of paths which are incorrect, including 2 listings of
"path[toplevel]" - 1st correct path - /lib/module/2.4.3, 2nd incorrect -

I put the correct toplevel path line into the /etc/modules.conf file,
ran depmod, and all the paths from the output of modprobe -c disappears
(probably because /etc/modules.conf is now superceding the defaults.).

My /etc/modules.conf file looks like this now -

alias scsi_hostadapter aic7xxx 
alias eth0 ne2k-pci 
alias parport_lowlevel parport_pc 
alias sound-slot-0 es1371 
alias usb-controller usb-uhci
alias block-major-58      lvm-mod
alias char-major-109      lvm-mod

The last 2 lines are what the LVM docs said to put into this file.   But
it seemed to say that I need EITHER the modules.conf files OR the
modprobe command.   Is that true?  I've got both setup.

Some of these h/w components I've compiled back into the kernel (like
eth0) - until eth0 was compiled into the kernel, Linux couldn't find it.

I've managed to get the LVM module to load with the current setup -

/etc/rc.d/init.d -

file:  depmod  contents:  /sbin/depmod -a

/etc/rc.d -
file:  lvm  contents:  /sbin/modprobe lvm-mod

The subsequent LVM commands in the /etc/rc.d/rc.sysinit file seem to
work OK (I haven't yet done anything with LVM).

Is this setup anywhere near correct?
I suspect that the depmod util only has been be run once (after each
module configuration change), but I'm not sure about that.

I'm mostly concerned that kmod is supposed to be handling the module
loading for me, but doesn't seem to do it, since I'm having to run
modprobe manually.

If I have to run modprobe manually, then does that mean I have to note
down which kernel components I'm modularizing, and then run modprobe for
each of them at startup???


Philadelphia Linux Users Group       -
General Discussion  -