[CLUE-Talk] Module loading

Jeffery Cann jccann at home.com
Sat Oct 7 21:14:41 MDT 2000


grant wrote:

> I have module loading turned on in the kernel options, but it still does
> not automatically load my soundcard module.  I can modprobe it, and it
> works fine.  How do I set this up?  I figure it has something to do with
> /etc/modules.conf, but I don't know specifics.  I also would like to know
> the general concept, so that I can do this for other modules in the
> future.

You can use the 'insmod' command in a boot-up script (like rc.local).

For example, suppose I have the bob module, compiled as bob.o in
/lib/modules/2.2.12/misc

So, in my rc.local file, I can add the command:

insmod /lib/modules/2.2.12/misc/bob.o

Suppose I want to remove this module from the kernel, I can use the 'rmmod'
command.

rmmod bob

Of course, if you always install a module when you boot up the system, then why
not add it to your kernel?

Alternatively, you can write these commands into a shell script.  The following
one backs up a single file into a floppy (Windoze format).  Since I rarely need
the windows file system support, I put the insmod and rmmod commands into the
script.  In this case, it makes sense to do it in the script because I use these
modules rarely (the same reason they are not compiled into my kernel).

----------------------
#! /bin/sh
#
# Backup to floppy
#
cd /lib/modules/*/fs
insmod fat.o
insmod vfat.o
mount -t vfat /dev/fd0 /mnt

cp $1 /mnt
echo "file $file backup succeeded"

umount /mnt
rmmod vfat
rmmod fat
----------------------

Later
Jeff

--
Protect On-Line Free Speech!
http://www.eff.org/support/joineff.html






More information about the clue-talk mailing list