building kernel modules for linux differnet version

Yann Droneaud ydroneaud at opteya.com
Tue Mar 11 12:40:50 EDT 2014


Hi,

Le mardi 11 mars 2014 à 21:16 +0530, Saket Sinha a écrit :
> 
>          I have a scenario where I need to build a driver for
> different kernel versions.
> I have kernel-headers of different version in /lib/modules/
> 2.6.32-xxxx
> 2.6.39-xxxx
> 
> and currently I am booted into 2.6.32-xxxx(which I find out by uname -r)
> 

You don't need to boot on a specific kernel version to build external
module for it.

> Now in my driver makefile, I generate .ko of driver
> make  -C   /lib/modules/$(shell uname -r)/build  M=$(PWD)  modules
> 
> but I notice that the driver .ko gets generated for 2.6.39-xxxx though
> I am booted into  2.6.32-xxxx. Can anyone help me figure out why this
> is happening?
> 

Could you check that /lib/modules/2.6.32-xxxx/build is not a symbolic
link to linux 2.6.39-xxxx sources ?

Regards.

-- 
Yann Droneaud
OPTEYA





More information about the Kernelnewbies mailing list