如何配置modprobe来找到我的模块? [英] How do I configure modprobe to find my module?
问题描述
我正在尝试让内核模块在引导时加载.
I'm trying to get a kernel module to load at boot.
如果我运行insmod /path/to/module.ko
,它可以正常工作.但这每次我重新启动时都必须重复.
If I run insmod /path/to/module.ko
, it works fine. But this has to be repeated every time I reboot.
如果我运行modprobe /path/to/module.ko
,它将找不到该模块.
我知道modprobe使用配置文件,但是即使将/path/to/module.ko添加到/etc/modules后,也无法加载该文件.
If I run modprobe /path/to/module.ko
, it can't find the module.
I know modprobe uses a configuration file, but I can't get it to load the module even after adding /path/to/module.ko to /etc/modules.
什么是正确的配置?
推荐答案
您可以将模块链接到标准路径,因此depmod可以看到它,并且可以像其他模块一样加载它. /p>
You can make a symbolic link of your module to the standard path, so depmod will see it and you'll be able load it as any other module.
sudo ln -s /path/to/module.ko /lib/modules/`uname -r`
sudo depmod -a
sudo modprobe module
如果将模块名称添加到/etc/modules,则在您每次启动时都会加载该模块名称.
If you add the module name to /etc/modules it will be loaded any time you boot.
无论如何,我认为正确的配置是将模块复制到标准路径.
Anyway I think that the proper configuration is to copy the module to the standard paths.
这篇关于如何配置modprobe来找到我的模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!