“致命:模块未找到错误";使用modprobe [英] "FATAL: Module not found error" using modprobe

查看:577
本文介绍了“致命:模块未找到错误";使用modprobe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用modprobe命令时遇到问题...我编译了hello world模块并用insmod加载了它,它工作正常,当我执行lsmod时,可以在输出列表中看到它.但是,当我使用modprobe插入此模块时,出现致命错误:

I have a problem with modprobe command... I compiled the hello world module and loaded it with insmod, it works fine and when I do lsmod, I can see it in the output list. But when I insert this module using modprobe I am getting a FATAL error:

root@okapi:/home/ravi# modprobe ./hello.ko 
FATAL: Module ./hello.ko not found.
root@okapi:/home/ravi#

这是模块代码:

#include <linux/init.h>
#include <linux/module.h>

MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
        printk(KERN_ALERT "Hello, world\n");
        return 0;
}
static void hello_exit(void)
{
        printk(KERN_ALERT "Goodbye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);

和Makefile

obj-m += hello.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

推荐答案

原因是modprobe/lib/modules/$(uname -r)中查找了模块,因此不适用于本地文件路径.这是modprobeinsmod之间的区别之一.

The reason is that modprobe looks into /lib/modules/$(uname -r) for the modules and therefore won't work with local file path. That's one of differences between modprobe and insmod.

这篇关于“致命:模块未找到错误";使用modprobe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆