MODPROBESection: Linux Module Support (8)
Updated: February 4, 2002
Return to Main Contents
NAMEmodprobe - high level handling of loadable modules
SYNOPSISmodprobe [-adnqv] [-C config] module [symbol=value ...]
modprobe [-adnqv] [-C config] [-t type] pattern
modprobe -l [-C config] [-t type] pattern
modprobe -c [-C config]
modprobe -r [-dnv] [-C config] [module ...]
DESCRIPTIONThe modprobe and depmod utilities are intended to make a Linux modular kernel more manageable for all users, administrators and distribution maintainers.
Modprobe uses a "Makefile"-like dependency file, created by depmod, to automatically load the relevant module(s) from the set of modules available in predefined directory trees.
Modprobe is used to load 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 loaded in the current session will be unloaded 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).
Modprobe stops loading as soon as one module loads successfully.
This could be used to autoload one Ethernet driver out of a list.
With the option -r, modprobe will automatically unload a stack of modules, similar to the way "rmmod -r" does. Note that using just "modprobe -r" will clean up unused autoloaded modules and also perform the pre- and post-remove commands in the configuration file /etc/modules.conf.
The combining the options -l and -t lists all available modules of a certain type.
CONFIGURATIONThe behavior of modprobe (and depmod) can be modified by the (optional) configuration file /etc/modules.conf.
For a more detailed description of what this file can contain, as well as the default configuration used by depmod and modprobe, see modules.conf(5).
Note that the pre- and post-remove commands will not be executed
if a module is "autocleaned" by kerneld!
Look for the up-coming support for persistent module storage instead.
STRATEGYThe idea is that modprobe will look first in the directory containing modules compiled for the current release of the kernel. If the module is not found there, modprobe will look in the directory common to the kernel version (e.g. 2.0, 2.2). If the module is still found, modprobe will look in the directory containing modules for a default release, and so on.
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" link.
When you get a module unrelated to the kernel distribution you should place it in one of the version-independent directories under /lib/modules.
/etc/modules.conf (alternatively but deprecated /etc/conf.modules) /lib/modules/*/modules.dep, /lib/modules/*
SEE ALSOdepmod(8), lsmod(8), kerneld(8), ksyms(8), rmmod(8).
SAFE MODEIf the effective uid is not equal to the real uid then modprobe treats its input with extreme suspicion. The last parameter is always treated as a module name, even if it starts with '-'. There can only be one module name and options of the form "variable=value" are forbidden. The module name is always treated as a string, no meta expansion is performed in safe mode. However meta expansion is still applied to data read from the config file.
euid may not be equal to uid when modprobe is invoked from the kernel, this is true for kernels >= 2.4.0-test11. In an ideal world, modprobe could trust the kernel to only pass valid parameters to modprobe. However at least one local root exploit has occurred because high level kernel code passed unverified parameters direct from the user to modprobe. So modprobe no longer trusts kernel input.
modprobe automatically sets safe mode when the environment consists only of these strings
HOME=/ TERM=linux PATH=/sbin:/usr/sbin:/bin:/usr/binThis detects modprobe execution from the kernel on kernels 2.2 though 2.4.0-test11, even if uid == euid, which it does on the earlier kernels.
LOGGING COMMANDSIf directory /var/log/ksymoops exists and modprobe is run with an option that could load or a delete a module then modprobe will log its command and return status in /var/log/ksymoops/`date +%Y%m%d.log`. There is no switch to disable this automatic logging, if you do not want it to occur, do not create /var/log/ksymoops. If that directory exists, it should be owned by root and be mode 644 or 600 and you should run script insmod_ksymoops_clean every day or so.
REQUIRED UTILITIESdepmod(8), insmod(8).
NOTESPatterns supplied to modprobe will often need to be escaped to ensure that it is evaluated in the proper context.
BUGSmodprobe [ -V | --version ] should exit immediately. Instead, it prints the version information and behaves as if no options were given.
AUTHORJacques Gelinas (email@example.com)
Bjorn Ekwall (firstname.lastname@example.org)
This document was created by man2html, using the manual pages.
Time: 22:31:06 GMT, March 03, 2024