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. python-高阶函数和闭包

    高阶函数:把函数作为参数传入,这样的函数成为高阶函数. 高阶函数,higher-order function Abs()内置函数:绝对值 函数名是什么:指向函数的变量 传入函数 一个函数的参数是否可以 ...

  2. vROPS中获取虚拟机在VC中的UUID

    vROPS中虚拟机对象的ID为resourceID,跟vCenter中虚拟机的UUID是不一致的,因此想要将vROPS中的虚拟机和vCenter中的虚拟机对应肯定不能靠虚拟机名称,而是一定要靠UUID ...

  3. vi在行首插入注释符号#

    1.ctrl+v 2.上下键选中要插入的位置 3.按下shift+i,接着输入#符号 4.按键ESC(稍等一下,就会自动插入了)

  4. linux下如何使用自己安装的SunJDK替换默认的OpenJDK

    在linux系统中,由于涉及到版权问题,在大部分linux系统的发行版本中,默认都安装了OpenJDK,并且OpenJDK的java命令也已经加入到环境变量中了. 在刚装好的linux系统中,运行ja ...

  5. 关于C#中的垃圾回收

    http://cnn237111.blog.51cto.com/2359144/1343004    GC.Collect如何影响垃圾回收 主要是 //GC.Collect(); //GC.WaitF ...

  6. 百度云如何免费扩容至2055G?

    百度云如何免费扩容至2055G? 上篇说到整一个新的百度账号,那么5G的百度云内存肯定满足不了我们收集癖的需求.那么就来了解一下怎么扩容吧. 主要是在手机端实现的 用这个新的百度账号在手机APP上登录 ...

  7. mac下搭建eclipse+git环境并导入项目

    首先官网下载eclipse,然后安装,选择eclipse for java developer. 安装git插件:eclipse-help-install new software-add name随 ...

  8. python调用虹软2.0(全网首发)-更新中

    python调用虹软2.0目前没有任何demo可以参考,自己研究了2个晚上终于把第一步做出来了,使用了opencv来加载和显示图片,龟速更新中 这一版作废,新版已发出:https://www.cnbl ...

  9. mysql 命令行导数据库

    cd  d: 然后应该会提示你已经进入D盘了,按照你数据库的地址,我的数据库是在D盘的wamp这个文件夹目录, 输入命令:cd ruanjian\mysql\bin     类似于这样,大家可以先在本 ...

  10. angular之自定义 directive

    1,指令的创建至少需要一个带有@Directive装饰器修饰的控制器类.@Directive装饰器指定了一个选择器名称,用于指出与此指令相关联的属性的名字. 2,创建一个highlight.direc ...