我在其他方面使用LinK +来开发Linux内核模块。我的开发机器安装了Linux Mint 18操作系统,内核版本为4.4.xx.为了测试,我想将内核模块部署到具有内核版本3.16.xx的Debian机器(在虚拟机中)。
LinK +有一个名为"编译其他内核的选项" (见下图)
当我按下该按钮时,对话框要求我指向内核源位置。我从https://www.kernel.org/下载了内核版本3.16.xx,然后指向该存档中提取的文件。
make命令的输出是:
**** 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'
我做错了什么?
答案 0 :(得分:1)
我从https://www.kernel.org/下载了内核版本3.16.xx,然后指向该存档中提取的文件。
如果只有原始源,则无法为某些内核编译模块。您需要点IDE来配置和部分构建内核。实际上,为某些内核版本构建模块所需的所有文件都在编译内核的kbuild目录中,安装在/ lib / modules / version / kbuild中。有linux-kbuild- 版本(https://packages.debian.org/jessie/kernel/linux-kbuild-3.16)包,包含一些文件https://packages.debian.org/jessie/amd64/linux-kbuild-3.16/filelist和linux-headers- 版本(https://packages.debian.org/jessie/linux-headers-3.16.0-4-amd64)其中包括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