gpt4 book ai didi

Linux Kernel Module development compile for other kernel

转载 作者:太空宇宙 更新时间:2023-11-04 10:20:13 26 4
gpt4 key购买 nike

我在其他地方使用 LinK+ 来开发 linux 内核模块。我的开发机器安装了 Linux Mint 18 操作系统,内核版本为 4.4.xx。为了进行测试,我想将内核模块部署到内核版本为 3.16.xx 的 Debian 机器(在虚拟机中)。

Link+ 有一个名为“为其他内核编译”的选项(见下图)

enter image description here

当我按下那个按钮时,一个对话框要求我指向内核源位置。我从 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'

我做错了什么?

最佳答案

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

如果您只有其原始源代码,则无法为某些内核编译模块。您需要点 IDE 来配置和部分构建内核。实际上,为某些内核版本构建模块所需的所有文件都在已编译内核的 kbuild 目录中,安装在/lib/modules/version/kbuild 中。有 linux-kbuild-version ( https://packages.debian.org/jessie/kernel/linux-kbuild-3.16 ) 包和一些文件 https://packages.debian.org/jessie/amd64/linux-kbuild-3.16/filelist和 linux-headers-version ( 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

关于Linux Kernel Module development compile for other kernel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44217291/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com