modprobe
module.o [symbol=value ...]
modprobe
-t tag pattern
modprobe
-a -t tag pattern
modprobe
-l [ -t tag ] pattern
modprobe
-r module
modprobe
-c
Depmod creates a "Makefile"-like dependency file, based on the symbols it finds in the set of modules mentioned on the command line (or in a default place). This dependency file can later be used by modprobe to automatically load the relevant module(s).
Modprobe is used to load a set of modules, either a single module, a stack of dependant modules, or all modules that are marked with a specified tag.
Modprobe will automatically load all base modules needed in a module stack, as described by the dependency file modules.dep. If the loading of one of these modules fails, the whole current stack of modules will be unloaded (by rmmod) automatically.
Modprobe has two ways of loading modules. One way (the probe mode) will try to load a module out of a list (defined by pattern ). It stops loading as soon as one module load successfully. This can be used to autoload one ethernet driver out of a list for example. The other way, is to load all modules from a list. This can be used to load some modules at boot time.
With the option -r, modprobe will automatically unload a stack of modules, similar to the way rmmod -r does.
Option -l combined with option -t list all available modules of a certain type. An enhanced mount command could use the command
modprobe -l -t fs
to get the list of all file system drivers available and on request load the proper one. So, the mount command could become more generic as well... (The kerneld solve this without changing the mount utility)
Option -c will print all configuration (default + configuration file).
The normal use of
depmod
is to include the line "/sbin/depmod -a" in one of the rc-files
in /etc/rc.d, so that the correct module dependencies will be available
immediately after booting the system.
Note that it is also possible to create the dependency file immediately
after compiling a new kernel.
If you do "depmod -a 1.3.99" when you have compiled kernel 1.3.99 and
its modules the first time, while still running e.g. 1.3.98, the file will
be created in the correct place.
Note however that the dependencies on the kernel will not be guaranteed
to be correct in this case!
Option -d put depmod in debug mode. It outputs all command it is issuing.
Option -e output the list of unresolved symbol for each module, Normally depmod only output the list of unloadable modules.
Option -v output the list of all processed modules.
Modules may be located at different place in the filesystem, but there will always be some need to override this, especially for module developers. We expect some official standard will emerge, defined by the FSSTND. Until that time you might as well use this suggested directory structure.
The configuration file consists of a set of lines.
All empty lines, and all text on a line after a '#', will be ignored.
Lines may be continued by ending the line with a '\'.
The remaining lines should all conform to one of the following formats:
keep
parameter=value
options module symbol=value ...
alias module real_name
pre-install module command ...
install module command ...
post-install module command ...
pre-remove module command ...
remove module command ...
post-remove module command ...
All values in the "parameter" lines will be processed by a shell, which means that "shell tricks" like wild-cards and commands enclosed in back-quotes can be used:
path[misc]=/lib/modules/1.1.5?
path[net]=/lib/modules/`uname -r`
Parameters may be repeated multiple times.
These are the legal parameters:
If the configuration file '/etc/conf.modules' is missing, or if any parameter is not overridden, the following defaults are assumed:
depfile=/lib/modules/`uname -r`/modules.dep
path[boot]=/lib/modules
path[fs]=/lib/modules/`uname -r`
path[misc]=/lib/modules/`uname -r`
path[net]=/lib/modules/`uname -r`
path[scsi]=/lib/modules/`uname -r`
path[fs]=/lib/modules/default
path[misc]=/lib/modules/default
path[net]=/lib/modules/default
path[scsi]=/lib/modules/default
path[fs]=/lib/modules
path[misc]=/lib/modules
path[net]=/lib/modules
path[scsi]=/lib/modules
All "option" lines specify the default options that are needed for a module, as in:
modprobe de620 bnc=1
These options will be overridden by any options given on the
modprobe
command line.
It is possible to have an "option" line for aliased module names as well
as for the non-aliased name.
This is useful for e.g. the dummy module:
alias dummy0 dummy
options dummy0 -o dummy0
The "alias" lines can be used to give alias names to modules. A line in /etc/conf.modules that looks like this:
alias iso9660 isofs
makes it possible to write
modprobe iso9660
although there is no such module available.
Note that the line:
alias some_module off
will make modprobe ignore requests to load that module. This is usually used in conjunction with kerneld.
When you install a new linux, the modules should be moved to a directory related to the release (and version) of the kernel you are installing. Then you should do a symlink from this directory to the "default" directory.
Each time you compile a new kernel, the command make modules_install will create a new directory, but won't change the default.
When you get a module unrelated to the kernel distribution you should place it in one of the version-independent directories under /lib/modules.
This is the default strategy, which can be overridden in /etc/conf.modules.
/etc/conf.modules, (and /etc/modules.conf) /lib/modules/*/modules.dep, /lib/modules/*