[linux-yocto] Kernel modules and vermagic

Gutierrez, Hernan Ildefonso (Boise R&D, FW) hernan_gutierrez at hp.com
Mon Aug 28 15:46:27 PDT 2017


Hi,

I am new to this dist-list and I am not sure if this is the right forum. My apologies beforehand if this is not the right list.

Problem statement:

I am evaluating Yocto for a project. We have a workflow where linux kernel is built from a local git repo separately from the root file system.

I made a recipe to build rootfs using yocto to our target, I deployed both images (Kernel built from our git repo + rootfs generated by Yocto) ... all this works great.

Now I want to add a couple of kernel modules provided by a third party vendor. If the module is built along with our kernel build system (and deployed to target), they work fine.

Is there a way to build kernel modules with Yocto and point them to the includes of our git kernel repo just to satisfy the kernel dependencies?

In attempts to explore options,  I made a yocto kernel recipe to build a kernel from our internal git repo.
I made also yocto recipes to build the kernel modules which resolve dependencies for kernel header files with above yocto kernel recipes.

All above builds fine, I can deploy the rootfs which includes the .ko files I need, I even ask yocto to autoinitialize the modules on boot.
Rootfs fails to load the modules like this:

[FAILED] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.

When I try to insmod the module manually it fails with a vermagic error like this:

# insmod hello-mod.ko
      hello: version magic '4.9.13_1.0.0_hgv+g68f8dea22b SMP preempt mod_unload ARMv7 p2v8 ' should be '4.9.13 SMP preempt mod_unload ARMv7 p2v8 '
     insmod ERROR: could not insert module hello.ko: Invalid module format

I've read enough and it seems like this is because the kernel image deployed generated with our separate workflow has a uname as 4.9.13 and it seems like yocto adds the string _1.0.0_hgv+g68f8dea22b to the vermagic... of the kernel modules, which seems to come from the kernel recipe I generated to satisfy the dependencies to build the module.

I want to know if there is a way to keep building our kernel separately from the root file system and kernel modules with yocto.

This is just because our workflows are separate for the project we're working on. If we build the kernel with yocto, the internal workflows will change and we are evaluating the options we have.

Thanks, I'll appreciate any help and if this is not the right dist-list, please let me know where it's best to get help.

--Hernan



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/linux-yocto/attachments/20170828/947a2da3/attachment.html>


More information about the linux-yocto mailing list