1

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?

DarkTiger
  • 11
  • 1
  • I have never had to build an out of tree driver using yocto. I have added drivers to the kernel tree. You could devtool the Apseed linux repo, and add your driver that way. – John b Mar 15 '22 at 18:49
  • Hmm, this way I need to make linux-aspeed patch with the new driver. – DarkTiger Mar 24 '22 at 09:15
  • 1
    I found the reason at the end. Reflashing BMC chip each time slowed down my development process a lot. So I decided to use NFS. This way, kernel which was on flash, had old version while fresh-compiled kernel modules on NFS (/lib/modules/5.15.10-XXX) had new one. Result was described in my post :) I just reflashed kernel and problem was fixed. Thank you for your help. – DarkTiger Mar 24 '22 at 09:30

0 Answers0