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?