命令行参数是什么 depmod是什么命令行参数是什么?

Linux depmod命令详解
Linux depmod命令怎么用
作者:用户
本文讲的是Linux depmod命令详解
Linux depmod命令怎么用,
depmod(depend module)可检测模块的相依性,供modprobe在安装模块时使用。
depmod [-adeisvV][-m &文件&][--help][模块名称]
参数说明:
depmod(depend module)可检测模块的相依性,供modprobe在安装模块时使用。
depmod [-adeisvV][-m &文件&][--help][模块名称]
参数说明:
分析所有可用的模块。
执行排错模式。
输出无法参照的符号。
不检查符号表的版本。
-m&文件&或system-map&文件&
使用指定的符号表文件。
-s或--system-log
在系统记录中记录错误。
-v或--verbose
执行时显示详细的信息。
-V或--version
显示版本信息。
显示帮助。
显示可用模块
# depmod -a //显示可用模块
以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索文件
depmod 详解、depmod命令作用、depmod 命令、linux top命令详解、linux ps 命令详解,以便于您获取更多的相关知识。
稳定可靠、可弹性伸缩的在线数据库服务,全球最受欢迎的开源数据库之一
6款热门基础云产品6个月免费体验;2款产品1年体验;1款产品2年体验
弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率
开发者常用软件,超百款实用软件一站式提供
云栖社区()为您免费提供相关信息,包括
,所有相关内容均不代表云栖社区的意见!内核模块相关命令:lsmod,depmod,modprob
功能:列出内核已载入模块的状态
用法:lsmod
lsmod 以美观的方式列出/proc/modules的内容。
Module(模块名) Size(模块大小) Used by(被...使用)
eg. ne2k_pci 8928 0
在/proc/modules中相应的是:
(模块名,模块大小,被...使用,模块地址(猜的,以后确认))
ne2k_pci 8928 0 - Live 0x3086400
ne2k_pci , Live 0xe086000
功能:分析可加载模块的依赖性,生成modules.dep文件和映射文件。
用法:depmod [-b basedir] [-e] [-F System.map] [-n] [-v] [version] [-A]
depmod [-e] [-F System.map] [-n] [-v] [version] [filename...]
Linux内核模块可以为其它模块提供提供服务(在代码中使用EXPORT_SYMBOL),这种服务被称作&symbols&。若第二个模块使用了这个symbol,则该模块很明显依赖于第一个模块。这些依赖关系是非常繁杂的。
depmod读取在/lib/modules/version 目录下的所有模块,并检查每个模块导出的symbol和需要的symbol,然后创建一个依赖关系列表。默认地,该列表写入到/lib/moudules/version目录下的modules.dep文件中。若命令中的filename有指定的话,则仅检查这些指定的模块(不是很有用)。
若命令中提供了version参数,则会使用version所指定的目录生成依赖,而不是当前内核的版本(uname -r 返回的)。
-b basedir --basedir basedir 若你的模块并没有正确的在/lib/mdules/version下,可以指定目录生成依赖。
-e --errsyms 和-F选项一起使用,当一个模块需要的symbol在其它模块里面没有提供时,做出报告。正常情况下,模块没有提供的symbol都在内核中有提供。
-F --filesyms System.map 提供一个System.map文件(在内核编译时生成的)许-e选项报告出unresolved symbol。
-n --dry_run 将结果modules.dep和各种映射文件输出到标准输出(stdout),而不是写到模块目录下。
-A --quick 检查是否有模块比modues.dep中的模块新,若没有,则退出不重新生成文件。
功能:Linux内核添加删除模块
modprobe [ -v ] [ -V ] [-C config-file] [ -n ] [ -i ] [ -q ] [ -o modulename] [ modulename ] [ module parameters ... ]
modprobe [ -r ] [ -v ] [ -n ] [ -i ] [ modulename ... ]
modprobe [ -l ] [ -t dirname ] [ wildcard ]
modprobe [ -c ]
modprobe可智能地添加和删除Linux内核模块(为简便起见,模块名中'_'和'-'是一样的)。modprobe会查看模块目录/lib/modules/'uname -r'里面的所有模块和文件,除了可选的/etc/modprobe.conf配置文件和/etc/modprobe.d目录外。
modprobe需要一个最新的modules.dep文件,可以用depmod来生成。该文件列出了每一个模块需要的其他模块,modprobe使用这个去自动添加或删除模块的依赖。
-v --verbose 显示程序在干什么,通常在出问题的情况下,modprobe才显示信息。
-C --config 重载(^_^,意思取C++的重载)默认配置文件(/etc/modprobe.conf或/etc/modprobe.d)。
-c --showconfig 输出配置文件并退出
-n --dry-run 可以和-v选项一起使用,调试非常有用
-i --ignore-install --ignore-remove 该选项会使得modprobe忽略配置文件中的,在命令行上输入的install和remove命令。
-q --quiet 一般modprobe删除或插入一个模块时,若没有找到会提示错误。使用该选项,会忽略指定的模块,并不提示任何错误信息。
-r --remove 该选项会导致modprobe去删除,而不是插入一个模块。通常没有没有理由去删除内核模块,除非是一些有bug的模块。你的内核也不一定支持模块的卸载。
-V --verssion 版本信息
-f --force 和同时使用--force-vermagic ,--force-modversion一样。使用该选项是比较危险的。
-l --list 列出所有模块
-a --all 插入所有命令行中的模块
-t --type 强制 -l 显示dirname中的模块
-s --syslog 错误信息写入syslog
功能:显示内核模块的信息
modinfo [ -0 ] [ -F field] [modulename | filename ... ]
modinfo -V
modinfo -h
modinfo列出Linux内核中命令行指定的模块的信息。若模块名不是一个文件名,则会在/lib/modules/version 目录中搜索,就像modprobe一样。
modinfo默认情况下,为了便于阅读,以下面的格式列出模块的每个属性:fieldname : value。
-V --version 版本
-F --field 仅在一行上显示field值,这对于脚本较为有用。常用的field有:author, description, licence, param, depends, alias, filename。
-0 --NULL 使用'\0'字符分隔field值,而不是一个新行。对脚本比较有用。
-a -d -l -p -n 这些分别是author, description, license, param ,filename的简短形式。
功能:向Linux内核中插入一个模块
用法:insmod [filename] [modue options ...]
insmod是一个向内核插入模块的小程序:若文件名是一个连字符'-',模块从标准输入输入。大多数用户使用modprobe,因为它比较智能化。
功能:删除内核中的一模块
用法:rmmod [ -f ] [ -w ] [ -s ] [ -v ] [ modulename ]
rmmod是一个可以从内核中删除模块的小程序,大多数用户使用modprobe -r去删除模块。
-v --verbose 显示程序正在做些什么,一般只显示执行时的错误信息。
-f --force 该选项是非常危险:除非编译内核时,CONFIG_MODULE_FORCE_UNLOAD被设置该命令才有效果,否则没效果。用该选项可以删除正在被使用的模块,设计为不能删除的模块,或者标记为unsafe的模块。
-w --wait 通常,rmmod拒绝删除正在被使用的模块。使用该选项后,指定的模块会被孤立起来,直到不被使用。
-s --syslog 将错误信息写入syslog,而不是标准错误(stderr)。
-V --version 版本信息
以上内容是参考man翻译的,若有疑问请用man ...查看原始文档,翻译可能有误
标签(Tag):
------分隔线----------------------------
------分隔线----------------------------
本文介绍云平台域环境下,如何配置和修改组策略,实现使用域用户远程登录安全访问和使...
什么是商业智能?商业智能是对商业信息的搜集、管理和分析过程,目的是使企业的各级决...
大数据时代的到来已经势不可挡。在海量的数据面前,已经有越来越多的人意识到大数带来...
大数据时代,虽然多数企业数据的应用并不能称得上是大数据,但也证实了数据应用的重要...
近几年云计算市场相当红火,可能有很多人会以为云计算是一项全新的技术,但事实上它的雏...
人和动物根本的区别之一就是,人类把讯息传递这事弄的越来越高级了。 信息论之父克劳...博客访问: 48159
博文数量: 53
注册时间:
鏆傛棤浠嬬粛
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Linux
[ZT]在Linux下访问Windows来源:百度搜索Linux 内核支持读写Fat、NTFS、Vfat、Fat32、Hfs 等文件系统(至少可以读),因此在 Linux 下访问 Windows 要比在 Windows 下访问 Linux 方面的多,不需要使用专门的软件,直接使用 Linux 命令即可。[@more@]来源:百度搜索Linux 内核支持读写Fat、NTFS、Vfat、Fat32、Hfs 等文件系统(至少可以读),因此在 Linux 下访问 Windows 要比在 Windows 下访问 Linux 方面的多,不需要使用专门的软件,直接使用 Linux 命令即可。Fat/Fat32分区时 Linux 访问 Windows 分区  Linux 将系统中所有的设备都看作文件,所以在 Linux 下访问 Windows 分区非常方便,只要使用 mount 命令将 Windows 分区挂接成 Linux 的一个文件夹即可。  mount 命令的使用格式是(必须以 root 用户身份登陆):  mount [-afFhnrvVm] [-|&标签&] [-o&选项&] [-t&文件系统&] [设备名称] [挂接点]  若我们要将 Windows 的某一分区(如D盘)挂接到 Linux 的 /mnt/win 这个目录下,首先请在 /mnt下建立 win 文件夹,然后启动 Console 终端模式,输入命令“mount /dev/hda5 /mnt/win”,再进入 /mnt/win 目录,您就能看到 Windows 中 D 盘的内容了。  可能有的朋友要问了,为何要输入上面的命令,特别是那个 /dev/hda5 是什么东西呢?这是 Linux 下分区的一种表示方式,在 Linux 下看 Windows 分区一般是:hda1 为C盘,hda5为D盘,hda6为E盘,以此类推。。。  不过用上面的方法加载 Windows 分区后,另一个麻烦的事情出现了,就是 Windows 中所有的中文文件名和文件夹名全部显示为问号,英文却能正常显示,这计算机也有民族歧视啊!反对这种歧视,就要充分利用我们手中的武器,在 mount 命令中加入一些参数让它正确显示中文。这时,只要将上述命令改为“mount -t vfat -o iocharset=cp936 /dev/hda5 /mnt/win”,运行就可以了。  加载了这个分区,在不使用时我们还可以将它卸除,而卸除的命令为 umoun,若是卸除上述分区,只要输入“umount /mnt/win”即可。  另外,我们还可以让 Linux 在启动时自动加载分区,这样就不用每次使用 Windows 分区时都要输入命令加载了。  首先请以 root 用户登陆,进入图形界面后通过 Linux 的文件管理器找到 /etc 目录下的 fstab 文件,单击右键选择一个文字编辑软件打开此文件,在内容的最下方添加一行命令“/dev/hda5 /mnt/win vfat codepage=936,iocharset=cp936 1 1”,然后在 /mnt 目录下建立 win 文件夹,重新启动计算机后,再访问 /mnt/win 目录就是 Windows 分区的内容了。您也可以通过此种方法加载多个分区,而编辑时也可以在命令行方式下使用 vi 等编辑器。NTFS 分区时 Linux 访问 Windows 分区  若是使用 Mandrake 或者红旗 Linux,并且在安装时硬盘中已经存在 NTFS 分区,则安装后不需要重新编译内核就可以实现对硬盘 NTFS 分区的访问;若是安装时硬盘中没有 NTFS 分区,或者使用的是 RedHat Linux,则必须重新编译内核,添加 NTFS 模块才能正常访问 NTFS 分区。  首先以 root 用户登陆,然后将 RedHat Linux 的第二张安装盘插入光驱中,在 /redhat/RPMS 目录下找到 kernel-source-2.4.xx-x.i386.rpm(这里x代表数字)文件,若是图形界面,直接双击安装,若是命令行,请输入“rpm -ivh kernel-source-2.4.xx-x.i386.rpm”命令。  再进入 /usr/src/linux-2.4.xx-x/configs 目录,这里有许多编译内核需要的培植文件,一般选择“kernel-source-2.4.xx-x.i686.config”即可。将此文件复制到 /usr/src/linux2.4.xx-x 目录,用文本编辑器打开,将“#CONFIG_NTFS_FS is not set”行改为“CONFIG_NTFS_FS=m”。  在终端模式下,进入 /usr/src/linux-2.4.xx-3 目录,运行“make modules”命令来编译想要的 NTFS 模块,在编译的过程中不需要理会与 NTFS 模块,在编译的过程中不需要理会与 NTFS 无关的内容,编译完成后,在 /usr/src/linux-2.4.xx-x/fs/ntf 目录下可以找到一个 ntfs.o 文件,将其复制到 /lib/modules/2.4.xx-x/kernel/fs 目录,然后回到 /usr/src/linux-2.4.xx-3 目录,输入命令:  #depmod  #modprobe ntfs  剩下的工作和前面 Fat/Fat32分区时 Linux 访问 Windows 分区相同。 ********************************************************************************************先判断你这块硬盘是hda,还是 hdb,还是hdc,还是hdd(启动时可看到,也可用dmesg查看到) 这里假设是hdb cd /mnt mkdir win mount -t vfat /dev/hdb1 /mnt/win (hdb1是你第二块硬盘的第一个分区) 这样你的 c盘就可以在/mnt/win下访问了 访问完以后用/umount /mnt/win来卸载,卸载前要退出/mnt/win的目录
阅读(364) | 评论(0) | 转发(0) |
上一篇:没有了
相关热门文章
给主人留下些什么吧!~~
请登录后评论。加载内核驱动的通常流程:
1.先将.ko文件拷贝到/lib/module/`uname -r`(内核版本号)/kernel/driver/...目录下,
&&& 根据具体用途的区别分为net、ide、scsi、usb、video、parport、md、block、ata等等。
2.运行depmod -a,更新模块依赖新,主要是更新modules.dep文件
3.运行modprobe加载内核模块
功能:列出内核已载入模块的状态
用法:lsmod
lsmod 以美观的方式列出/proc/modules的内容。
Module(模块名)&&&&Size(模块大小)& &Used by(被&使用)
eg.&ne2k_pci&&&&&&&&&& 8928&&&&&&&&&&&&&& 0
8390&&&&&&&&&&&&&&&& 9472&&&&&&&&&&&&& 1 ne2k_pci
在/proc/modules中相应的是:
(模块名,模块大小,被&使用,模块地址(猜的,以后确认))
ne2k_pci 8928 0 & Live 0&3086400
ne2k_pci , Live 0xe086000
功能:分析可加载模块的依赖性,生成modules.dep文件和映射文件。
用法:depmod [-b basedir] [-e] [-F System.map] [-n] [-v] [version] [-A]
depmod [-e] [-F System.map] [-n] [-v] [version] [filename...]
Linux内核模块可以为其它模块提供提供服务(在代码中使用EXPORT_SYMBOL),这种服务被称作&symbols&。若第二个模块使用了这个symbol,则该模块很明显依赖于第一个模块。这些依赖关系是非常繁杂的。
depmod读取在/lib/modules/version 目录下的所有模块,并检查每个模块导出的symbol和需要的symbol,然后创建一个依赖关系列表。默认地,该列表写入到/lib/moudules /version目录下的modules.dep文件中。若命令中的filename有指定的话,则仅检查这些指定的模块(不是很有用)。
若命令中提供了version参数,则会使用version所指定的目录生成依赖,而不是当前内核的版本(uname -r 返回的)。
-b basedir& &basedir basedir& 若你的模块并没有正确的在/lib/mdules/version下,可以指定目录生成依赖。
-e& &errsyms& 和-F选项一起使用,当一个模块需要的symbol在其它模块里面没有提供时,做出报告。正常情况下,模块没有提供的symbol都在内核中有提供。
-F& &filesyms System.map 提供一个System.map文件(在内核编译时生成的)许-e选项报告出unresolved symbol。
-n& &dry_run& 将结果modules.dep和各种映射文件输出到标准输出(stdout),而不是写到模块目录下。
-A &quick& 检查是否有模块比modues.dep中的模块新,若没有,则退出不重新生成文件。
功能:Linux内核添加删除模块
modprobe [ -v ] [ -V ]&[-C config-file] [ -n ]&[ -i ] [ -q ] [ -o modulename] [ modulename ] [ module parameters ... ]
modprobe [ -r ] [ -v ] [ -n ] [ -i ] [ modulename ... ]
modprobe [ -l ] [ -t dirname ] [ wildcard ]
modprobe [ -c ]
modprobe可智能地添加和删除Linux内核模块(为简便起见,模块名中&_'和&-'是一样的)。modprobe会查看模块 目录/lib/modules/&uname -r&里面的所有模块和文件,除了可选的/etc/modprobe.conf配置文件和/etc/modprobe.d目录外。
modprobe需要一个最新的modules.dep文件,可以用depmod来生成。该文件列出了每一个模块需要的其他模块,modprobe使用这个去自动添加或删除模块的依赖。
-v &verbose& 显示程序在干什么,通常在出问题的情况下,modprobe才显示信息。
-C&&config&&重载(^_^,意思取C++的重载)默认配置文件(/etc/modprobe.conf或/etc/modprobe.d)。
-c&&showconfig& 输出配置文件并退出
-n &dry-run& 可以和-v选项一起使用,调试非常有用
-i &ignore-install &ignore-remove 该选项会使得modprobe忽略配置文件中的,在命令行上输入的install和remove命令。
-q &quiet 一般modprobe删除或插入一个模块时,若没有找到会提示错误。使用该选项,会忽略指定的模块,并不提示任何错误信息。
-r &remove& 该选项会导致modprobe去删除,而不是插入一个模块。通常没有没有理由去删除内核模块,除非是一些有bug的模块。你的内核也不一定支持模块的卸载。
-V &verssion 版本信息
-f &force& 和同时使用&force-vermagic ,&force-modversion一样。使用该选项是比较危险的。
-l &list 列出所有模块
-a &all 插入所有命令行中的模块
-t &type 强制 -l 显示dirname中的模块
-s &syslog 错误信息写入syslog
功能:显示内核模块的信息
modinfo [ -0 ] [ -F field] [modulename | filename ... ]
modinfo -V
modinfo -h
modinfo列出Linux内核中命令行指定的模块的信息。若模块名不是一个文件名,则会在/lib/modules/version 目录中搜索,就像modprobe一样。
modinfo默认情况下,为了便于阅读,以下面的格式列出模块的每个属性:fieldname : value。
-V &version 版本
-F &field 仅在一行上显示field值,这对于脚本较为有用。常用的field有:author, description, licence, param, depends, alias, filename。
-0 &NULL 使用&/0&字符分隔field值,而不是一个新行。对脚本比较有用。
-a -d -l -p -n 这些分别是author, description, license, param ,filename的简短形式。
功能:向Linux内核中插入一个模块
用法:insmod [filename] [modue options ...]
insmod是一个向内核插入模块的小程序:若文件名是一个连字符&-',模块从标准输入输入。大多数用户使用modprobe,因为它比较智能化。
功能:删除内核中的一模块
用法:rmmod [ -f ] [ -w ] [ -s ] [ -v ] [ modulename ]
rmmod是一个可以从内核中删除模块的小程序,大多数用户使用modprobe -r去删除模块。
-v &verbose& 显示程序正在做些什么,一般只显示执行时的错误信息。
-f&&force& 该选项是非常危险:除非编译内核时,CONFIG_MODULE_FORCE_UNLOAD被设置该命令才有效果,否则没效果。用该选项可以删除正在被使用的模块,设计为不能删除的模块,或者标记为unsafe的模块。
-w &wait 通常,rmmod拒绝删除正在被使用的模块。使用该选项后,指定的模块会被孤立起来,直到不被使用。
-s& &syslog& 将错误信息写入syslog,而不是标准错误(stderr)。
-V& &version 版本信息
以上内容是参考man翻译的,若有疑问请用man &查看原始文档,翻译可能有误。
(1)lsmod 显示当前加载的所有模块,相当于cat /proc/modules,
&&& 假设你没有设定开机加载某个模块,比如ntfs,那么开机后执行lsmod,列表里不会有ntfs这个模块的,
&&& 这时你再执行 mount -t ntfs xxx后,执行lsmod后列表里就会有ntfs这个模块了。&&& 还要注意的是lsmod显示的是模块名,而不是别名(alias)。
(2) modprobe与insmod
&&& modprobe -l&&&&&&&&&&& #显示当前可以加载的模块
&&& modprobe xxx.ko&&&&&&& #加载某个模块&&& modprobe -r xxx.ko&&&& #卸载某个模块
&&& 通过了解modprobe的manpage我们知道,我可以通过modprobe -l来显示可以当前可以加载的模块,所谓当前可以加载的模块,
&&& 实际上就是modules.dep文件中包含的那些模块,而不是manpage里说的modprobe会加载/lib/modules/`uname -r`下的所有模块(也许是我理解错误),下面我们将会证明这一点.
&&& insmod 与 modprobe 都是载入 kernel module,不过一般差别于 modprobe 能够处理 module 载入的相依问题。
比方你要载入 a module,但是 a module 要求系统先载入 b module 时,直接用 insmod 挂入通常都会出现错误讯息,不过 modprobe 倒是能够知道先载入 b module&&后才载入 a module,如此相依性就会满足。不过 modprobe 并不是大神,不会厉害到知道 module 之间的相依性为何,该程式是读取 /lib/modules/2.6.xx/modules.dep 档案得知相依性的。而该档案是透过 depmod 程式所建立。
(3)上面(1)中提到modprobe加载某个模块是根据/lib/modules/`uname -r`目录下的modules.dep文件中的模块列表,这个文件中有的模块modprobe会正确加载,否则就会出错。我们还拿ntfs这个模块来举例:vi /lib/modules/`uname -r`/modules.dep注释掉/lib/modules/2.6.18-4-k7/kernel/fs/ntfs/ntfs.ko这一行,就是加个#号.这个修改是即使生效的。modinfo ntfsmodinfo: could not find module ntfsmodprobe ntfsFATAL: Module ntfs not found.重启机器,执行同样的命令会得到同样的结果,说明开机不会自动执行depmod的,而locate ntfs.ko/lib/modules/2.6.18-4-k7/kernel/fs/ntfs/ntfs.ko证明我们并没有转移ntfs模块。注意如果重启机器之前进行mount还是可以的,重启之后就会报错了,而上边的都是即时生效的。还有如果modules.dep里注释掉了ntfs,那么在/etc/modules里写上也是不起作用的,说明这个和mount一样都是依赖
modprobe来完成加载模块命令的。而insmod是可以的,因为insmod后面跟的是绝对路径,它和modules.dep没什么关系。
insmod比较重要的用途是用来测试模块的正确性,加载一般都是依靠modprobe。(这个可能也不起作用了,都用modprobe吧)这一切只是因为我们注释掉了modules.dep中关于ntfs.ko的那一行,而模块并没有删除或转移。既然modules.dep文件如此重要,那么它是怎么生成的呢?这就和下一个命令有关了,depmod。
(4)depmod
man depmoddepmod
-- program to generate modules.dep and map files. Blank lines, and
lines starting with a '#' (ignoring spaces) are ignored in modules.dep.depmod是一个用来产生modules.dep和map文件的程序。在modules.dep文件中空白行和以'#'开头的行将被忽略.Linux kernel modules can provide services (called "symbols") for& othermodules& to& use (using EXPORT_SYMBOL in the code).&&linux核心模块可以提供服务给其他模块,称之为"symbols"depmod& creates& a& list of module dependencies, by reading each moduleunder /lib/modules/version and determining what symbols it exports, andwhat& symbols it needs.&depmod通过读取/lib/modules/version目录下的每一个模块来创建一个记录模块相依性的列表。这个列表就是/lib/modules/version目录下的modules.dep。If a version is provided, then that kernel version's& module& directoryis& used, rather than the current kernel version (as returned by "uname-r").如果给定version的话,那么depmod会检查这个version对应的modules目录而不是当前运行的kernel对应的modules目录。depmod will also generate various map files in this directory, for& useby the hotplug infrastructure.depmod也会在/lib/modules/version目录下创建许多map文件,这些文件将会被hotplug用到。OPTIONS:-a --all& Probe& all& modules.& This option is enabled by default if no&&&&&&&&&&& file names are given in the command-line.检查所有的模块,这个命令是默认的如果你没有指定模块名字的话。-A --quick& This option scans to see if any modules are& newer& than& the&&&&&&&&&&&&&&&& modules.dep file before any work is done%3
阅读(...) 评论()&-把模块文件放到 /lib/module/`uname -r`/kernel/ 目录下;&-运行 depmod&-再 modprobe& 就好了
Depmod来自 ChinaUnix WikiLinux命令: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 ma
-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 () Bjorn Ekwall ()
Linux October 12, 1999 1
本文已收录于以下专栏:
相关文章推荐
因为研究生阶段选的是trustzone的研究方向,所以最近在一直看这方面的东西。前不久在github上找到这个optee的开源项目,于是fork来学习一下。
玩TrustZone这几年。终于看到一款算是比较完善的安全OS。看它支持的平台就知道开发投入的工作量不小。
支持FastModels和QEMU两个虚拟模拟器,其他5款开发板。今天先看看QEMU运行起来...
和linux中加载模块有关的几个程序分别如下:lsmod,modprobe,depmodlsmod显示当前加载的所有模块,相当于cat /proc/modules,假设你没有设定开机加载某个模块,比如...
smod、insmod、rmmod是一组实用工具所提供的三个命令,这组实用工具一般是和内核版本对应的,其1.3.57版本名为modules(modules-1.3.57.tar.gz),高一点的版本名...
如果新装的系统,运行一些很正常的诸如:shutdown,fdisk的命令时,悍然提示:bash:command notfound。那么
首先就要考虑root 的$PATH里是否已经包含...
当你在系统中执行modprobe iptable_nat,系统报错FATAL: Module iptable_nat not found时,说明你的内核中没有编译这个模块,你需要重新编译内核。这里介绍...
若加载的模块是hello.ko,应该先
depmod hello.ko
modprobe hello
就行了,不知道为什么书上都只说modprobe,却不说需要先depmod...
I want to install the kernel modules to lib/modules/ . Actually there ha...
modprobe XXX not found 解决:把模块文件放到 /lib/module/`uname -r`/kernel/ 目录下运行 depmod再 modprobe
【转帖请注明出处:blog.csdn.net/lanmanck】这个问题困扰了我2天,一开始以为是/lib/modules问题,后来研究了半天也没搞定(现在想来也是配置问题,具体不知道怎么搞~~~)其...
他的最新文章
讲师:董岩
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)}

我要回帖

更多关于 命令行参数是什么 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信