Monday, August 1, 2011

OpenVPN for Android 2.2 on Viewsonic Viewpad 7

Compiling tun kernel module for android 2.2 (for Viewsonic Viewpad 7)

root your device with some program. I used this one z4root.1.3.0.apk.
Here is also local copy if link above does not work: z4root.1.3.0.apk

get the source (you need git for this one)

$ mkdir tmp
$ cd tmp
$ git clone git:// kernel
$ cd kernel
$ git checkout -t origin/android-goldfish-2.6.32

Prepare it for cross-compiling for ARM

export ARCH=arm
export CROSS_COMPILE=/path/to/android/source/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
make mrproper

Get the old configuration of your device

adb pull /proc/config.gz config.gz

Copy the file in your kernel dir

zcat config.gz > .config
make menuconfig

under device drivers->network->
check as module (M) TUN interface

exit and save

$ make modules

Now you have compiled kernel module for tun/tap interfaces
Copy drivers/net/tun.ko somewhere and put it on your device

adb push tun.ko /system/lib/modules

and test if it works

adb shell
# insmod /system/lib/modules/tun.ko

you should see that module is inserted

# lsmod
tun 12487 2 - Live 0x7f04f000
ar6000 254669 0 - Live 0x7f000000

Now your android is almost ready for installation of openvpn on it.
Since original android viewpad openssl lib does not have all ciphers you need to update it.
Use this link for instructions to update your libssl/liblzo/libcrypto: TunnelDroid README
OpenVPN/libssl/liblzo/libcrypto in one zip - get it from here: TunnelDroid Files or a local copy here:

Now browse android market and install OpenVPN Installer and OpenVPN Settings then follow the instructions.
OpenVPN Installer have some configuration options about where is your busybox installed and makes proper links
Finally use OpenVPN settings for final configuration of the openvpn.

Useful links:
cross compiling android

tun.ko - module for android 2.2, kernel, ARM arch
config.gz - kernel config.gz downloaded from viewpad7 (android 2.2)
android-viewpad7 - check out this dir for more android stuff

link to original page: