artsin
artsin

Reputation: 1494

Kernel version for target and for module

I'm trying to build a simple kernel module and run it on the Raspberry Pi. I have downloaded kernel sources from official raspberry site, but they have slightly different kernel version then my raspbian on board. Is it necessary to have fully identical version of kernel on source and target machine to run kernel module? I have this on my Raspberry Pi

$ uname -a
Linux raspberrypi 4.4.11+ #888 Mon May 23 20:02:58 BST 2016 armv6l GNU/Linux

And this about my module

$ modinfo ./threads.ko 
filename:       /lib/modules/4.4.11+/kernel/mymodules/./threads.ko
version:        0.0.1
description:    Kernel threads example
author:         xxxxxx
license:        GPL
srcversion:     C906582EC824D2D8DA76BFB
depends:        
vermagic:       4.4.13+ mod_unload modversions ARMv6 

As you see: "4.4.11+" vs "4.4.13+"... Why am I asking? I have a error when insert module:

$ sudo insmod ./threads.ko
insmod: ERROR: could not insert module ./threads.ko: Invalid module format

And do not understand, it is valuable difference in last number of version of the kernel or there is another problem.

Upvotes: 5

Views: 490

Answers (1)

Jonathon Reinhart
Jonathon Reinhart

Reputation: 137398

Is it necessary to have fully identical version of kernel on source and target machine to run kernel module?

Yes.

Upvotes: 5

Related Questions