How to compile a "tun.ko" file for OpenVPN?
Asked Answered
W

1

6

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!

Whirlybird answered 11/10, 2011 at 22:54 Comment(1)
Would you like to post step-by-step tutorial on how to compile tun source code for a specific android kernel?Hurless
S
0

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.

Spiderwort answered 24/7, 2012 at 22:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.