depmod, modprobe—Handle loadable modules automatically
depmod module1.o module2.o …
modprobe module.o [symbol=value …]
modprobe –t tag pattern
modprobe –a –t tag pattern modprobe –l [ –t tag ] pattern
modprobe –r module
These utilities are intended to make a Linux modular kernel manageable for all users, administrators, and distribution maintainers.
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 dependent 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 lists 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 solves 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.
Option -d puts depmod in debug mode. It outputs all commands it is issuing.
Option -e outputs the list of unresolved symbol for each module, Normally, depmod only outputs the list of unloadable modules.
Option -v outputs 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.