简体   繁体   中英

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.

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

Yes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM