Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1001018
  • 博文数量: 327
  • 博客积分: 9995
  • 博客等级: 中将
  • 技术积分: 4319
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-25 11:21
文章存档

2011年(31)

2010年(139)

2009年(157)

我的朋友

分类: LINUX

2009-11-30 20:28:24

depmod(depend module)
功能说明:分析可载入模块的相依性。
语  法:depmod [-adeisvV][-m <文件>][--help][模块名称]
补充说明:depmod可检测模块的相依性,供modprobe在安装模块时使用。
参  数:
 -a或--all  分析所有可用的模块。
 -d或debug  执行排错模式。
 -e  输出无法参照的符号。
 -i  不检查符号表的版本。
 -m<文件>或system-map<文件>  使用指定的符号表文件。
 -s或--system-log  在系统记录中记录错误。
 -v或--verbose  执行时显示详细的信息。
 -V或--version  显示版本信息。
 --help  显示帮助。
 
用strace depmod 1>log 2>&1读log文件,并没有发现它与System.map的关系.你可以在自己的机器上看看是不是这样.
 
NAME
       depmod — program to generate modules.dep and map files.(产生modules.dep文件和映射文件的程序。)
 
SYNOPSIS
       depmod  [-b  basedir]   [-e]  [-F System.map]  [-n]  [-v]  [ver-
       sion]  [-A     ]
 
       depmod [-e]  [-FSystem.map]  [-n]   [-v]   [version]   [filename
       ...]
 
DESCRIPTION
       Linux kernel modules can provide services (called "symbols") for
       other modules to use (using EXPORT_SYMBOL in the  code).   If  a
       second  module  uses  this  symbol,  that  second module clearly
       depends on the first module.  These dependencies can  get  quite
       complex.
       Linux内核模块能够(叫“symbols”)其他模块提供服务来使用(在代码中使用EXPORT_SYMBOL)。如果一个二级模块提供给服务使用,那么二级模块很明显的依赖一级模块。这些相互依赖关系能够取得完整的组合。
 
       depmod  creates  a  list of module dependencies, by reading each
       module under /lib/modules/version and determining  what  symbols
       it  exports, and what symbols it needs.  By default this list is
       written to modules.dep in the same directory.  If filenames  are
       given  on  the  command  line,  only  those modules are examined
       (which is rarely useful, unless all modules are listed).
       depmod命令创建一个模块的依附性列表,通过读取在/lib/modules/version下的每一个模块决定输出什么符号。并决定需要那些符号。默认的,这个列表在同一个路径下被写入modules.dep文件中。如果在命令行给出了模块文件的名字,只对那些写了名字的文件模块进行检查。(很有用的方式,要不然将列出所有的模块。)
 
       If a version is provided,  then  that  kernel  version’s  module
       directory  is  used,  rather than the current kernel version (as
       returned by "uname -r").
       如果提供一个版本给depmod,那么使用内核版本的模块路径,而不使用当前的运行版本。(可以通过“uname -r”输出版本。)
 
       depmod will also generate various map files in  this  directory,
       for use by the hotplug infrastructure.
       在这个地址下,depmod命令也产生出各种各样的映射文件。映射文件对热插拔是有用的。
     
OPTIONS
       -b basedir --basedir basedir
                 If  your  modules  are  not  currently in the (normal)
                 directory /lib/modules/version, but in a staging area,
                 you  can  specify  a basedir which is prepended to the
                 directory name.  This basedir  is  stripped  from  the
                 resulting modules.dep file, so it is ready to be moved
                 into the normal location.
                 如果你的模块没有在正常的/lib/modules/version里,而是运行在其他区域,你可以指定一个优先考虑的路径名称basedir,这个basedir不在modules.dep文件中,所以他准备移动到本地正常的地方。
 
       -e --errsyms
                 When combined with the -F  option,  this  reports  any
                 symbols which a module needs which are not supplied by
                 other modules or the kernel.   Normally,  any  symbols
                 not  provided by modules are assumed to be provided by
                 the kernel (which should be true in a perfect  world).
                 当结合-F参数使用的时候,这将报告模块需要的但是不被其他符号和内核支持的符号。正常情况下,不被其他模块提供的符号由内核提供给。
                 -e  :显示出目前已载入的不可执行的模组名称
 
       -F --filesyms System.map
                 Supplied  with the System.map produced when the kernel
                 was built, this allows the -e option to  report 
unresolved symbols.
                 当内核建立的时候提供给System.map文件,允许-e选项报告未加分析的符号。
 
       -n --dry-run
                 This sends the resulting modules.dep, then the various
                 map files, to standard  output,  rather  than  writing
                 them into the module directory.
                 这个参数将发送出modules.dep文件的结果,以及各种各样的映射文件的结果,发送到标准输出而不是发送到模块路径。
 
       -A --quick
                 This  option scans to see if any modules are newer the
                 modules.dep file before any work is done: if  not,  it
                 silently exits rather than regenerating the files.
                 这个选项扫描任何在modules.dep文件中还没有开始工作的新模块,如果没有新模块,保持文件现状,而不替换现有的modules.dep文件。
 
BACKWARDS COMPATIBILITY 向后兼容
       This  version  of depmod is for kernels 2.5.48 and above.  If it
       detects a kernel with support for old-style modules, or the ver-
       sion  specified  is  before  2.5.48, it will attempt to run dep-
       mod.old in its place, so it is  completely  transparent  to  the
       user.
       depmod命令支持的内核版本是2.5.48以及更老的版本,如果depmod检测出一个内核版本支持更老版本的模块或者是指定的版本在2.5.48之前的话,depmod将接受老版本,所以depmod对用户是完全透明的。
 
COPYRIGHT
       This manual page Copyright 2002, Rusty Russell, IBM Corporation.
 
SEE ALSO
       modprobe(8), modules.dep(5), depmod.old(8)
 
文件: Modultils工具源码分析之depmod篇.pdf
大小: 223KB
下载: 下载
阅读(1264) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~