MAN page from RedHat Other modutils-2.1.85-1.i386.rpm
DEPMOD
Section: Linux Module Support (1)
Updated: March 17, 1996
Index NAME
depmod, modprobe - handle loadable modules automatically
SYNOPSIS
depmod[ -a ]
depmod[ -a version ]
depmodmodule1.o module2.o ...
modprobemodule.o [symbol=value ...]
modprobe-t tag pattern
modprobe-a -t tag pattern
modprobe-l [ -t tag ] pattern
modprobe-r module
modprobe-c
DESCRIPTION
These utilities are intendedto make a Linux modular kernel manageable for all users,administrators and distribution maintainers.
Depmodcreates a "Makefile"-like dependency file, based on the symbols it findsin the set of modules mentioned on the command line (or in a default place).This dependency file can later be used bymodprobeto automatically load the relevant module(s).
Modprobeis 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.
Modprobewill 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 stackof modules will be unloaded (by rmmod) automatically.
Modprobehas two ways of loading modules. One way (the probe mode) willtry to load a module out of a list (defined bypattern).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 wayrmmod -rdoes.
Option -l combined with option -t list all available modulesof a certain type.An enhancedmountcommand could use the command
modprobe -l -t fs
to get the list of all file system drivers available and onrequest 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 ofdepmodis to include the line "/sbin/depmod -a" in one of the rc-filesin /etc/rc.d, so that the correct module dependencies will be availableimmediately after booting the system.
Note that it is also possible to create the dependency file immediatelyafter compiling a new kernel.If you do "depmod -a 1.3.99" when you have compiled kernel 1.3.99 andits modules the first time, while still running e.g. 1.3.98, the file willbe created in the correct place.
Note however that the dependencies on the kernel will not be guaranteedto be correct in this case!
Option-dput depmod in debug mode. It outputs all command it is issuing.
Option-eoutput the list of unresolved symbol for each module, Normally depmodonly output the list of unloadable modules.
Option-voutput 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.
CONFIGURATION
The behaviour of
depmodand
modprobecan be adjusted by the (optional) configuration file
/etc/conf.modulesThe 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-cardsand 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:
- keep
- If this word is found on a linebeforeany lines that contain thepathdescriptions, the default set of paths will be saved, and thus added to.Otherwise the normal behaviour is that the default set will bereplacedby the set of paths in the configuration file.
- depfile=DEPFILE_PATH
- This is the path to the dependency file that will be created bydepmodand used bymodprobe.
- path=SOME_PATH
- Thepathparameter specifies a directory to search for the modules.
- path[tag]=SOME_PATH
- The path parameter can carry an optional tag.This tells us a little more about the purpose of the modules inthis directory and allows some automated operations bymodprobe.The tag is appended to the "path" keyword enclose in square brackets.If the tag is missing, the tag "misc" is assumed.
One very useful tag isboot,which can be used to mark all modules that should be loaded at boot-time.
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[cdrom]=/lib/modules/`uname -r`
path[ipv4]=/lib/modules/`uname -r`
path[ipv6]=/lib/modules/`uname -r`
path[sound]=/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[cdrom]=/lib/modules/default
path[ipv4]=/lib/modules/default
path[ipv6]=/lib/modules/default
path[sound]=/lib/modules/default
path[fs]=/lib/modules
path[misc]=/lib/modules
path[net]=/lib/modules
path[scsi]=/lib/modules
path[cdrom]=/lib/modules
path[ipv4]=/lib/modules
path[ipv6]=/lib/modules
path[sound]=/lib/modules
All "option" lines specify the default options that are needed fora module, as in:
modprobe de620 bnc=1
These options will be overridden by any options given on themodprobecommand line.
It is possible to have an "option" line for aliased module names as wellas 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 writemodprobe iso9660although 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 withkerneld.
- Commands
- The configuration lines
pre-install module command ...
install module command ...
post-install module command ...
pre-remove module command ...
remove module command ...
post-remove module command ...
can be used when one wants some specific commands to be executed whena module is inserted or removed.All text after the module name will be interpreted as the command text.
Note that the pre- and post-remove commands will not be executedif a module is "autocleaned" by kerneld!Look for the up-coming support for persistent module storage instead.
STRATEGY
The idea is that
modprobewill look first at the directory containingmodules compiled for the current release of the kernel.If the module is not found there,
modprobewill look in the directory containing modules for a default release.
When you install a new linux, the modules should be moved to a directoryrelated 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 commandmake modules_installwill create a new directory, but won't change the default.
When you get a module unrelated to the kernel distributionyou should place it in one of the version-independent directoriesunder /lib/modules.
This is the default strategy, which can be overridden in /etc/conf.modules.
EXAMPLES
- modprobe -t net
- Load one of the modules that are stored in the directory tagged "net".Each module are tried until one succeed (default: /lib/modules/net).
- modprobe -a -t boot
- All modules that are stored in the directory tagged "boot" willbe loaded (default: /lib/modules/boot).
- modprobe slip.o
- This will attempt to load the module slhc.o if it was not previously loaded,since the slip module needs the functionality in the slhc module.This dependency will be described in the file "modules.dep" that wascreated automatically bydepmod
- modprobe -r slip.o
- will unload slip.o. It will also unload slhc.o automatically,unless it is used by some other module as well (like e.g. ppp.o).
FILES
/etc/conf.modules, (and /etc/modules.conf)/lib/modules/*/modules.dep,/lib/modules/*
SEE ALSO
lsmod(1),
kerneld(8),
ksyms(1),
modules(2),
REQUIERED UTILITIES
insmod(1),
nm(1)
rmmod(1),
NOTES
The pattern supplied to modprobe will often be escaped to ensurethat it is evaluated in the proper context
AUTHOR
Jacques Gelinas (jackAATTsolucorp.qc.ca)
Bjorn Ekwall (bj0rnAATTblox.se)
BUGS
Naah...
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- CONFIGURATION
- STRATEGY
- EXAMPLES
- FILES
- SEE ALSO
- REQUIERED UTILITIES
- NOTES
- AUTHOR
- BUGS
This document was created byman2html,using the manual pages.