Export to GitHub

get-a-robot-vpnc - issue #55

tun.ko for Nexus One


Posted on Feb 6, 2010 by Happy Ox

Could a tun.ko please be made available for Nexus One too? The one for Droid doesn't work on Nexus One.

Thanks.

What steps will reproduce the problem? 1. Nexus One (even after latest OTA update (update1) does not have tun.ko 2. lsmod shows up empty 3. After downloading tun.ko (for Droid) and trying to add it on Nexus One: insmod tun.ko, it fails.

What is the expected output? What do you see instead?

insmod: init_module '/data/tun2.ko' failed (Exec format error)

dmesg | grep tun shows the following:

tun: version magic '2.6.29-omap1-g0dd7e0b preempt mod_unload modversions ARMv7 ' should be '2.6.29-gad36b87 preempt mod_unload ARMv7 '

What version of the product are you using? On what operating system?

Google Nexus One, Firmware 2.1-update1. Kernel version 2.6.29-gad36b87, Build number ERE27

Please provide any additional information below.

Comment #1

Posted on Feb 6, 2010 by Happy Ox

I'm using the latest version VPN_Connections_v097.apk, downloaded from the site here.

Comment #2

Posted on Feb 9, 2010 by Swift Panda

Comment deleted

Comment #3

Posted on Feb 9, 2010 by Swift Panda

Hi, have you been able to find working tun.ko for Nexus One? Mine expects '2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7' version though... It is ERE27 version.

Comment #4

Posted on Feb 9, 2010 by Helpful Cat

i have the same issue. I am running CM 5.0 5beta4, and can't get tunneldroid to work ,apparently it doesn't load the tun.ko module correctly. i also have tried to use the one available in vpn connections v097, but it doesnt work :(

Comment #5

Posted on Feb 9, 2010 by Swift Panda

I have seen different tun.ko, and apparently it is possible to build tun.ko for stock Droid. Does anybody know how to build one for stock Nexus One?

Comment #6

Posted on Feb 22, 2010 by Swift Panda

I have managed to build tun.ko for the stock kernel! Details are here: http://forum.xda-developers.com/showthread.php?p=5692491#post5692491

Module is attached as well.

Attachments

Comment #7

Posted on Feb 22, 2010 by Swift Panda

Hm, just in case, repeating the instructions:

  • I have Android OpenSource installed in /opt/android
  • In /opt/android I did: git clone git://android.git.kernel.org/kernel/msm.git kernel-nexus
  • In kernel-nexus I did:
  • git checkout -b origin/android-msm-2.6.29-nexusone
  • git checkout HEAD^ (The last operation reverses one revision, I needed a previous revision from the tree. Different revisions generate modules with different vermagic values)
  • make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- distclean
  • adb pull /proc/config.gz
  • gunzip config.gz
  • mv config .config
  • Edited .config: changed "# CONFIG_TUN is not set" to: "CONFIG_TUN=m"
  • make ARCH=arm CROSS_COMPILE=/opt/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- modules
  • The driver ends up in: drivers/net/tun.ko
  • You can verify if it is going to match the kernel by running:
  • strings drivers/net/tun.ko | grep 2.6.29
  • It should produce "vermagic=2.6.29-01117-g4bc62c2 preempt mod_unload ARMv7"
  • The "2.6.29-01117-g4bc62c2" should be the same as the "Kernel version" in "Settings->About phone" on your phone.
  • Now you can upload the module to your phone. I did:
  • adb shell mount -o remount,rw /dev/block/mtdblock3 /system
  • adb push drivers/net/tun.ko /system/lib/modules/
  • adb shell mount -o remount,ro /dev/block/mtdblock3 /system
  • And you can use adb shell, enter /system/lib/modules and run: insmod tun.ko
  • It should work

Comment #8

Posted on Feb 22, 2010 by Swift Panda

Hm, instead of going to the previous revision this should do the trick as well (it should check out the correct revision in one step): git checkout 4bc62c230b2942bea72c3b5258e3e4f1d6cb534b

Comment #9

Posted on Mar 15, 2010 by Happy Ox

Thanks! that tun.ko loaded fine for me! :) However, I'm still unable to connect due to: http://code.google.com/p/get-a-robot-vpnc/issues/detail?id=65

Status: New

Labels:
Type-Defect Priority-Medium