Linux Kernel Module development compile for other kernel

Tarida George

I'm using LinK+ in other to develop a linux kernel module. My development machine has a Linux Mint 18 installed operating system with kernel version 4.4.xx. For testing I want to deploy the kernel module to a Debian machine(in a virtualbox) which has a kernel version 3.16.xx.

LinK+ has an option called "Compile for other kernel" (see image below)

enter image description here

When I press that button a dialog ask me to point to Kernel Source Location. I've downloaded kernel version 3.16.xx from https://www.kernel.org/ and then pointed to extracted files from that archive.

The output of the make command is this:

**** Build of configuration Debug for project VMDD ****

make --makefile=Makefile --directory=KERN_SRC modules 
make: Entering directory '/home/george/linkProjects/VMDD/KERN_SRC'
make -C /home/george/kernels/linux-3.16.43/ M=/home/george/linkProjects/VMDD/KERN_SRC modules
make[1]: Entering directory '/home/george/kernels/linux-3.16.43'

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /home/george/linkProjects/VMDD/KERN_SRC/VMDD.o
/bin/sh: 1: ./scripts/recordmcount: not found
scripts/Makefile.build:263: recipe for target '/home/george/linkProjects/VMDD/KERN_SRC/VMDD.o' failed
make[2]: *** [/home/george/linkProjects/VMDD/KERN_SRC/VMDD.o] Error 127
Makefile:1337: recipe for target '_module_/home/george/linkProjects/VMDD/KERN_SRC' failed
make[1]: Leaving directory '/home/george/kernels/linux-3.16.43'
make[1]: *** [_module_/home/george/linkProjects/VMDD/KERN_SRC] Error 2
make: *** [modules] Error 2
Makefile:8: recipe for target 'modules' failed
make: Leaving directory '/home/george/linkProjects/VMDD/KERN_SRC'

What did I do wrong ?

osgx

I've downloaded kernel version 3.16.xx from https://www.kernel.org/ and then pointed to extracted files from that archive.

You can't compile modules for some kernel if you have only its original source. You need point IDE to configured and partially build kernel. Actually, all files needed to build modules for some kernel version are in kbuild directory of compiled kernel, installed into /lib/modules/version/kbuild. There are linux-kbuild-version (https://packages.debian.org/jessie/kernel/linux-kbuild-3.16) package with some files https://packages.debian.org/jessie/amd64/linux-kbuild-3.16/filelist and linux-headers-version (https://packages.debian.org/jessie/linux-headers-3.16.0-4-amd64) which includes Module.symvers (https://packages.debian.org/jessie/amd64/linux-headers-3.16.0-4-amd64/filelist):

/usr/src/linux-headers-3.16.0-4-amd64/Module.symvers

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cross Compile Linux Kernel Module

From Dev

Cross Compile Linux Kernel Module

From Dev

How to compile module with new kernel in Linux

From Dev

Compile a linux 2.6 kernel module with newer compiler

From Dev

Configuring Eclipse for Linux Kernel module development

From Dev

how to compile a kernel module

From Dev

Compile FTDI kernel module

From Dev

Compile Linux kernel module without Module.symvers

From Dev

Compile linux kernel error

From Dev

Linux kernel development

From Dev

How to compile Linux kernel with multimedia as module on Odroid C2

From Dev

Disadvantages of linux kernel module?

From Dev

linux kernel module not autoloading

From Dev

Linux kernel module programming

From Dev

Disadvantages of linux kernel module?

From Dev

Linux Kernel Module Compilation

From Dev

Linux kernel - Context switch when calling function from other module?

From Dev

compile one file of linux kernel

From Dev

Linux kernel development using Qemu?

From Dev

Vim configuration for Linux kernel development

From Dev

Implementing poll in a Linux kernel module

From Dev

Sofware pwm as linux kernel module

From Dev

Makefile for linux kernel module issue

From Dev

Passing parameter to builtin kernel module at compile time

From Dev

How to compile Ubuntu 16.04 kernel with zfs module

From Dev

Error while trying to compile kernel module

From Dev

Linux kernel development dual booting Linux/Windows

From Dev

How to use macbook storage space for linux kernel development from other linux machine?

From Dev

Linux Kernel module calling a function in another module