[GUIDE] Chrooting into a Debian environment works fine - G2 and Desire Z Android Development

http://modmymobile.com/forums/403-m...ent/526845-successful-debian-chroot-cliq.html
These basic instructions work, although I havent done anything beyond mounting /system rw, mounting debian partition, and chrooting into it.
I had to change the remount command to use /dev/mmcblk0p25, and to mount /dev/vold/179:34 instead of 179:2 for the debian environment.
No big surprise that it works, this seems to be pretty easy to do on just about any rooted android device.
*edit*
OK, it looks great. Got dropbear running, ssh'd in with connectbot, everything is just peachy.
Started a VNC server, and can connect to the local debian chroot and run Iceweasel (although its somewhat slow.)
Pretty sweet.
*/edit*

Nnnnyem

I'm not exactly certain what that post meant, but I'll clarify what "debian chroot" means on an Android device.
Android, being a Linux-based device that runs a reasonably standard Linux kernel, is capable of executing native ARM binaries from other linux distributions like Debian or Ubuntu.
However, the problem (well, one of many) is that typically NONE of the necessary libraries are installed with the Android OS.
The chroot solves that problem (and others), and allows the android phone to run native ARM Debian apps directly on the phone, like an SSH server, VNC server, nmap, etc. etc.
Basically it's a novelty for most users, but I do use it quite a bit.

keenerb said:
http://modmymobile.com/forums/403-m...ent/526845-successful-debian-chroot-cliq.html
These basic instructions work, although I havent done anything beyond mounting /system rw, mounting debian partition, and chrooting into it.
I had to change the remount command to use /dev/mmcblk0p25, and to mount /dev/vold/179:34 instead of 179:2 for the debian environment.
No big surprise that it works, this seems to be pretty easy to do on just about any rooted android device.
*edit*
OK, it looks great. Got dropbear running, ssh'd in with connectbot, everything is just peachy.
Started a VNC server, and can connect to the local debian chroot and run Iceweasel (although its somewhat slow.)
Pretty sweet.
*/edit*
Click to expand...
Click to collapse
Would you be able to right up a step by step for some reason this is not working for me . im getting errors when i run the ubuntu setup , i tried following the nexus one setup and i also tried a few others , so was wondering what the exact steps you did where also im running the rom off my sdcard the modded thmed one from the dev forum .

Has anyone attempted to run airsnort or equivilant on deb chroot? (Would the installed wifi driver be sufficient or compat?- wonder if the radio can be permisquious)
Cool beanz
Sent from my T-Mobile G2 using XDA App

khaosxiii said:
Has anyone attempted to run airsnort or equivilant on deb chroot? (Would the installed wifi driver be sufficient or compat?- wonder if the radio can be permisquious)
Cool beanz
Sent from my T-Mobile G2 using XDA App
Click to expand...
Click to collapse
It looks like it can be put into promiscuous mode.
localhost:/home/xxx# iwconfig eth0 mode monitor
Error for wireless request "Set Mode" (8B06) :
SET failed on device eth0 ; Invalid argument.
localhost:/home/xxx# iwconfig rmnet0 mode monitor
Error for wireless request "Set Mode" (8B06) :
SET failed on device rmnet0 ; Operation not supported.
localhost:/home/xxx# ifconfig eth0 promisc
localhost:/home/xxx# ifconfig eth0
eth0 Link encap:Ethernet HWaddr XXX
inet6 addr: XXX/64 Scope:Link
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1
RX packets:103 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5974 (5.8 KiB) TX bytes:984 (984.0 B)
localhost:/home/xxx# ifconfig rmnet0 promisc
localhost:/home/xxx# ifconfig rmnet0
rmnet0 Link encap:Ethernet HWaddr XXXX
inet addr:XXX Bcast:XXX Mask:255.255.255.252
inet6 addr: XXX/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:6697 errors:0 dropped:0 overruns:0 frame:0
TX packets:5909 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6159009 (5.8 MiB) TX bytes:855324 (835.2 KiB)

Related

Howto: Use internet sharing on USB with Linux and WM6

I have been trying to find out for months how to use internet sharing via usb on a windows mobile 6 device under linux. I had managed in a prior post to get bluetooth PAND working and even to get bluetooth DUN and USB DUN working but had been unsuccessful with the USB internet sharing..until now!
This is based on information found here:
http://ohioloco.ubuntuforums.org/showpost.php?p=3588717&postcount=54
To connect your WM6 device via usb to your linux pc do the following:
On your phone enable internet sharing via usb but do not connect the usb cable yet.
Run the following commands..you may need to install "svn" for this to work:
*note* If you run a kernel 2.6.31 or higher you will need to run the following patch before running make (provided by LordLanden):
Code:
wget -qO- http://sprunge.us/BSjF | patch
Code:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install
Create an /etc/sysconfig/network/ifcfg-rndis0 with the following contents:
Code:
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU='1460'
MRU='1500'
NAME=''
PEERDNS=no
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='hotplug'
USERCONTROL='no'
_nm_name='static-0'
I basically copied the ifcfg-bnep0 I had previously created over to ifcfg-rndis0. It needs to already exist so when the interface comes up it will grab an ip address and set up routing.
Now plug the phone into the usb cable going to the pc and if you do a "dmesg" you should see the following (or something similar):
ohci_hcd 0000:02:02.0: wakeup
usb 3-2: new full speed USB device using ohci_hcd and address 4
usb 3-2: new device found, idVendor=0bb4, idProduct=0303
usb 3-2: new device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-2: Product: Generic RNDIS
usb 3-2: Manufacturer: HTC
usb 3-2: SerialNumber: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
usb 3-2: configuration #1 chosen from 1 choice
rndis0: register 'rndis_host' at usb-0000:02:02.0-2, RNDIS device, xx:xx:xx:xx:xx:xx
and if you do an ifconfig you should have a new rndis0 device:
rndis0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2002:48fa:7644:19:8200:60ff:fe0f:e800/64 Scope:Global
inet6 addr: fec0::19:8200:60ff:fe0f:e800/64 Scope:Site
inet6 addr: fe80::8200:60ff:fe0f:e800/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1460 Metric:1
RX packets:761 errors:737 dropped:0 overruns:0 frame:0
TX packets:729 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:405771 (396.2 Kb) TX bytes:120796 (117.9 Kb)
----
The rndis0 device will exist both when internet sharing is enabled via usb and when it is NOT....here is how it works:
If internet sharing IS enabled via usb you have access to the internet and will get an IP...default route will be set.
If internet sharing is NOT enabled via usb then the rndis0 device will exist and can be used by programs such as syncE to manage your contact list or transfer files but you will not have internet access (from the phone) and more than likely you will not get an ip address auto assigned (it may keep the ip it used last).
I know this works as I'm connected at the moment via the rndis0 device. I find it to be more responsive than the connection via bluetooth. Hope this helps someone.
These instructions were specific for Opensuse but about the only thing you should have to change is making sure you have kernel-source installed so you can compile the module needed and you may have to define the rndis0 device somewhere other than /etc/sysconfig/network.
hi famewolf!
really like your idea. And I wanted to use it aswell, but I didnt get it started under Ubuntu 7.10.
First step with "svn" seems to be sucessfull.
But I can't find that /etc/sysconfig/network/ifcfg-rndis0.
I found out, that Ubuntu makes the settings in the /etc/network/interfaces.
Is that right? And what do I have to write in it? Thanks for feedback, and sry for my bad english.
greetz
scheich
scheich said:
hi famewolf!
really like your idea. And I wanted to use it aswell, but I didnt get it started under Ubuntu 7.10.
First step with "svn" seems to be sucessfull.
But I can't find that /etc/sysconfig/network/ifcfg-rndis0.
I found out, that Ubuntu makes the settings in the /etc/network/interfaces.
Is that right? And what do I have to write in it? Thanks for feedback, and sry for my bad english.
greetz
scheich
Click to expand...
Click to collapse
You will need to configure a file similar to your eth0 file, wherever that is located...you can probably copy the eth0 config file over and rename it.
Try installing the usb driver, hooking up your phone and see if you have a new ethernet device to configure.
Ok, works fine now. Thx, Had just some problems with my usb hub.
for Ubuntu its very easy, just add in the /etc/network/interfaces:
Code:
auto rndis0
iface rndis0 inet dhcp
I now have the problem( but I have it with bluetooth, too) when the pocketpc disconnects, I have to restart my pc, because I dont know, how to restart the network services, or so...
Everytime I want to reconnect, the pocket pc/ifconfig say fine, you are connected, but I get no ping reply.
yess, just 30 seconds in google, and I know it.
sudo /etc/init.d/networking restart
Thanks ever so much for this, exactly what I was looking for.
Unfortunately, I am trying to get this working on Puppy Linux which does not come with a compiler, and the SVN package for it will not work with SSL (svn: SSL not supported error).
I really wanna get this going though as it would mean I could carry around a USB flash drive, a sync cable and my Kaiser - boot puppy linux off the USB flash drive and access the internet through my Kaiser - from any x86 based PC.
I
evilc said:
Thanks ever so much for this, exactly what I was looking for.
Unfortunately, I am trying to get this working on Puppy Linux which does not come with a compiler, and the SVN package for it will not work with SSL (svn: SSL not supported error).
I really wanna get this going though as it would mean I could carry around a USB flash drive, a sync cable and my Kaiser - boot puppy linux off the USB flash drive and access the internet through my Kaiser - from any x86 based PC.
I
Click to expand...
Click to collapse
Svn = source...you are compiling a kernel module..this requires you to have both a compiler and the kernel source that matches the kernel you are running installed. svn comes from the packages subversion but just getting the source isn't gonna help you. See if one of the puppy linux developers will compile it for you.
Yeah, I have asked, but no joy yet.
Also, I have no /etc/sysconfig dir, I am not sure where the Puppy equivalent would be.
I just got this working in ubuntu 7.10
Do
Code:
apt-get install subversion
Then (I changed https: to http: cause I couldn't get https working on various linux OSes)
Code:
svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install
I then set Internet Sharing on my Kaiser, plugged it in, and it worked immediately.
evilc said:
I just got this working in ubuntu 7.10
Do
Code:
apt-get install subversion
Then (I changed https: to http: cause I couldn't get https working on various linux OSes)
Code:
svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install
I then set Internet Sharing on my Kaiser, plugged it in, and it worked immediately.
Click to expand...
Click to collapse
Glad you are finding it useful! It's faster then bluetooth connections and uses a MTU of 8050 instead of the normal 1500 for ethernet which seems to help alot with latency.
famewolf does it again. Thanx man been searching for this for some time now. Will try it out later when I get home.
Keep up the good work
evilc said:
I just got this working in ubuntu 7.10
Do
Code:
apt-get install subversion
Then (I changed https: to http: cause I couldn't get https working on various linux OSes)
Code:
svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install
I then set Internet Sharing on my Kaiser, plugged it in, and it worked immediately.
Click to expand...
Click to collapse
I did this but when I turn on Internet Sharing on my t-mobile Wing (WM6) the phone says check cable.
dmesg
[ 2385.588000] ipaq 2-2:1.0: device disconnected
[ 2388.964000] usb 2-2: new full speed USB device using uhci_hcd and address 14
[ 2389.132000] usb 2-2: configuration #1 chosen from 1 choice
[ 2441.192000] usb 2-2: USB disconnect, address 14
[ 2444.776000] usb 2-1: new full speed USB device using uhci_hcd and address 15
[ 2444.944000] usb 2-1: configuration #1 chosen from 1 choice
ifconfigeth0 Link encap:Ethernet HWaddr 00:09:6B:10:40:A9
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
eth0:avah Link encap:Ethernet HWaddr 00:09:6B:10:40:A9
inet addr:169.254.5.93 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:32 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2508 (2.4 KiB) TX bytes:2508 (2.4 KiB)
wlan0 Link encap:Ethernet HWaddr 00:18:4D:EC:28:03
inet addr:192.168.10.10 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::218:4dff:feec:2803/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1702 errors:0 dropped:0 overruns:0 frame:0
TX packets:824 errors:0 dropped:2 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2066640 (1.9 MiB) TX bytes:164814 (160.9 KiB)
Interrupt:11 Memory:d4010000-d4020000
Any suggestions?
Doesn't look like your kernel module is getting loaded..you can try doing a depmod -a or modprobe the module to force it to load.
Good job. Thanks a lot. I did a search a while ago and gave up.
Thanks...I'll try it when I get home.
Famewolf,
Thanks that got me in the right direction. I didn't have something loaded in the kernel.
I re-ran
sudo clean.sh
sudo make install
and it immediately connected. I disconnected, restated networking and it started working perfectly.
Thank you very much
JPNeely
jpneely said:
Famewolf,
Thanks that got me in the right direction. I didn't have something loaded in the kernel.
I re-ran
sudo clean.sh
sudo make install
and it immediately connected. I disconnected, restated networking and it started working perfectly.
Thank you very much
JPNeely
Click to expand...
Click to collapse
Glad you got it working! For those using tether alot I highly recommend a cacheing web proxy called "polipo" and make sure you use "poor mans multiplexing" which reuses connections..this helps to cut down on the latency of the connection alot! It also does pipelining and of course the cache helps speed things up.
How about setting it the other way around? I want to use the laptop internet connection to give to the PDA internet access.
Laptop connection -> PDA
Bluetooth or USB would be nice
dferreira said:
How about setting it the other way around? I want to use the laptop internet connection to give to the PDA internet access.
Laptop connection -> PDA
Bluetooth or USB would be nice
Click to expand...
Click to collapse
Thats out of the scope of this thread but if you have internet sharing enabled on the pc (you didn't specify windows pc or linux) and connect via wifi to a router it works fine. Feel free to start another thread.
Just another "yep, it works" post
Wm6 mogul/6800/titan
CentOS 5.x on Compaq 8510w laptop
So, I have both bluetooth (pand) and rndis working. Given BT2.0 speeds and usb 2.0 speeds, which would be better to use speed wise, and has anyone made the usbmodem (wmodem) work just for the trifecta? I used to have that working on the apache running wm6, but that same setup does not work with the mogul.
Anywhoo, thanks for the post!

Looking for tun.ko vermagic=2.6.32.15-g746f4f0

Has anyone compiled tun.ko under the 2.2 stock?
Bill T
I have TUN vermagic=2.6.32.15-g746f4f0
Since nobody seemed to have it
I compiled TUN from the HTC sources, It loads,
** BUT ** looks like it is creating the TUN device as /dev/tun
vpnc seems to be looking in /dev/net/tun
I Will get vpnc working on a rooted stock 2.2 if it kills me
# ls /system/lib/modules
sequans_sdio.ko
bcm4329.ko
tun.ko
# strings /system/lib/modules/tun.ko | grep vermagic
vermagic=2.6.32.15-g746f4f0 preempt mod_unload ARMv7
# lsmod
tun 10734 0 - Live 0xbf000000
Tun is attached
how do you get the source + compile tun.ko? i am using Fresh's 3.2.0.0 rom with the new HTC stock kernel that is supposed to save batter life. The kernel # is 2.6.32.15-g3a8614e
HTC EVO Source
When I build the HTC code - it did not completely build everything but it did go get past tun so that is all I needed
I did this under fedora linux
you can download the HTC EVO source here
http://developer.htc.com/
you will need the google android build here is the instruction page
http://source.android.com/source/download.html
the google android source download included prebuilt compile binaries for the cross compile. I had to add the directories to my path so make could find them.
needed to edit Makefile change
EXTRAVERSION = .15-
== to ==
EXTRAVERSION = .15-g746f4f0
then did a make -j4 and waited
Bill
btedeski said:
When I build the HTC code - it did not completely build everything but it did go get past tun so that is all I needed
I did this under fedora linux
you can download the HTC EVO source here
http://developer.htc.com/
you will need the google android build here is the instruction page
http://source.android.com/source/download.html
the google android source download included prebuilt compile binaries for the cross compile. I had to add the directories to my path so make could find them.
needed to edit Makefile change
EXTRAVERSION = .15-
== to ==
EXTRAVERSION = .15-g746f4f0
then did a make -j4 and waited
Bill
Click to expand...
Click to collapse
yikes... i do have a linux box but this seems like a huge task, any way you can build tun.ko for my kernel?
<< yikes... i do have a linux box but this seems like a huge task, any way you can build tun.ko for my kernel?
post your Kernel string here and I will see about doing it.
btedeski said:
<< yikes... i do have a linux box but this seems like a huge task, any way you can build tun.ko for my kernel?
post your Kernel string here and I will see about doing it.
Click to expand...
Click to collapse
Kernel Version:
2.6.32.15-g3a8614e
[email protected] #7
don't worry if you don't have time.. thanks if you do!
I am able to connect from the EVO to the work Cisco 3030 VPN
concentrator (I am the concentrator admin) so I am able to see the connection on the 3030 as well.
The 3030 sees the conneciton
I have been able to connect in the following modes
IPSec/UDP 3DES-168
IPSec 3DES-168
IPSec/NAT-T 3DES-168
But the VPN concentrator is reporting 0 bytes sent or received,
seeing the following messages when I start vpnc
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --natt-mode force-natt /etc/
vpnc/vpnc.conf
Usage: ip link set DEVICE { up | down |
arp { on | off } |
dynamic { on | off } |
multicast { on | off } |
allmulticast { on | off } |
promisc { on | off } |
trailers { on | off } |
txqueuelen PACKETS |
name NEWNAME |
address LLADDR | broadcast LLADDR |
mtu MTU }
ip link show [ DEVICE ]
/etc/vpnc/vpnc-script: cannot create : directory nonexistent
backing up dns and resolve.conf
/etc/vpnc/vpnc-script: cannot create /etc/vpnc/dns1.txt: read-only file system
/etc/vpnc/vpnc-script: cannot create /etc/vpnc/dns2.txt: read-only file system
cp: cannot stat '/etc/resolv.conf': No such file or directory
vpnc-script ran to completion
VPNC started in background (pid: 4079)...
#
busybox route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
63.117.98.165 174.146.29.245 255.255.255.255 UGH 0 0 0 rmnet0
174.146.29.244 * 255.255.255.252 U 0 0 0 rmnet0
198.182.130.128 * 255.255.255.128 U 0 0 0 tun0
default * 0.0.0.0 U 0 0 0 tun0
busybox ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8439 errors:0 dropped:0 overruns:0 frame:0
TX packets:8439 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:507599 (495.7 KiB) TX bytes:507599 (495.7 KiB)
rmnet0 Link encap:Ethernet HWaddr 42:9C7:E2:B3:C4
inet addr:174.146.29.246 Bcast:174.146.29.247 Mask:255.255.255.252
UP BROADCAST RUNNING MULTICAST MTU:1472 Metric:1
RX packets:1165 errors:0 dropped:0 overruns:0 frame:0
TX packets:1686 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:538348 (525.7 KiB) TX bytes:234465 (228.9 KiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
-00
inet addr:198.182.130.158 P-t-P:198.182.130.158 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
#
Can anyone get vpn working at all?
tun vermagic=2.6.32.15-g3a8614e
vermagic=2.6.32.15-g3a8614e preempt mod_unload ARMv7
see attached zip file
btedeski said:
vermagic=2.6.32.15-g3a8614e preempt mod_unload ARMv7
see attached zip file
Click to expand...
Click to collapse
What does this do?
me too
First, thanks for the compiled tun.ko for the stock ROM. I just got my Evo yesterday and am diving into Android for the first time, and have gotten rooted and VPNC installed and connected, but I get 0 bytes transferred on my Cisco ASA and no actual connection on the Evo. So I'm in the same boat, and from looking around, it doesn't look like anybody has gotten this working on 2.2 stock. I don't know enough to solve the problem myself, but just wanted to confirm that I have the same issue.
VPNC Working
So... I have a workaround that does seem to work with 2.2 Froyo. I tried this on King's kernel, and netarchy's kernels (both worked). I then loaded the tun.ko from a few posts above, and insmod'd it to work for Fresh 3.2.0.0 (with the new HTC Kernel)
So, here's what you do...
-Connect using VPNC (should show connected, but not allow tunneling)
-Issue the following commands
3G: "ip rule del from all lookup gprs"
Wifi: "ip ru del table wifi"
I used the application GScript Lite to send the commands
Then tunneling works!
I have gotten the connection to work on my Evo running Fresh stock 3.28 ROM, using the commands above. However, when I disconnect the phone freezes and I have to pull the battery to reset. Any ideas of what would be causing this?
davidfretz said:
I have gotten the connection to work on my Evo running Fresh stock 3.28 ROM, using the commands above. However, when I disconnect the phone freezes and I have to pull the battery to reset. Any ideas of what would be causing this?
Click to expand...
Click to collapse
Mine is doing that also. Maybe the kernel. I tried to logcat it but dont see anything because that freezes also
Don't suppose you could post one for 2.6.32.15-gb7b01d1 ? Pretty please?
TUN vermagic=2.6.32.15-gb7b01d1 preempt mod_unload ARMv7
[email protected] net]$ strings tun.ko | grep magic
vermagic=2.6.32.15-gb7b01d1 preempt mod_unload ARMv7
The attached zip file contains tun.ko
This is the supersonic-2.6.32.15-g746f4f0 but with the compile string modified to be gb7b01d1
this should work as long as gb7b01d1 and g746f4f0 are close.
Bill T
VPNC Disconnect -- Phone Freezes
davidfretz said:
I have gotten the connection to work on my Evo running Fresh stock 3.28 ROM, using the commands above. However, when I disconnect the phone freezes and I have to pull the battery to reset. Any ideas of what would be causing this?
Click to expand...
Click to collapse
Hi there, did you ever figure out freezing issue while disconnects? Any work-around or help .. . much appreciated...
hits100 said:
Hi there, did you ever figure out freezing issue while disconnects? Any work-around or help .. . much appreciated...
Click to expand...
Click to collapse
I downloaded the source for VPNC and ran it on my EVO in debug mode. I can tell you that the problem is not with VPNC Android client directly, it actually relates to the VPNC process running in the background.
Basically.. when you run the Android client, it just acts as a simple GUI that starts/stops this VPNC process (native C++ code). The freeze occurs when that VPNC process tries getting killed. So when you click "Disconnect" from your phone, VPNC (Android client) issues a linux shell command for "kill" that is supposed to terminate the VPNC process.
I wasn't able to determine, because of my lack of C++ skillz, what the VPNC process is doing that is causing the freeze. Maybe it's trying to close tunnels that don't exist? I don't know.. I do know there is a stop command in the vpnc-script file that comes with VPNC, but I couldn't tell if that was ever getting called or what. I suppose the next step would be to add some sort of output to that script file to see if that is being called. I have a feeling it's closely related to the commands issued to get the VPN connection working. Maybe there are some commands to close the tunnels THEN kill VPNC process.. never got that far, but I hope this helps any other dev.
If anyone wants to know exactly where it crashes in the Android code, it's in the VpncProcessHandler.java file on line 238. In the "disconnect" fxn.
drizkol said:
I downloaded the source for VPNC and ran it on my EVO in debug mode. I can tell you that the problem is not with VPNC Android client directly, it actually relates to the VPNC process running in the background.
Basically.. when you run the Android client, it just acts as a simple GUI that starts/stops this VPNC process (native C++ code). The freeze occurs when that VPNC process tries getting killed. So when you click "Disconnect" from your phone, VPNC (Android client) issues a linux shell command for "kill" that is supposed to terminate the VPNC process.
I wasn't able to determine, because of my lack of C++ skillz, what the VPNC process is doing that is causing the freeze. Maybe it's trying to close tunnels that don't exist? I don't know.. I do know there is a stop command in the vpnc-script file that comes with VPNC, but I couldn't tell if that was ever getting called or what. I suppose the next step would be to add some sort of output to that script file to see if that is being called. I have a feeling it's closely related to the commands issued to get the VPN connection working. Maybe there are some commands to close the tunnels THEN kill VPNC process.. never got that far, but I hope this helps any other dev.
If anyone wants to know exactly where it crashes in the Android code, it's in the VpncProcessHandler.java file on line 238. In the "disconnect" fxn.
Click to expand...
Click to collapse
Yeah, It's not front-end. Front-End application only sends kill command to vpnc process. If I do that same from terminal, it still freezes the system. It's something with kernel..

[Q] tun.ko extraction from kernel image?

Hi, I'm running the XXJVS kernel, but apparently without tun support. I've been trying to locate a tun.ko module file for this kernel, but so far without success.
I have tried to extract tun.ko from the kernel I found here [KERNEL][I9000] Voodoo Galaxy S Gingerbread Kernel - JVN, JVP, JVQ, JVR, JVS, JVT, but I didn't find tun.ko anywhere in the initramfs image.
Does anyone know if it is possible to extract tun.ko from such an image? Otherwise, can anyone post the tun.ko from his/her /system/lib/modules directory? [assuming there are still people running the XXJVS kernel]
> uname -a
Linux localhost 2.6.35.7-I9000XXJVS-CL565837 #2 PREEMPT Thu Sep 8 20:30:23 KST 2011 armv7l GNU/Linux
Thanks,
Vic
There's no tun module in the sammy JVS. What I did:
$ unrar x I9000XXJVS.rar
$ tar xvf CODE_I9000XXJVS_CL565837_REV03_user_low_ship.tar
$ grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' zImage
16541:...
$ dd if=zImage bs=1 skip=16541 | gunzip > kernel.img
$ grep -P -a -b -m 1 --only-matching $'\x1F\x8B\x08' kernel.img
1426046:...
$ dd if=kernel.img bs=1 skip=1426046 > cpio.img
$ cpio -v -i --no-absolute-filenames < cpio.img | grep lib/modules
lib/modules
lib/modules/param.ko
lib/modules/storage.ko
lib/modules/scsi_wait_scan.ko
lib/modules/dhd.ko
lib/modules/Si4709_driver.ko
lib/modules/j4fs.ko
lib/modules/vibrator.ko
lib/modules/fsr.ko
lib/modules/ansi_cprng.ko
lib/modules/rfs_fat.ko
lib/modules/bthid.ko
lib/modules/fsr_stl.ko
lib/modules/rfs_glue.ko
I think a safer bet is going to another kernel with tun support (I'm guessing that besides not being compiled as module the support is not compiled into the kernel). Simply copying a tun.ko from another one will hardly work.
Heres a tun.ko module i compiled against stock samsung source with JVS version magic, the stock samsung kernel actually has TUN support, but just not compiled as a module, its actually compiled in the kernel (atleast from what stock source defconfig shows), so you should be able to just place this module in /system/lib/modules/ and point your app to that location..
Now this doesnt always work for everything, there are some things you can compile as a module and use on a kernel that doesnt have it compiled in it..for example most cpu governors can be compiled as a module and used on a kernel that does not have it in it.., but theres also things that cannot be done like this because they may depend on other things in the source..for example take zram.., you couldnt use a zram module on a stock kernel because stock kernel doesnt have swap support enabled, so the module would depend on that and would be useless on a stock kernel.., but I have compiled a few things as a module and used on different (stock) kernels, you also have to make sure the localversion is the same for the module as it is for the kernel, (ie 2.6.35.7-I9000XXJVS-CL565837) you couldnt use a module compiled with JVS version magic on say a JVT kernel..
existz said:
Heres a tun.ko module i compiled against stock samsung source with JVS version magic, the stock samsung kernel actually has TUN support, but just not compiled as a module, its actually compiled in the kernel (atleast from what stock source defconfig shows), so you should be able to just place this module in /system/lib/modules/ and point your app to that location..
Click to expand...
Click to collapse
Yes, strings also mentioned tun:
[~:I9000XXJVS]$ strings kernel | grep tun
/dev/tun 0660 vpn vpn
...
ok, so maybe I already have tun?
Thanks for the replies.
I tried the supplied tun.ko, but I get the error:
> insmod tun.ko
insmod: can't insert 'tun.ko': unknown symbol in module or invalid parameter
According to OpenVPN Settings (https://market.android.com/details?id=de.schaeuffelhut.android.openvpn&hl=en), I have successfully connected to my OpenVPN server.
However: I don't think I'm assigned the IP address I specified in the openvpn server configuration. I actually don't think I'm getting any IP address at all. In fact, I do not even see a tun adapter when I do:
> ifconfig
eth0 Link encap:Ethernet HWaddr B4:07:F9:xx:xx:xx
inet addr:192.168.0.189 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::b607:f9ff:fexx:xxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:60576 errors:0 dropped:0 overruns:0 frame:0
TX packets:39256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:44002869 (41.9 MiB) TX bytes:5117988 (4.8 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:291 errors:0 dropped:0 overruns:0 frame:0
TX packets:291 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16950 (16.5 KiB) TX bytes:16950 (16.5 KiB)
svnet0 Link encap:UNSPEC HWaddr A0-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP POINTOPOINT RUNNING NOARP MTU:65541 Metric:1
RX packets:8855 errors:0 dropped:0 overruns:0 frame:0
TX packets:547 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:142357 (139.0 KiB) TX bytes:13014 (12.7 KiB)
I think eth0 is my wifi, and svnet0 is the 3G connection. Am I right? I can ping my wifi IP, but not the preconfigured openvpn IP.
Now I am confused and uncertain if I have tun already in my kernel (OpenVPN doesn't seem to complain), but I see no tun device in my system, and I have no IP. Am I overlooking something obvious?

[drivers] cifs and tun

They passed the test on my KindleFire.
Let me know if they work fine on your device.
Thanks! I have this working partially. So far I can mount my remote share from ADB. Still trying to get CifsManager to work. I'll post my notes when I have it all figured out.
riverzhou said:
They passed the test on my KindleFire.
Let me know if they work fine on your device.
Click to expand...
Click to collapse
I couldn't get tun.ko to establish a VPN connection, the module loads fine but nothing
How fortunate that this comes up the day I'm looking into OpenVPN for my KF! Could I get a little assistance in setting this up? Would I need to install these drivers before OpenVPN and, if so, how?
damianarnold said:
I couldn't get tun.ko to establish a VPN connection, the module loads fine but nothing
Click to expand...
Click to collapse
Are you using openvpn ?
After the driver insmoded ,you will find a file named tun in /dev/ .
Maybe you need a guild about openvpn on android.
SwingBlade said:
How fortunate that this comes up the day I'm looking into OpenVPN for my KF! Could I get a little assistance in setting this up? Would I need to install these drivers before OpenVPN and, if so, how?
Click to expand...
Click to collapse
I do not use OpenVpn. I have tested the driver by a tool written myself, the tun.ko work fine.
I think you can find a guild about OpenVpn on Android from google.
A difference between android and linux is , the devices file is /dev/tun in Androind and is /dev/net/tun in Linux.
Cifs.ko works great with CifsManager:
http://forum.xda-developers.com/showthread.php?t=1397461
Couldnt get OpenVPN working either, but dont know if its because of the tun.ko
It just goes from auth to 'get config' and doesnt connect. I cant get logcat working on my device for some reason to check the logs.
Tell a lie, gotthe logs, telling me EXITING, auth-failure
Definitely right user/pass
alchemyst said:
Couldnt get OpenVPN working either, but dont know if its because of the tun.ko
It just goes from auth to 'get config' and doesnt connect. I cant get logcat working on my device for some reason to check the logs.
Tell a lie, gotthe logs, telling me EXITING, auth-failure
Definitely right user/pass
Click to expand...
Click to collapse
/data/local/tmp # insmod tun.ko
/data/local/tmp # dmesg |tail -n5
[13042.453582] TIWLAN: 3276.841719: connInfra , CONSOLE:****************************************
[13042.464141] TIWLAN: 3276.852248: ****************************************
[13053.277160] tiwlan0: no IPv6 routers present
[13083.014495] tun: Universal TUN/TAP device driver, 1.6
[13083.019775] tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
/data/local/tmp # ls /dev/tun -l
crw-r----- 1 1016 1016 10, 200 Dec 18 06:16 /dev/tun
/data/local/tmp # ./testtun
tun_name is icevpn. tun_fd is: 3
tun_setip interface icevpn ip 192.168.0.2 netmask 255.255.255.0 MTU 1460 TXQ 1000
TUN_FD 3
tun_read , len is 84
tun_read , len is 84
tun_read , len is 84
tun_read , len is 84
tun_read , len is 84
tun_read , len is 84
After testtun start,in another ssh console:
/data # ifconfig
icevpn Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.0.2 P-t-P:192.168.0.2 Mask:255.255.255.0
UP POINTOPOINT RUNNING MTU:1460 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:13002 errors:0 dropped:0 overruns:0 frame:0
TX packets:13002 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3484632 (3.3 MiB) TX bytes:3484632 (3.3 MiB)
tiwlan0 Link encap:Ethernet HWaddr F0:A2:258A:48
inet addr:192.168.1.108 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::f2a2:25ff:fed8:da48/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28903 errors:0 dropped:0 overruns:0 frame:0
TX packets:27964 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:8814147 (8.4 MiB) TX bytes:1956943 (1.8 MiB)
/data # ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
^C
--- 192.168.0.1 ping statistics ---
8 packets transmitted, 0 packets received, 100% packet loss
/data # ifconfig
icevpn Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.0.2 P-t-P:192.168.0.2 Mask:255.255.255.0
UP POINTOPOINT RUNNING MTU:1460 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:672 (672.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:13002 errors:0 dropped:0 overruns:0 frame:0
TX packets:13002 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3484632 (3.3 MiB) TX bytes:3484632 (3.3 MiB)
tiwlan0 Link encap:Ethernet HWaddr F0:A2:258A:48
inet addr:192.168.1.108 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::f2a2:25ff:fed8:da48/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29136 errors:0 dropped:0 overruns:0 frame:0
TX packets:28105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:8859490 (8.4 MiB) TX bytes:1996726 (1.9 MiB)
So, I think it's the problem of OpenVpn setting.
Update, changed from OpenVPN to one of the others and it works fine, many thanks RiverZhou!
damianarnold said:
Update, changed from OpenVPN to one of the others and it works fine, many thanks RiverZhou!
Click to expand...
Click to collapse
You welcome.
riverzhou said:
You welcome.
Click to expand...
Click to collapse
Can't seem to insmod tun.ko when using non-standard kernels.
damianarnold said:
Can't seem to insmod tun.ko when using non-standard kernels.
Click to expand...
Click to collapse
Yes, The "vermagic" must be full match.
Usually, the different kernel have different vermagic.
Is there other VPN apps that this can be tried with instead of OpenVPN?
alchemyst said:
Is there other VPN apps that this can be tried with instead of OpenVPN?
Click to expand...
Click to collapse
It should work with anything that wants a TUN or TAP device.
FWIW, I can openVPN with it just fine.
I've insmodded tun.ko on my rooted file, but had no luck with the openvpn apps from the market. Could please someone point me to a working one (openvpn or pptp)? Do I need to have busybox installed? (I just have my device rooted)
openvpn definitely needs busybox
uzi74 said:
I've insmodded tun.ko on my rooted file, but had no luck with the openvpn apps from the market. Could please someone point me to a working one (openvpn or pptp)? Do I need to have busybox installed? (I just have my device rooted)
Click to expand...
Click to collapse
You do need busybox. I'm on the CM7 rom as well, which includes both busybox and the openvpn binary. I then use the OpenVPN Settings app from the market to connect to the VPN. Make sure you go into advanced settings and set the path to the tun.ko module and tell it to load it. Or manually load it some other way. The config files I set up a long time ago just using adb shell on my phone and copied them and the keys to the fire's SD card. The tun.ko came from this thread.
If I install CM7 on the Kindle Fire, do I still need these drivers, and do these drivers still work?
Ectoplasmic said:
If I install CM7 on the Kindle Fire, do I still need these drivers, and do these drivers still work?
Click to expand...
Click to collapse
Up to now, You still need these drivers and these drivers still work.
The current CM7 version use origin kernel.

[LG-D722] [jagnm] [lg g3 beat] Wifi mac 00:00:00:00:00:00 FIX

If you upgraded ROM in jagnm probably You have broken WiFi that cant connect to almost any hotspot. Check wifi advanced setting for mac - it's 00:00:00:00:00:00
I tried several ROMs - all except factory ROM had this issue. Going back to stock ROM on that device is bad idea, it's old and packed with bulky apps.
Finally I decided to go with unofficial lineage os 15.1 from here: https://vasy.ru/LineageOS-15/jagnm/
Rooted that with supersu, and started console (you can enable it in developer settings or use "adb shell" command from pc - that is more comfortable to write anything).
in console enter su, then bash, and check interfaces:
Code:
C:\adb>adb shell
* daemon not running; starting now at tcp:5037
* daemon started successfully
jagnm:/ $ su
jagnm:/ # bash
jagnm / # ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
(...)
wlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 Driver bcmsdh_sdmmc
(...)
jagnm / #
in file /data/misc/wifi/config You will find that cur_etheraddr is set to all zeros,
Code:
jagnm / # cat /data/misc/wifi/config
btc_mode=1
mpc=1
roam_off=0
roam_scan_period=10
roam_delta=20
roam_trigger=-80
PM=2
cur_etheraddr=00:00:00:00:00:00
changing that line to anything restores wifi mac address on next interface restart, let's try:
Code:
jagnm / # sed -i "s/00:/11:/g" /data/misc/wifi/config
jagnm / # ifconfig wlan0 down
jagnm / # ifconfig wlan0 up
jagnm / # fconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:90:4c:c5:12:38 Driver bcmsdh_sdmmc
inet addr:192.168.1.251 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::290:4cff:fec5:1238/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:108 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:20601 TX bytes:3720
Any change to that line helps to restore original mac address, You can also delete this file chmod it or directory to something unreadable, but it will be recreated to zeros on each restart and problem will come back. I needed to find a way to fix that permanently, I looked for any startup scripts but it seems that init_d is not working on lineage, I followed that guide to fix that: https://forum.xda-developers.com/lineage/general/how-to-enable-init-d-to-function-t3810355
With init_d there is script here: /etc/init.d/90userinit that looks for userscript here: /data/local/userinit.sh so let's put there same thing as above
Code:
jagnm / # echo 'ifconfig wlan0 down && sed -i "s/00:/11:/g" /data/misc/wifi/config && ifconfig wlan0 up' > /data/local/userinit.sh
jagnm / # chmod +x /data/local/userinit.sh
this will fix wifi mac on each restart. Of course You need to make all those each time You flash new rom, but it's not that frequent on so old phone with almost no updates. Probably I'll never use any sim card here, but wifi is best way to have internet on this device.
I hope that will help, it's old device and probably noone use that as main phone - with working wifi You can still find something to to for this device in home.
please report if this fixed problem on your lg g3s, what is Your ROM or if You have anyt other idea how to fix that config generating all zeros for mac address
Hi there. I know this has been a while since this post, but I have just found my old d722 today and decided to make a small multimedia centrem from it. Wanted to flash latest ROM and ended up with MAC 00... error
your solution here saved me. Thanks a lot
one question, I guess phone must be rooted to be able to run content of userinit.sh properly, right? For some reason I am unable to root my d722 and I think that is why I am not able to repair this MAC error permanently. Changing /data/misc/wifi/config via adb works perfectly but is gone after reboot as expected

Categories

Resources