Yocto 树外模块安装问题(版本不兼容)
我有外部模块(设备驱动程序),我尝试在我的系统中使用它。不幸的是,系统在日志中说我的模块无法在启动过程中添加:
[FAILED] Failed to start Load Kernel Modules.
好吧,我尝试手动插入此模块:
root@reynolds:~# modprobe foo
modprobe: FATAL: Module foo not found in directory /lib/modules/5.15.10-dd1e40c-dirty-60e4bf
现在问题很明显:内核版本与模块版本不同:
root@reynolds:~# uname -a
Linux reynolds 5.15.10-dd1e40c-dirty-60e4b0f #1 Mon Feb 7 15:30:00 UTC 2022 armv5tejl armv5tejl armv5tejl GNU/Linux
然后我输入: root@reynolds~# ls /lib/modules/
并按 Tab 键。我得到:
root@reynolds~# ls /lib/modules/5.15.10-dd1e40c-dirty-a787ea8/
所以,根本原因是版本不兼容: 5.15.10-dd1e40c-dirty-60e4b0f != 5.15.10-dd1e40c-dirty-a787ea8
当然,根据在 Yocto 手册中,“继承模块”出现在配方中:
SUMMARY = "Foo kernel driver"
DESCRIPTION = "Foo kernel driver"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
inherit module
SRC_URI = " \
file://Makefile \
file://foo.c \
file://LICENSE \
"
S = "${WORKDIR}"
RPROVIDES:${PN} += "kernel-module-foo"
Makefile 对于树外也是“经典的”模块:
obj-m := foo.o
SRC := $(shell pwd)
all:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) #"modules" can be added there, no changes
modules_install:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
clean:
rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
rm -f Module.markers Module.symvers modules.order
rm -rf .tmp_versions Modules.symvers
任何事情都是相当正确的,但是......
我该如何解决它? 我尝试解决这个问题的方法:
1:将 DEPENDS 添加到模块配方中: DEPENDS += “linux-aspeed”
不成功
2:
bitbake -ccleansstate linux-aspeed foo
bitbake -ccompile foo (to push foo module to compile immediately after linux-aspeed kernel)
bitbake obmc-phosphor-image
不成功
3:直接在 local.conf 中添加依赖:
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-module-foo"
不成功。
同样的问题仍然存在:linux-aspeed 版本与映像中的模块版本不同。
您还建议检查什么来解决这个问题?
I have external module (device driver) which I try to use in my system. Unfortunately, system says in log that my module cannot be added during boot process:
[FAILED] Failed to start Load Kernel Modules.
Well, I tried to insert this module manually:
root@reynolds:~# modprobe foo
modprobe: FATAL: Module foo not found in directory /lib/modules/5.15.10-dd1e40c-dirty-60e4bf
Now the problem is obvious: the kernel version is different from the module version:
root@reynolds:~# uname -a
Linux reynolds 5.15.10-dd1e40c-dirty-60e4b0f #1 Mon Feb 7 15:30:00 UTC 2022 armv5tejl armv5tejl armv5tejl GNU/Linux
Then I typed:root@reynolds~# ls /lib/modules/
and press Tab. I got:
root@reynolds~# ls /lib/modules/5.15.10-dd1e40c-dirty-a787ea8/
So, root cause is versions incompatibility: 5.15.10-dd1e40c-dirty-60e4b0f != 5.15.10-dd1e40c-dirty-a787ea8
Of course, in accordance with Yocto manual, “inherit module” presents in the recipe:
SUMMARY = "Foo kernel driver"
DESCRIPTION = "Foo kernel driver"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
inherit module
SRC_URI = " \
file://Makefile \
file://foo.c \
file://LICENSE \
"
S = "${WORKDIR}"
RPROVIDES:${PN} += "kernel-module-foo"
Makefile is also “classical” for out-of-tree module:
obj-m := foo.o
SRC := $(shell pwd)
all:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) #"modules" can be added there, no changes
modules_install:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
clean:
rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
rm -f Module.markers Module.symvers modules.order
rm -rf .tmp_versions Modules.symvers
Anything is rather correct, but...
How can I fix it?
What I did trying to fix that:
1: Added DEPENDS into module recipe:
DEPENDS += “linux-aspeed”
Unsuccessfully
2:
bitbake -ccleansstate linux-aspeed foo
bitbake -ccompile foo (to push foo module to compile immediately after linux-aspeed kernel)
bitbake obmc-phosphor-image
Unsuccessfully
3: Added dependency directly in local.conf:
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " kernel-module-foo"
Unsuccesfully.
The same problem remains: linux-aspeed version is different from module version in an image.
What else would you recommend to check for fixing that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论