Re: Load kernel module automatically

Keith Owens (kaos@ocs.com.au)
Thu, 06 Jun 2002 10:00:45 +1000


On Wed, 5 Jun 2002 15:47:16 -0400 (EDT),
Michael Zhu <mylinuxk@yahoo.ca> wrote:
>Hi, I've read the man page of modules.conf. But I
>still couldn't figure out how to solve my problem. I
>mean how to change the modules.conf file. Can I edit
>this file directly? Can anyone give me an example?

/etc/modules.conf does NOT automatically load modules. It contains
information that is applied to a module during the load process but
something else has to trigger the initial module load. NB, not
conf.modules, that is an alternative name that is obsolete.

The initial load can be manual (user types 'modprobe foo') or
automatic. For the automatic case, a module can be requested by kernel
code (CONFIG_KMOD eventually runs 'modprobe foo' from the kernel) or
some startup script can issue modprobe. Startup scripts vary from one
distribution to another, look in /etc/rc.sysinit, /etc/rc.local and
/etc/rc.d/ for references to modules to find out how your distribution
does automatic loading at startup.

Redhat does most of the work in /etc/rc.sysinit, other distributions
may vary. That code explicitly loads sound drivers if they are listed
in /etc/modules.conf, then if /etc/rc.modules exists, it tries to
execute that script. So define /etc/rc.modules, mark it executable and
put your modprobe commands in that file.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/