DEPMOD(8) Linux Module Support DEPMOD(8) NNAAMMEE depmod - handle dependency descriptions for loadable ker- nel modules SSYYNNOOPPSSIISS ddeeppmmoodd -[aA] [-enqsvVr] [-C configfile] [-F kernelsyms] [-b basedirectory] [forced_version] ddeeppmmoodd [-enqsv] [-F kernelsyms] module1.o module2.o ... OOPPTTIIOONNSS _-_a Search for modules in all directories specified in the (optional) configuration file _/_e_t_c_/_m_o_d_- _u_l_e_s_._c_o_n_f. _-_A Compare file timestamps and, if necessary, act like ddeeppmmoodd -a. This option only updates the dependency file if anything has changed. _-_e Show all the unresolved symbol for each module. _-_n Write the dependency file on stdout instead of in the //lliibb//mmoodduulleess tree. _-_s Write all error messages via the syslog daemon instead of stderr. _-_v Show the name of each module as it is being pro- cessed. _-_q Tell depmod to keep quiet and not to complain about missing symbols. _-_V Show the release version name of ddeeppmmoodd _-_r Some users compile modules under a non-root userid then install the modules as root. This process can leave the modules owned by the non-root userid, even though the modules directory is owned by root. If the non-root userid is compromised, an intruder can overwrite existing modules owned by that userid and use this exposure to bootstrap up to root access. By default, modutils will reject attempts to use a module that is not owned by root. Specifying -r will suppress the error and allow root to load mod- ules that are not owned by root. UUssee ooff _-_r iiss aa mmaajjoorr sseeccuurriittyy eexxppoossuurree aanndd iiss nnoott rreeccoommmmeennddeedd.. The following options are useful for people managing dis- tributions; Linux October 12, 1999 1 DEPMOD(8) Linux Module Support DEPMOD(8) _-_b _b_a_s_e_d_i_r_e_c_t_o_r_y If the directory tree //lliibb//mmoodduulleess containing the sub-trees of modules is moved somewhere else in order to handle modules for a different environ- ment, the _b_a_s_e_d_i_r_e_c_t_o_r_y option tells depmod where to find the moved image of the //lliibb//mmoodduulleess tree. The file references in the depmod output file that is built, _m_o_d_u_l_e_s_._d_e_p_, will not contain the _b_a_s_e_d_i_- _r_e_c_t_o_r_y path. This means that when the file tree is moved back from bbaasseeddiirreeccttoorryy//lliibb//mmoodduulleess into //lliibb//mmoodduulleess in the final distribution, all refer- ences will be correct. _-_C _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 /etc/mod- ules.conf. The environment variable MMOODDUULLEECCOONNFF can also be used to select a different configuration file from the default /etc/modules.conf (or /etc/conf.modules (deprecated)). _-_F _k_e_r_n_e_l_s_y_m_s When building dependency files for a different ker- nel than the currently running kernel, it is impor- tant that ddeeppmmoodd uses the correct set of kernel symbols to resolve the kernel references in each module. These symbols can either be a copy of _S_y_s_- _t_e_m_._m_a_p from the other kernel, or a copy of the output from _/_p_r_o_c_/_k_s_y_m_s_. If your kernel uses ver- sioned symbols, you mmuusstt use a copy of the _/_p_r_o_c_/_k_s_y_m_s output, since that file contains the symbol versions of the kernel symbols. DDEESSCCRRIIPPTTIIOONN The ddeeppmmoodd and mmooddpprroobbee utilities are intended to make a Linux modular kernel manageable for all users, administra- tors and distribution maintainers. DDeeppmmoodd creates a "Makefile"-like dependency file, based on the symbols it finds in the set of modules mentioned on the command line or from the directories specified in the configuration file. This dependency file is later used by mmooddpprroobbee to automatically load the correct module or stack of modules. The normal use of ddeeppmmoodd is to include the line _/_s_b_i_n_/_d_e_p_- _m_o_d _-_a somewhere in the rc-files in /etc/rc.d, so that the correct module dependencies will be available immediately after booting the system. Note that the option _-_a now is optional. For boot-up pur- poses, the option _-_q might be more appropriate since that make depmod silent about unresolved symbols. It is also possible to create the dependency file Linux October 12, 1999 2 DEPMOD(8) Linux Module Support DEPMOD(8) immediately after compiling a new kernel. If you do "dep- mod -a 2.2.99" when you have compiled kernel 2.2.99 and its modules the first time, while still running e.g. 2.2.98, the file will be created in the correct place. In this case however, the dependencies on the kernel will not be guaranteed to be correct. See the options _-_F_, _-_C _a_n_d _-_b above for more information on handling this. CCOONNFFIIGGUURRAATTIIOONN The behavior of ddeeppmmoodd and mmooddpprroobbee can be adjusted by the (optional) configuration file //eettcc//mmoodduulleess..ccoonnff See _m_o_d_p_r_o_b_e_(_8_) and _m_o_d_u_l_e_s_._c_o_n_f_(_5_) for a complete description. SSTTRRAATTEEGGYY Each time you compile a new kernel, the command mmaakkee mmoodd-- uulleess__iinnssttaallll 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/modules.conf. FFIILLEESS /etc/modules.conf (alternatively but deprecated /etc/modules.conf) /lib/modules/*/modules.dep, /lib/modules/* SSEEEE AALLSSOO modules.conf(5), modprobe(8), modinfo(8), lsmod(8), ksyms(8), modules(2), AAUUTTHHOORR Jacques Gelinas (jack@solucorp.qc.ca) Bjorn Ekwall (bj0rn@blox.se) Linux October 12, 1999 3