MODPROBE(8) Linux Module Support MODPROBE(8) NNAAMMEE modprobe - high level handling of loadable modules SSYYNNOOPPSSIISS mmooddpprroobbee [ -adnqv ] [ -C config ] module [ symbol=value ... ] mmooddpprroobbee [ -adnqv ] [ -C config ] [ -t type ] pattern mmooddpprroobbee -l [ -C config ] [ -t type ] pattern mmooddpprroobbee -c [ -C config ] mmooddpprroobbee -r [ -dnv ] [ -C config ] [ module ...] mmooddpprroobbee -V OOPPTTIIOONNSS _-_a_, _-_-_a_l_l Load aallll matching modules instead of stopping after the first successful loading. _-_c_, _-_-_s_h_o_w_c_o_n_f_i_g Show the currently used configuration. _-_d_, _-_-_d_e_b_u_g Show information about the internal representation of the stack of modules. _-_k_, _-_-_a_u_t_o_c_l_e_a_n Set 'autoclean' on loaded modules. Used by the kernel when it calls on mmooddpprroobbee to satisfy a missing feature (supplied as a module). The _-_q option is implied by _-_k_. These options will automatically be sent to insmod. _-_l_, _-_-_l_i_s_t List matching modules. _-_n_, _-_-_s_h_o_w Don't actually perform the action, just show what would be done. _-_q_, _-_-_q_u_i_e_t Do not complain about insmod failing to install a module. Continue as normal, but silently, with other possibilities for modprobe to test. This option will automatically be sent to insmod. _-_r_, _-_-_r_e_m_o_v_e Remove module (stacks) or do autoclean, depending on whether there are any modules mentioned on the command line. _-_s_, _-_-_s_y_s_l_o_g Report via syslog instead of stderr. This options will automatically be sent to insmod. Linux March 15, 1999 1 MODPROBE(8) Linux Module Support MODPROBE(8) _-_t_, _-_-_t_y_p_e _m_o_d_u_l_e_t_y_p_e Only consider modules of this type. modprobe will only look at modules whose directory path includes exactly "/_m_o_d_u_l_e_t_y_p_e/". _m_o_d_u_l_e_t_y_p_e can include more than one directory name, e.g. _-_t _d_r_i_v_e_r_s_/_n_e_t would list modules in xxx/drivers/net/ and its subdirectories. _-_v_, _-_-_v_e_r_b_o_s_e Print all commands as they are executed. _-_V_, _-_-_v_e_r_s_i_o_n Show the release version of modprobe. _-_C_, _-_-_c_o_n_f_i_g _c_o_n_f_i_g_f_i_l_e Use the file _c_o_n_f_i_g_f_i_l_e instead of (the optional) //eettcc//mmoodduulleess..ccoonnff to specify the configuration. The environment variable MMOODDUULLEECCOONNFF can also be used to select (and override) a different configuration file from the default /etc/modules.conf (or /etc/conf.modules (deprecated)). DDEESSCCRRIIPPTTIIOONN The mmooddpprroobbee and ddeeppmmoodd utilities are intended to make a Linux modular kernel more manageable for all users, administrators and distribution maintainers. MMooddpprroobbee uses a "Makefile"-like dependency file, created by ddeeppmmoodd,, to automatically load the relevant module(s) from the set of modules available in predefined directory trees. MMooddpprroobbee 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. MMooddpprroobbee 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. MMooddpprroobbee has two ways of loading modules. One way (the probe mode) will try to load a module out of a list (defined by _p_a_t_t_e_r_n ). MMooddpprroobbee stops loading as soon as one module loads successfully. This could be used to autoload one Ethernet driver out of a list. The other way mmooddpprroobbee can be used is to load aallll modules from a list. See EEXXAAMMPPLLEESS below. With the option --rr,, modprobe will automatically unload a stack of modules, similar to the way rrmmmmoodd --rr does. Note that using just mmooddpprroobbee --rr will clean up unused Linux March 15, 1999 2 MODPROBE(8) Linux Module Support MODPROBE(8) autoloaded modules and also perform the pre- and post- remove commands in the configuration file /etc/modules.conf. With the option _-_l combined with the option _-_t a list all available modules of a certain type will be shown. Option _-_c will print the currently used configuration (default + configuration file). CCOONNFFIIGGUURRAATTIIOONN The behavior of mmooddpprroobbee (and ddeeppmmoodd ) can be modified by the (optional) configuration file //eettcc//mmoodduulleess..ccoonnff For a more detailed description of what this file can contain, as well as the default configuration used by ddeeppmmoodd and mmooddpprroobbee,, see _m_o_d_u_l_e_s_._c_o_n_f_(_5_)_. Note that the pre- and post-remove commands will nnoott be executed if a module is "autocleaned" by kerneld! Look for the up-coming support for persistent module storage instead. If you want to use the pre- and post-install features, you will have to turn off autoclean for kerneld and instead put something like the following line in your crontab (this is used for kmod systems as well) to do autoclean every 2 minutes: */2 * * * * test -f /proc/modules && /sbin/modprobe -r SSTTRRAATTEEGGYY The idea is that mmooddpprroobbee will look first in the directory containing modules compiled for the current release of the kernel. If the module is not found there, mmooddpprroobbee will look in the directory common to the kernel version (e.g. 2.0, 2.2). If the module is still found, mmooddpprroobbee 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 mmaakkee mmoodduulleess__iinnssttaallll will create a new directory, but won't change the 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/modules.conf. Linux March 15, 1999 3 MODPROBE(8) Linux Module Support MODPROBE(8) EEXXAAMMPPLLEESS modprobe -t net Load one of the modules that are stored in the directory tagged "net". Each module are tried until one succeeds. modprobe -a -t boot All modules that are stored in directories tagged bboooott will be loaded. modprobe slip 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 was created automatically by ddeeppmmoodd modprobe -r slip will unload the slip module. It will also unload the slhc module automatically, unless it is used by some other module as well (like e.g. ppp). FFIILLEESS /etc/modules.conf, (alternatively but deprecated: /etc/conf.modules) /lib/modules/*/modules.dep, /lib/modules/* SSEEEE AALLSSOO depmod(8), lsmod(8), kerneld(8), ksyms(8), rmmod(8), modules(2) SSAAFFEE MMOODDEE If 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. Linux March 15, 1999 4 MODPROBE(8) Linux Module Support MODPROBE(8) mmooddpprroobbee automatically sets safe mode when the environment consists only of these strings HOME=/ TERM=linux PATH=/sbin:/usr/sbin:/bin:/usr/bin This 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. RREEQQUUIIRREEDD UUTTIILLIITTIIEESS depmod(8), insmod(8) NNOOTTEESS Patterns supplied to modprobe will often need to be escaped to ensure that it is evaluated in the proper context. AAUUTTHHOORR Jacques Gelinas (jack@solucorp.qc.ca) Bjorn Ekwall (bj0rn@blox.se) Linux March 15, 1999 5