modprobe 命令

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

1
命令介绍
编辑

简介

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文件是一个自动处理 内核模块的控制文件。


2相关信息编辑

参数

-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
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/203362.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月19日 下午9:58
下一篇 2026年3月19日 下午9:59


相关推荐

  • matlab将txt数据分类,MATLAB读取txt文件,txt里面有字符串和数值两种类型

    matlab将txt数据分类,MATLAB读取txt文件,txt里面有字符串和数值两种类型MATLAB读取txt文件,txt里面有字符串和数值两种类型mip版关注:96答案:4悬赏:30解决时间2021-01-2908:48已解决2021-01-2815:04MATLAB读取txt文件,txt里面有字符串和数值两种类型,将txt文件读入MATLAB里,并得到一个矩阵。txt文件里面的数据如下:5.1,3.5,1.4,0.2,Iris-setosa4.9,3.0,1.4…

    2025年9月1日
    5
  • java多线程并发编程_java线程实现的三种方式

    java多线程并发编程_java线程实现的三种方式Java并发编程:Java创建线程的三种方式

    2022年4月21日
    43
  • Linux下的双网卡绑定bond0 em1 em2

    一、什么是bonding Linuxbonding驱动提供了一个把多个网络接口设备捆绑为单个的网络接口设置来使用,用于网络负载均衡及网络冗余 二、bonding应用方向1、网络负载均衡 对于bonding的网络负载均衡是我们在文件服务器中常用到的,比如把三块网卡,当做一块来用,解决一个IP地址,流量过大,服务器网络压力过大的问题。对于文件服务器来说,比如NFS或SAMBA文件服

    2022年4月8日
    108
  • Tensor 和 NumPy 相互转换

    Tensor 和 NumPy 相互转换Tensor和NumPy相互转换我们很容易用numpy()和from_numpy()将Tensor和NumPy中的数组相互转换。但是需要注意的一点是:这两个函数所产生的Tensor和NumPy中的数组共享相同的内存(所以他们之间的转换很快),改变其中一个时另一个也会改变!1.Tensor转NumPya=torch.ones(6)b=a.numpy()print(a,b)a+=1print(a,b)b+=1print(a,b)tensor([1.,1.

    2022年10月19日
    5
  • 斯密特触发器

    斯密特触发器斯密特触发器又称斯密特与非门 是具有滞后特性的数字传输门 电路具有两个阈值电压 分别称为正向阈值电压和负向阈值电压 与双稳态触发器和单稳态触发器不同 施密特触发器属于 电平触发 型电路 不依赖于边沿陡峭的脉冲 nbsp 它是一种阈值开关电路 具有突变输入 输出特性的门电路 这种电路被设计成阻止输入电压出现微小变化 低于某一阈值 而引起的输出电压的改变 nbsp 当输入电压由低向高增加 到达 V 时 输出电

    2026年3月26日
    2
  • dlopen 介绍

    dlopen 介绍dlopen nbsp 介绍 includevoid dlopen constchar filename intflag char dlerror void void dlsym void handle constchar symbol intdlclose void handle 打开一个动态链接库 并返回动态链接库的句柄 flag

    2026年3月19日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号