如何编译“tun.ko”文件OpenVPN 文件?
大家可能知道,android的系统更新非常频繁,每次重大更新,只要linux内核发生变化,就需要重新编译tun.ko文件。
对于姜饼最近的更新,我发现旧的 tun.ko 文件没有用,并且找不到从哪里可以获得这样的文件(我尝试过 XDA 和 Google),所以我决定自己编译 tun.ko。
我确实找到了一些介绍如何编译该文件的文章和博客。 我已经有了 ARM 交叉编译器和 android 内核(来自 GitHub android 镜像,因为 android 的 kernel.org 无法访问),但总是出现错误,例如:
$ ARCH=arm 制作模块 SUBDIRS=drivers/net
错误:内核配置无效。 include/ generated/autoconf.h 或 include/config/auto.conf 丢失。 运行“make oldconfig &&”在内核 src 上进行“准备”来修复它。
/bin/sh: /bin/false: 没有这样的文件或目录
警告:符号版本转储 /Users/xxx/Downloads/msm/Module.symvers 失踪了;模块将没有依赖项和 modversions。
构建模块,第 2 阶段。 /Users/xxx/Downloads/msm/scripts/Makefile.modpost:42: include/config/auto.conf: 没有这样的文件或目录 make[1]: * 否 规则使目标“include/config/auto.conf”。停止。品牌:* [模块]错误2
我无法弄清楚为什么会出现这些错误,有人可以帮我解决吗?
多谢!
As you all may know, android has a very frequent system updates, and for each major updates, as long as the linux kernel changed, the tun.ko file needs to be re-compiled.
For the very recent update of gingerbread, I found the old tun.ko file is useless and find no where to get such a file (I've tried XDA and Google), so I decided to compile tun.ko myself.
I did find some articles and blogs introducing how to compile the file.
I've got the ARM cross compiler and the android kernel (From the GitHub android mirror, since the kernel.org for android is unaccessible), but always getting errors, like:
$ ARCH=arm make modules SUBDIRS=drivers/net
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it./bin/sh: /bin/false: No such file or directory
WARNING: Symbol version dump
/Users/xxx/Downloads/msm/Module.symvers
is missing; modules will have no dependencies and modversions.Building modules, stage 2.
/Users/xxx/Downloads/msm/scripts/Makefile.modpost:42:
include/config/auto.conf: No such file or directory make[1]: * No
rule to make target `include/config/auto.conf'. Stop. make: *
[modules] Error 2
I cannot figure out why was those errors, could any one help me to get out?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先适当地配置内核,否则无法构建模块。
在大多数情况下,应该可以从设备中提取内核配置(应该在 /proc/config.gz 中),但它是一个可选功能,因此可能会丢失。
不过,为您的内核进行一些非常通用的配置(与设备版本相同)往往会起作用。
You need to first configure the kernel appropriately, otherwise no modules can be built.
In most cases, it should be possible to extract kernel config from the device (should be in /proc/config.gz) but it's an optional feature, so might be missing.
Making some pretty generic config for your kernel (with the same version as device) tends to work, though.