modprobe是linux的一个命令,可载入指定的个别模块,或是载入一组相依的模块。modprobe会根据depmod所产生的相依关系,决定要载入哪些模块。若在载入过程中发生错误,在modprobe会卸载整组的模块。

简介

Linux命令:modprobe 。
功能说明:自动处理可载入模块。
语 法:modprobe [-acdlrtvV][--help][模块文件][符号名称 = 符号值]。
补充说明:modprobe可载入指定的个别模块,或是载入一组相依的模块。modprobe会根据depmod所产生的相依关系,决定要载入哪些模块。若在载入过程中发生错误,在modprobe会卸载整组的模块。

内容

1、modprobe 命令是根据depmod -a的输出/lib/modules/version/modules.dep来加载全部的所需要模块。
2、删除模块的命令是:modprobe -r filename。
3、系统启动后,正常工作的模块都在/proc/modules文件中列出。使用lsmod命令也可显示相同内容。
4、在内核中有一个“Automatic kernel module loading"功能被编译到了内核中。当用户尝试打开某类型的文件时,内核会根据需要尝试加载相应的模块。/etc/modules.conf或 /etc/modprobe.conf文件是一个自动处理内核模块的控制文件。
 

参数

-a或--all  载入全部的模块。
-c或--show-conf  显示所有模块的设置信息。
-d或--debug  使用排错模式。
-l或--list  显示可用的模块。
-r或--remove  模块闲置不用时,即自动卸载模块。
-t或--type  指定模块类型。
-v或--verbose  执行时显示详细的信息。
-V或--version  显示版本信息。
-help  显示帮助。

操作

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 程式所建立。
The modprobe and depmod utilities are intended to make a Linux modular kernel more manageable for all users, administrators and distribution maintainers. Modprobe uses a "Makefile"-like dependency file, created by depmod, to automatically load the relevant module(s) from the set of modules available in predefined directory trees. Modprobe is used to load a single module, a stack of dependent modules, or all modules that are marked with a specified tag. Modprobewill 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. Modprobe has two ways of loading modules. One way (the probe mode) will try to load a module out of a list (defined by pattern). Modprobe 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 modprobe can be used is to load all modules from a list. With the option -r, modprobe will automatically unload a stack of modules, similar to the way rmmod -r does. Note that using just modprobe -r will clean up unused autoloaded modules and also perform the pre-and post-remove commands in the configuration file /etc/modules, /etc/modprobe.d/*. Combining the options -l and -t lists all available modules of a certain type. Option -c will print the currently used configuration (default + configuration file). To do autoclean every 2 minutes:
'''/2 ''' * ''' ''' test -f /proc/modules && /sbin/modprobe -r

modprobe lsmod的更多相关文章

  1. Linux内核配置选项

    http://blog.csdn.net/wdsfup/article/details/52302142 http://www.manew.com/blog-166674-12962.html Gen ...

  2. 深入linux kernel内核配置选项

    ============================================================================== 深入linux kernel内核配置选项 ...

  3. Linux 启动流程及相关知识

    基础知识 linux系统的组成 内核(kerner) 根文件系统(rootfs) 内核提供操作系统的功能,根文件系统包含常用的一些工具,这些工具.这些工具的运行离不开glibc库文件. 程序:二进制程 ...

  4. modprobe和lsmod命令配合使用

    modprobe命令用于智能地向内核中加载模块或者从内核中移除模块. modprobe可载入指定的个别模块,或是载入一组相依的模块.modprobe会根据depmod所产生的相依关系,决定要载入哪些模 ...

  5. linux内核模块相关命令:lsmod,depmod,modprobe,modinfo,insmod,rmmod 使用说明

    加载内核驱动的通常流程: 1.先将.ko文件拷贝到/lib/module/`uname -r`(内核版本号)/kernel/driver/...目录下, 根据具体用途的区别分为net.ide.scsi ...

  6. (转)内核模块操作命令-lsmod+rmmod+modinfo+modprobe

    原文:http://watchmen.xin/2018/07/13/IT%E7%A7%91%E5%AD%A6%E6%8A%80%E6%9C%AF%E7%9F%A5%E8%AF%86%E4%BD%93% ...

  7. linux lsmod命令 及相关信息

    lsmod  (list modules) 语法:lsmod 功能: lsmod命令:是一个小程序,用来显示文件.proc/modules的信息,也就是显示当前内核模块装载的模块. 补充说明: 执行l ...

  8. linux modprobe命令参数及用法详解--linux加载模块命令

    转:http://www.linuxso.com/command/modprobe.html modprobe(module probe) 功能说明:自动处理可载入模块. 语 法:modprobe [ ...

  9. 内核与内核模块:depmod,lsmod,modinfo,insmod,rmmod,mdprobe

                  内核模块:/lib/modules/version/kernel或/lib/modules/$(uname -r)/kernel; [root@localhost kern ...

随机推荐

  1. eclipse web项目的发布路径

    java Build path是编译路径设置,主要用来设置源代码的编译路径默认是default output folder Web Deployment Assembly是eclipse中的发布路径设 ...

  2. Java-性能调优-理解GC日志

    [ ~]# cat gc.log.0 | grep 'Full GC' 1.652: [Full GC (System) 1.652: [CMS: 0K->21718K(262144K), 0. ...

  3. ubuntu下wget的配置文件在哪里

    答:/etc/wgetrc 这个文件里可以指定代理,如: http_proxy = http://myproxy.com:8080

  4. linux 忘记登陆密码

    声明:如果不是远程登陆,机器在自己身边还有救. 第一步:重启机器,进入brug界面(grub是一个引导管理程序,可以引导linux.winxp等系统,在/boot/grub/中的menu.lst中进行 ...

  5. PAT1072. Gas Station (30)

    题目的测试用例数据有问题! 第一个Case 应该是 G1 2.0 3.2 一直在想3.3分母的3怎么来了.ORZ #include <iostream> #include <ccty ...

  6. Excel转化成DataTable实现:NPOI和OLEDb

    使用两种方式实现的excel数据转化成DataSet,再结合前一篇的DataTable转化为实体,就可以解决excel到实体之间的转化. 代码如下: 首先定义一个接口: public interfac ...

  7. GridControl 史上最全的资料(一)

    GridControl详解(一)原汁原味的表格展示 Dev控件中的表格控件GridControl控件非常强大.不过,一些细枝末节的地方有时候用起来不好找挺讨厌的.使用过程中,多半借助Demo和英文帮助 ...

  8. poj 2229 Sumsets 完全背包求方案总数

    Sumsets Description Farmer John commanded his cows to search for different sets of numbers that sum ...

  9. zoom:1;

    zoom:1;属性是IE浏览器的专有属性,可以设置或检索对象的缩放比例.触发ie的hasLayout属性.清除浮动.清除magin的重叠等. 注意:它未通过W3C验证.

  10. Fedora安装opengl

    Fedora和Ubuntu下安装OpenGL开发环境配置(我整理的)OpenGL开发库的详细介绍fedora23 安装OpenGL 开发OpenGL工程需要3个库文件和对应的头文件:libglut.s ...