yashsingh1/xdaforums huggingface dataset:
[HTC EVO 3D] dalgibbard:
OK, so since getting the 3VO, there's been a small void in my heart whereby i couldn't connect to my home server via OpenVPN on the stock ROM with root...

So i've compiled the required module, and tested it as working.

The loose process, for those who are interested was:

* Download the HTC EVO 3D kernel source from HTCDev
* Download the Android SDK
* Download an ARM compiler (i used http://www.codesourcery.com/sgpp/lite/arm/portal/release1293)
* Extract all of the archives into seperate dirs.
* Grab a copy of the /proc/config.gz off my handset and drop uncompessed into the HTC source folder
* export ARCH as ARM, and CROSS_COMPILER as the /bin dir of the ARM compiler
* Jump into the HTC source, and run a make menuconfig:
** remove the "kineto" network adapter (it causes make issues...)
** in General> Localversion, set the kernel localversion (ie. -gdb5464d in this case)
** Exit and save changes
* Add CONFIG_TUN=m to 'Makefile'
* Edit the line echo "+" to echo "" in scripts/setlocalversion
* run: make modules SUBDIR=drivers/net
* You should now find "tun.ko" in drivers/net :)

NOTE: Only tested on 2.6.35.13-gdb5464d

Unfortunately, i don't have the time to put it into a flashable zip, so here's some basic instructions.

Pre-Requisites:

A. You have already setup an OpenVPN Server, and know it works ;)

B. You have already downloaded and installed the OpenVPN Application to your handset (install to default locations)

C. You have the required configuration file and client certificate on your device (this example uses '/sdcard/openvpn' as the openvpn config directory.)

Process:

1. Download the tun.zip file below, and unzip it.

2. Place the 'tun.ko' file onto your SD card.

3. Open up a terminal emulator, or better yet, SSH to your phone with something like QuickSSHD (makes life easier, but not essential.)

4. Remount the /system partition as read/write:

mount -o remount,rw /dev/block/mmcblk0p22 /system

5. Create a symlink of the modules directory:

cd /system/lib/modules
ln -s . `uname -r`

6. Copy the module into the system modules directory

cp /sdcard/tun.ko /system/lib/modules/

7. Create a symlink for iptables, as the OpenVPN app seems to not work with the defaults for that...

mkdir /system/xbin/bb
ln -s /system/bin/ifconfig /system/xbin/bb/ifconfig

8. And now test!

/system/xbin/openvpn --config /sdcard/openvpn/openvpn.conf

9. Once you're happy that all is well, don't forget to remount /system as readonly, by either rebooting, or:

mount -o remount,ro /dev/block/mmcblk0p22 /system

And that should be that! Any questions, just shout! ;)

Kudos to:

http://sshrootat.blogspot.com/2011/06/compiling-tunko-for-android-openvpn.html
[HTC EVO 3D] nickiberli:
Did you test it and it's working?

Because the kernel source on htcdev.com is only for the CDMA version i thought, isn't it?
[HTC EVO 3D] LeeDroid:
Has this been tested on the new 2.3.4 kernel? tun is included as default as far as i am aware
[HTC EVO 3D] htc0101:
I posted this in another thread on aug 28th with no replies.

"On the htcdev site the evo 3d kernel source they have listed is:

HTC EVO 3D-CRC-2.6.35

not sure what the "crc" stands for but my Rogers gsm evo 3d is kernel 2.6.35.13

does that mean it is the right one or am I too hopefull?"

that kernel has been there for a while cdma or gsm or cross compatible?:confused:
[HTC EVO 3D] LeeDroid:
yes, CRC is the 2.3.3 source and as far as I am aware, totally cross compatable (gsm/cdma)... HTC are farr to slow when it comes to source :o

not sure what it stands for tbh but the 2.3.3 kernel did not have the built in tun module, if you attempt to insmod a tun module on the 2.3.4 kernel it will reject it as the symbols declared are already defined in the zImage.. good old HTC!
[HTC EVO 3D] dalgibbard:
OK, so to answer the questions- i'm not sure if the CRC source itself is cross compatible between GSM and CDMA- i would initially assume not due to whatever wireless device modules are contained within, although Leedroid is suggesting otherwise, and i'd probably take his word on it than mine :)

The tun module is irrelevant however in any case, as im not compiling an entire kernel, just the one module which is not baseband dependant (ie. it *is* GSM/CDMA cross compatible).

Aside from this, the android version (ie. 2.3.3 or 2.3.4 etc) is also fairly irrelevant, on the basis that you compile for the kernel rather than the OS version (it's still roughly the same underlying OS anyway); particularly as there's no major differences that affect tunnelling between the two revisions that i'm aware of- i can however confirm that the source code was for 2.6.35.10 - which i believe is the original/updated CDMA kernel. However, you would need to recompile the module for it to work on any kernel other than *2.6.35.13*, as modprobe will reject it otherwise due to it being compiled for that specific version.

If you happen to need it for another kernel version and don't fancy compiling it yourself, drop me a note and i'll see what i can do. FYI- I'll need it in the format of "2.6.35.13-gdb5464d". Maybe i'll write a n00bs guide sometime... :)

Second from lastly; you can probably hexedit the version number to one of your choosing! As long as it matches the string length; ie. full kernel number = 18 characters incuding dots; it will work :)

And lastly, yes it does work, i'm using it now to connect to my home VPN :D Stock rooted GSM (UK) 3VO, running 2.3.4, and the kernel it was compiled for (2.6.35.13-gdb5464d)
[HTC EVO 3D] dalgibbard:
Strange... i haven't seen any such issues here? That's with the HTC stock kernel? CDMA?
[HTC EVO 3D] LeeDroid:
I had initially made the assumption that HTC would have configured the Evo kernel as they did the sensation, turns out this is not the case, sensation 2.6.35.13 includes tun, howerver the EVO kernel does not... Hmm, wonder what they were thinking?...

My reference to 2.3.3 & 2.3.4 was not directed at the kernel but used as a point of reference for the supplied kernels (in noob terms) ;)

Sent from my s-off HTC sensation running LeeDrOiD Sensational
[HTC EVO 3D] htc0101:
Well htcdev just released the new MR kernel for the 3d......
[HTC EVO 3D] dalgibbard:
Thanks for the feedback :) although I'd be inclined to disagree, mainly on the basis that the CONFIG_TUN option in /proc/config.gz isn't set?

I would say though that i've switched to your ROM (which is pretty great!), and a quick 'find /system -name "*tun*"' doesn't yield any results, so its not modulised- and 'zcat /proc/config.gz | grep "CONFIG_TUN" throws back "# CONFIG_TUN is not set"

That and openVPN doesn't seem to be working yet :D
[HTC EVO 3D] jayray1:
I am curious about compiling my own modules (would like to try a few other modules out). Which HTC source do you use for a phone running 2.6.35.10-gbc1cf83, I've tried both crc and mr with no luck I am using the compiler in the NDK to compile. I can build the module but it will not load or I get "init_module './tun.ko' failed (Exec format error)" sounds like maybe the compiler is not working correctly. I would like to use the "codesourcery" compiler but I can not seem to find it.

TIA

Jason
[HTC EVO 3D] dalgibbard:
Sorry for the delay Jason, been out of the country for a while :) I struggled to remember whereabouts on their website it was... So try this instead: http://fingaz.info/armeabi.tar.bz2
[HTC EVO 3D] pogopope:
jayray1- I'm running the same kernel and was experiencing the same error when trying to install the tun.ko I had just compiled. If you check dmesg after performing the insmod it may give you some insight into why its not loading. In my case it was because I had neglected to include '.10-' in the EXTRAVERSION var of the Makefile for the kernel source, so the magic number of the module was not matching the kernel version.

Your Makefile should contain the following to compile modules for 2.6.35.10-g93c03bf.

VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 35
EXTRAVERSION = .10-g93c03bf

Also if you're curious, I compiled tun.ko with shooter-2.6.35_mr, though I don't really understand what the difference between MR and CRC kernel source is.

I've attached the tun.ko that I compiled since I couldn't find one elsewhere on the internetz.
[HTC EVO 3D] dalgibbard:
Well described issue! I can see the issue too- you see where you've done the "ln -s" for ifconfig? You need to do the same again, but swap "ifconfig" for "route", as openvpn is failing to locate it.

ln -s /system/bin/route /system/xbin/bb/route

That is of course assuming that route is actually in /system/bin/
[HTC EVO 3D] dalgibbard:
No problem, glad it worked.

One last thing- "keyone01.key" should only be root readable, that's why your getting an error about it for group perms.you can fix that by doing:

chmod 600 /path/to/keyone01.key

Not essential, but fairly wise from a security point of view, and it'll fix that error :-)
[HTC EVO 3D] GbMax78:
Samsung Galaxy S2 - Lightning rom 6.1 - OpenVPN - BusyBox [SOLVED]

You solved a big problem, I know Debian Gnu Linux, I use Zenwalk and Slackware but Android it isn't the same...

I don't understand what are Android perms and when I start the phone I don't know if I am root or normal user !

There is message "WARNING: file '/sdcard/openvpn/keyone.key' is group or others accessible" because all users can access this file ? Now keyone01.key is 777 ? But if I make keyone01.key root readable only I have problems if I start the phone as normal user ?

Ok when I have one minute I do that !

I would like to understand perms on Android, on Linux if you change files perms for root only, normal user can't use them but if there is one user, root, this is the reason to change perms for root only !

GbMax78
[HTC EVO 3D] dalgibbard:
Sorry, regarding that whole permissions thing, ignore it-even as root you can't change the perms of the file (namely the owner) as it had to keep the sdcard_rw group in order for you to list the file... Probably still worth chmodding it to 600 though, you just can't change the owner to root, meaning that error won't go away :) it's not a problem though really, more an observation.

The idea was that openvpn is run as root (standard users can't access the tun module) and therefore in order to protect your secret key (which normally you should as it gives anyone with access to the file, access to you network...), the key should be owned by the person who runs the app (in this case "root") and the permissions changed to only allow them access. It in the same manner as Linux/UNIX permissions anyway :)

For reference for anyone that doesn't know, the chmod is broken down into three elements-the first digit is for the "owner", the next is for the "group", and the last is for everyone else. The numbers are added up from the following dependant on which perms are required:

4= read

2= write

1= execute

So 600 means to give read and write access without execute to the file owner. The zeros elsewhere mean to give those users/groups nothing.

Hope that helps!

PS for the Linux geeks on here reading this, there is a fourth value too for sticky bit etc, but I won't cover that here :)
[HTC EVO 3D] fwhite42:
Any chance of getting a tun.ko module compiled for kernel 2.6.35.13-g84f8edd (EVO 3D CDMA running stock kernel and Fresh Evo 3d 4.1.0)?

I tried the tun.ko in this thread and I get an exec error when I try insmod which I believe usually indicates a kernel/compile mismatch.

Thanks!
[HTC EVO 3D] andreasl:
Hello,

on "www htcdev com/devcenter/downloads/P100" are new sources for Kernel 3.0.16 and Android 4.0, I found nothing explizit for EVO 3D but size of the most is the same (97.4 MB or 97.7 MB), I don't know which is the right for EVO 3D.

Please can anybody try to compile the tun.ko module ?

Thanks Andreas

P.S. I cannot submit links in my reply.
[HTC EVO 3D] andreasl:
Hello,

good news, tun is in the kernel included as "CONFIG_TUN=y"

openvpn is running.

Thanks for reading.

Andreas
[HTC EVO 3D] GbMax78:
Avatar stable rom with Android 4.2.2 - tun.ko and OpenVPN

Here you can read how to enable a Samsung I9100 with OpenVPN, you can find tun.ko compiled for Avatar stable rom with Android 4.2.2!

First you need to install sshdroid on your smartphone, after run sshdroid you can see ip address, in this case is 192.168.1.100; now we can connect by a Linux console to the smartphone:

root@Server01:/home/gabriele# ssh 192.168.1.100

The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
RSA key fingerprint is XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.100' (RSA) to the list of known hosts.
SSHDroid
Use 'root' as username
Default password is 'admin'
root@192.168.1.100's password:
/data/data/berserker.android.apps.sshdroid/home #

I like to make openvpn dir on external sd:

# cd /storage/sdcard1
/storage/sdcard1 # mkdir openvpn

Now we can use our computer to transfer files on our smartphone:

root@HP-2170P:/home/gabriele/Documenti/OpenVPN/Massimo/I9100# ls

ca.crt client.ovpn i9100.crt i9100.key tun.ko

root@HP-2170P:/home/gabriele/Documenti/OpenVPN/Massimo/I9100# scp ca.crt client.opvn i9100.crt i9100.key root@192.168.1.100:/storage/sdcard1/openvpn/

The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
RSA key fingerprint is XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.100' (RSA) to the list of known hosts.
SSHDroid
Use 'root' as username
Default password is 'admin'
root@192.168.1.100's password:
ca.crt 100% 1350 1.3KB/s 00:00
client.ovpn 100% 3437 3.4KB/s 00:00
i9100.crt 100% 3929 3.8KB/s 00:00
i9100.key 100% 916 0.9KB/s 00:00

Now we can try to start OpenVPN on our smartphone:

storage/sdcard1/openvpn # openvpn client.ovpn

Enjoy this "guide"! :)
[Desire HD Q&A, Help & Troubleshooting] MisterBuggie:
Hi there,

I was wondering if anyone has managed to compile VLC for Android. From reading the forums, it seems it's getting pretty close, and I wanted to try it out, only I don't currently have a linux install to follow the comilation wiki :

http://wiki.videolan.org/AndroidCompile

Main reason is I want to be able to watch TV on my phone, as my French ISP (Free) allows streaming the IPTV using VLC. Works a treat on the PC.

So I thought maybe someone here has already done that and could share the install file.
[Desire HD Q&A, Help & Troubleshooting] ROBINGAZI:
Have you tried VLC Direct (from Market) to receive streaming media? If you are successful, getting the TV working shouldn't be hard.
[Desire HD Q&A, Help & Troubleshooting] MisterBuggie:
Tried it, no good. If I enter the rstp address for a channel manually, it asks me what I want to open it with, it won't open it itself. And none of the players will accept it. I have vplayer, moboplayer, rockplayer and nothing works.

I could probably get it to work if I opened up the TV on the computer and then streamed it to VLC Direct, but that completely defeats the purpose.
[Galaxy S II Q&A, Help & Troubleshooting] amandureja:
Hi guys,

So for the past week or so, I've been noticing really bad battery drain on my GS2, and I think I have finally pinpointed the problem.

"BetterBatteryStats" has told me that there are 2 specific wakelocks running in the background, which prevent the phone from going to 'deep-sleep'. These are the "suspend" and "events/0" processes. They are on for hours, preventing the phone from going into a proper 'deep-sleep', and keeping it awake.

My question is, how would I stop these processes from running? I know for a fact that it is not such a common 'bug', because tons of people are getting >18 hours on their GS2 with moderate/heavy use, while I'm only getting about 10 with light/moderate usage.

So in short, why are the "suspend" and "events/0" processes running while the phone is supposed to be in sleep mode, and how do I stop them from running and draining battery?

Thanks everyone!
[Galaxy S II Q&A, Help & Troubleshooting] ithehappy:
Well I don't have that problem so can't say. You should ask it on the BBS dedicated thread,

http://xdaforums.com/showthread.php?t=1179809

Regards.
[Galaxy S II Q&A, Help & Troubleshooting] aydc:
This is the famous "Android OS" bug, which happens only on SGS2. Search the forum and you'll see quite a few threads about it. There is no solution, but keeping wifi off when not in use or setting is to sleep when screen is off helps quite a bit.
[Galaxy S II Q&A, Help & Troubleshooting] Sincitybronze:
It's not only a bug on SGS2. I've been fighting this problem for quite a while on my Nook Color with CM7. Here's the thread I started.
[Galaxy S II Q&A, Help & Troubleshooting] penskyc:
hmm, I am having this problem as well, I'm used to my iphone, where i can use it all day and still remain above 50% meanwhile every time i pop the screen on my GS2 the percentage is down from last time. its horrible, very much considering going back, I love this phone, but this battery draining situation is out of control for me.. midnight -8:30 i lost 45 percent battery.. screen off..
[Galaxy S II Q&A, Help & Troubleshooting] skimminstones:
you might want to have a bit of a read. You never know, might find something :p
[Galaxy S II Q&A, Help & Troubleshooting] penskyc:
been reading all day and night most stuff lead to a dead end, currently looking at this:

http://code.google.com/p/android/is...c=ID Type Status Owner Summary Stars&id=16721

turning off google sync and stuff is not an option for me, I need push email, and contacts and google reader, whats a smart phone if i need to dumb it down
[Galaxy S II Q&A, Help & Troubleshooting] skimminstones:
http://xdaforums.com/showthread.php?t=1290020
[Galaxy S II Q&A, Help & Troubleshooting] penskyc:
so basically there is no solution...
[Galaxy S II Q&A, Help & Troubleshooting] skimminstones:
well for me, installing the siyah 1.8 kernel has sorted it and my battery life is pretty damn good now.

Others will tell you its not fixed and the extra battery life im getting is a placebo. But all i know is i used to get 3 hours screen on time and lose 15-20% battery overnight. Now i lose 2% overnight and get 5-6 hours screen on time. If thats placebo then so be it.
[Galaxy S II Q&A, Help & Troubleshooting] penskyc:
hmm, ok, I will look into kernels, I am using an AT&T SGS2 so its a little different kernel wise. I have yet to find anything in my specific forums though.. just switched from an eperimental kernel to a stable, so maybe this will help
[Galaxy S II Q&A, Help & Troubleshooting] kidau:
I think I just read somewhere in the Galaxy S2 forum that AOS isn't exactly solved on the .14 kernel (which siyah 1.8 is based on)..... it just merely not include suspend and events/0 into the Android OS count for the battery.....

Anyone can shed some light on this?

---------- Post added at 10:28 PM ---------- Previous post was at 10:23 PM ----------

ok, found it

http://xdaforums.com/showthread.php?t=1290020

hope this would be useful
[Galaxy S II Q&A, Help & Troubleshooting] skimminstones:
then yea, dont be installing any roms/kernals form this forum. You have a different phone.
[Galaxy S II Q&A, Help & Troubleshooting] penskyc:
yup! I know, just figured since the phone was around longer it would have some more information on the suspend and events/0, which it did, thanks for your help!
[Galaxy S II Q&A, Help & Troubleshooting] a1adin:
is siyah 1.8 better for battery life compared to siyah 2.1 or the newer one?

I tried 2.1, but I still have high android OS.

Using bbs, I see that suspend and events/0 is still around 1 to 3 minutes each day.

I have turned off:

Accounts and sync > background data & auto-sync,

Privacy > back up my data,

Location and sec > use wireless networks.

Any other advice?
[Galaxy S II Q&A, Help & Troubleshooting] atulalvenkar:
Use a 2.3.4/2.3.5 based ROM such as CheckROM HD or Hyperdroid-Androidmeda with Darknight-Siyah Kernel.

I get 3 days of use if i keep data off . With Data on and normal usage i get on average 0.7-1% drop per hour compared to 3-4% of 2.3.3 ROM.I think it's a combination of kernel and ROM that solves the problem.

Earlier CPU Spy used to show lots of time spent at 800Mhz which is what android OS bug does. Now i see it spending 1-2% time in 800Mhz and most of time in deep sleep.
[Galaxy S II Q&A, Help & Troubleshooting] a1adin:
thanks for the reply.

now I am using CRv3.1.1 with speedmod 18test3.

but it seems that from day to day, events/0 & suspend are getting bigger and bigger.

do you know why?
[Galaxy S II Q&A, Help & Troubleshooting] amandureja:
I upgraded to KI3 a long time ago, and froze the hubs + wifi sharing / wifi sharing manager (i never even used the hubs anyways), and what do you know; my battery can now easily last me a LONG time, after 16 hours it still always has AT LEAST 40% remaining, and that is with a few hours screen-on time, data sometimes on, wifi usually always on! I'm extremely happy now!

So in short, for those of you with bad battery life, the least you could do is upgrade to XXKI3 or XXKI4 (they're pretty much the same thing) firmware/kernel. Even completely stock without root/frozen apps is A LOT better than any other 2.3.4 / 2.3.3 ROMs.
[Galaxy S II Q&A, Help & Troubleshooting] a1adin:
CRv3.1.1 is already based on xxkj3, and I have already frozen most of samsung bloatware.

However, I have just found out that kernel is an important factor in high suspends and events/0.

Now I use the previous version: speedmod 17 test 1, and suspends & events/0 decrease a lot.