modprobe XXX not found 解决与Depmod命令

 -把模块文件放到 /lib/module/`uname -r`/kernel/ 目录下;
 -运行 depmod
 -再 modprobe  就好了

 

Depmod
来自 ChinaUnix Wiki
Linux命令:depmod

功能说明:分析可载入模块的相依性。 语  法:depmod [-adeisvV][-m <文件>][--help][模块名称] 补充说明:depmod可检测模块的相依性,供modprobe在安装模块时使用。 参  数: -a或--all  分析所有可用的模块。 -d或debug  执行排错模式。 -e  输出无法参照的符号。 -i  不检查符号表的版本。 -m<文件>或system-map<文件>  使用指定的符号表文件。 -s或--system-log  在系统记录中记录错误。 -v或--verbose  执行时显示详细的信息。 -V或--version  显示版本信息。 --help  显示帮助。
英文版本,欢迎翻译:

NAME depmod - handle dependency descriptions for loadable kernel modules

SYNOPSIS depmod -[aA] [-einqsvVr] [-C configfile] [-F kernelsyms] [-b basedirectory] [forced_version] depmod [-einqsv] [-F kernelsyms] module1.o module2.o ...

OPTIONS -a Search for modules in all directories specified in the (optional) configuration file /etc/mod? ules.conf.

-A Compare file timestamps and, if necessary, act like depmod -a. This option only updates the dependency file if anything has changed.

-e Show all the unresolved symbol for each module.

-i Ignore symbol versions when building dependency list. This is useful especially if you use a ver? sioned kernel and want to build dependencies against a System.map file (see the -F option). Use this with care, because if the symbol versions dont match, modprobe or insmod wont be able to load the modules eventhough depmod succeeds.

-n Write the dependency file on stdout instead of in the /lib/modules tree.

-s Write all error messages via the syslog daemon instead of stderr.

-v Show the name of each module as it is being processed.

-q Tell depmod to keep quiet and not to complain about missing symbols.

-V Show the release version name of depmod

-r Some users compile modules under a non-root userid then install the modules as root. This pro? cess 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 modules that are not owned by root.

Use of -r is a major security exposure and is not recommended.

The following options are useful for people managing distributions;

-b basedirectory If the directory tree /lib/modules containing the sub-trees of modules is moved somewhere else in order to handle modules for a different environment, the basedirectory option tells depmod where to find the moved image of the /lib/modules tree. The file references in the depmod output file that is built, modules.dep, will not contain the basedirectory path. This means that when the file tree is moved back from basedirectory/lib/modules into /lib/modules in the final distribu? tion, all references will be correct.

-C configfile Use the file configfile instead of /etc/modules.conf. The environment variable MODULECONF can also be used to select a different configuration file from the default /etc/modules.conf (or /etc/conf.modules (deprecated)).

-F kernelsyms When building dependency files for a different kernel than the currently running kernel, it is important that depmod uses the correct set of kernel symbols to resolve the kernel references in each module. These symbols can either be a copy of System.map from the other kernel, or a copy of the output from /proc/ksyms. If your kernel uses versioned symbols, you must use a copy of the /proc/ksyms output, since that file contains the symbol versions of the kernel symbols, unless you use the -i option. For compatibility, -m kernelsyms is identical to -F kernelsyms

DESCRIPTION The depmod and modprobe 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 from the directories specified in the configuration file. This depen? dency file is later used by modprobe to automatically load the correct module or stack of modules.

The normal use of depmod is to include the line /sbin/depmod -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 purposes, the option -q might be more appropriate since that make depmod silent about unresolved symbols.

It is also possible to create the dependency file immediately after compiling a new kernel. If you do "depmod -a 2.2.99" when you have compiled kernel 2.2.99 and its modules the first time, while still run? ning 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 and -b above for more information on handling this.

CONFIGURATION The behavior of depmod and modprobe can be adjusted by the (optional) configuration file /etc/mod? ules.conf See modprobe(8) and modules.conf(5) for a complete description.

STRATEGY Each time you compile a new kernel, the command make modules_install will create a new directory, but wont 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.

FILES /etc/modules.conf (alternatively but deprecated /etc/modules.conf) /lib/modules/*/modules.dep, /lib/modules/*

SEE ALSO modules.conf(5), modprobe(8), modinfo(8), lsmod(8), ksyms(8), modules(2),

AUTHOR Jacques Gelinas ([email protected]) Bjorn Ekwall ([email protected])

Linux October 12, 1999 1

你可能感兴趣的:(OS->,Linux_内核开发)