Using haret with local loopback - Windows Mobile Development and Hacking General

Hi everyone,
i'm not sure if this should be posted here or someone did it before.
So please delete this thread if this is a known fact or does not belong here
During experiments with haret on various platforms, i thought about a simple method to get access to the haret console without the need of a host computer.
There's a little trick to make this work:
Every device with some networking features has a loopback IP-address.
The IP of this "network device" is 127.0.0.1 and can be used to access haret console locally, right on your mobile device.
1. Start a version of haret suitable for your mobile device.
2. Tap on the button "Listen for network connection".
3. Start a telnet client on your device (e.g pocketputty).
4. Connect to 127.0.0.1:9999.
That's it!
Works perfect with my hermes and universal, when i'm on the road and need to verify of some internal settings or some register settings
I hope this maybe helpful for anyone.
Cheers,
scholbert

scholbert said:
3. Start a telnet client on your device (e.g pocketputty).
Click to expand...
Click to collapse
you may provide a link to the putty .cab file here

It would be nice to at least tell the ignorant ones wtf is haret...

Hi,
thanks for the remarks!
So here's the pocketputty cab.
Have a look for updates here:
http://www.pocketputty.net/
aiiro said:
It would be nice to at least tell the ignorant ones wtf is haret...
Click to expand...
Click to collapse
O.K. nice entry
HaRET stands for Handheld Reverse Enginering Tool.
Have a look here to get deeply involved:
http://www.handhelds.org/moin/moin.cgi/HaRET
It may be used to debug and do other investigation on settings in the processor's registers, as well as start some binaries other than wince or winmob applications on windows based devices.
One of it's common purpose is to start a linux kernel on your mobile device for the first time (and much more often afterwards ).
At least it's mainly used by linux developers to check out what has to be done and set to make a linux kernel boot on your device!
Best regards,
scholbert

Related

HaRET don't bootup linux :(

Hello ,
I'm a newbie and have used the introductions on http://wiki.xda-developers.com/wiki/HimalayaLinuxBooting to boot linux on my himalaya. Unfortunatily the pops up dialog "Launch a script file. Default ..." when i tap on HaRET-0.3.2d.exe . I can't connect to port 9999, too.
Please Help me
Thanks
Hi snowdrop,
the dialog means that your prepared scriptfile hasn´t been found and executed. This could be because you misspelled the name. Keep in mind that all filenames have a 3-letter extension which is not visible in windows. I.e. if your FileExplorer says "startup.txt" the filename is "startup.txt.txt".
Or maybe you installed the startup script in a different directory than HaRET. IMHO it´s easiest to install all 4 files (haret, startup, kernel, initrd) in a separate dir unter \Storage where you don´t have to reinstall it after a reboot.
Don´t hesitate to ask further if this doesn´t anwer your question.
Matthias
Hallo noone,
thanks for your reply. I copied all neccessary file under "\Storage Card\". The filename is "setup.txt" (the filexplorer says startup without extention but i'm sure it is named startup.txt through my activesync under Windows). All files are under "\Storage Card\", (also the HaRET-0.3.2d.exe and startup.txt files). :roll:
Greets
Hi snowdrop,
I'm not really sure about that. It works for me all the time.
Maybe you can track down the problem with a network connection. You have to disable ActiveSync on your host PC and to start a connection with SynCE. This requires usbserial and ipaq as well as ppp loaded into the kernel. When you cradle the himalaya you should get a message from usbserial about the attached device (usually /dev/ttyUSB0).
After synce-serial-configure (root), dccm (user) and synce-serial-start (root) the Himalaya should display the connection sign in the bottom bar. Be careful: ActiveSync on the Himalaya may or may not try to start a GPRS session. This can become expensive sometimes
After establishing the PPP connection from PC to Himalaya you connect to port 9999 (refer to SynCE's documentation about the IP addresses). Then you can enter the commands of the startup.txt script line by line.
HTH
Matthias
Hello Matthias,
what is SynCE? I'm using Windows as host PC.
Are synce-serial-configure (root), dccm (user) and synce-serial-start Linux Tools??? :?:
Thanks
Ok,
i after some hard work (and hardware reset), i'm now able to see the penguin(with red eyes and red thermometer) . But then nothing will be done
Actually I thought, that there is also a graphical user interface for linux. Now my question:
Do you ONLY remote login into your linux and have JUST a console application? Or have you also GUI applications and a desktop under linux for himalaya at the time.
Thanks for your answers
it will of cause never run any linux applications not compiled for it
like windows CE will not run pc windows applications
if you can find a kernel compiled for it
you can use it otherwise you'll have to compile your own
the same goes for a version of x11 and any other applications you may wish to run
though in the world of linux sourcecode is much easier to come but and compile yourself then they are under windows
Hi,
can you give some usefull links about linux application on PDA?
I want too much to run linux under my himalaya .
havent really messed with it
here is another distro for xda not sure if he ever got finished with it
http://www.pigeond.net/photos/xda-linux/
havent kept up on it really
what you have to look for is pretty much
applications for the arm cpu
and you can also look for linux of ipaq and other pda's which use the arm cpu they would also run on the xda
but i havent really kept up todate about the whole project
so i dont know how long any of the project have gotten
and i dont know how many applications can be portet because of graphical limits in the desktop manager like glib
but i'm sure there must be others in this forum who mess around with these things
Maybe the guys at handhelds.org could give you some more info, got lots of help getting linux running on my ipaq 5550 (never quite got it working to my liking though)

info: WM5torage new version (1.60)

Version 1.6
- Full compliance with USB Mass Storage Bootability Specification. Now booting PC from smartphone as USB stick should always properly work, provided your computer's BIOS is modern enough to properly USB-drive-boot. Checked it via booting FreeDOS and PuppyLinux from my 8310 - seem to work ok.
- Improved general compliance with USB Mass Storage protocol. Still not 100% compliant though, due to the built-in hardware driver limitations & bugs.
- Added command line switches to control utility "remotely", via scripting utils or batch files & shortcuts:
-a Activate mass storage mode
-d Deactivate mass storage mode
-q Quit
Switches can be combined, they will be executed in order. For example, "WM5torage -a -q" will launch utility, activate mass storage mode (if not active already), and quit after activation is completed.
more details see: http://www.modaco.com/WM5torage-t238545.html
Thanks zoki for the info. I use wm5torage alot - great program
For those who don't have a modaco login find attached below.
Thank you, meschle!!!
I really appreciate your help.
Awsome Utility! Thx!
When I run the link that came with this program, it will not let me activate and it says "Status: Can't open card."
My card is working just fine. What is the problem?
BTW, I have a Cingular 8125 running the origonal ROM.
isnt there a wm5 storage that is 1.7 thats what mine says. unless im worng. wait....no im right it says 1.7 here it is.
Latest version of the excellent Wm5torage 1.72 device to usb stick convertor - i have modified installer so that its suitable for PPC installation rather than smartphone.
mods are:
1. No setup.dll so no request to restart device (not required anyhow)
2. Installs shortcut to start menu\program files rather than start menu\accessories (thats a smartphone directory)
3. Installs straight to \program files\wm5torage rather than having a destination dialog.
excellent. does exactly as you say it should.
This program is one of those must haves. The USB-like storage was want enough, but with the boot facility it is godlike. As long as I have my cable with me I can boot to my puppylinux install wherever I am without the need to carry an extra USB key around.
Gotta love getting updates to EXCELLANT apps.
I agree, this is one of those absolutely-why-didn't-microsoft-include-this-awesome apps.
sry this may b a stupid question but what does he mean by full application unlock? does he mean the prog or the ppc?
This is some wicked software, now if I go anywhere who hasn't got activesync I can use my Vario as a USB stick!!!
Thanks Guys.
Very, very nice..
Want to make something cooler? Make a program that uses the devices camera through the USB to make it a sort of web cam....
dewild1 said:
Very, very nice..
Want to make something cooler? Make a program that uses the devices camera through the USB to make it a sort of web cam....
Click to expand...
Click to collapse
That has already been made
http://forum.xda-developers.com/search.php
GldRush98 said:
dewild1 said:
Very, very nice..
Want to make something cooler? Make a program that uses the devices camera through the USB to make it a sort of web cam....
Click to expand...
Click to collapse
That has already been made
http://forum.xda-developers.com/search.php
Click to expand...
Click to collapse
yep coolcamera its a good program
meschle said:
Latest version of the excellent Wm5torage 1.72 device to usb stick convertor - i have modified installer so that its suitable for PPC installation rather than smartphone.
mods are:
1. No setup.dll so no request to restart device (not required anyhow)
2. Installs shortcut to start menu\program files rather than start menu\accessories (thats a smartphone directory)
3. Installs straight to \program files\wm5torage rather than having a destination dialog.
Click to expand...
Click to collapse
Gave me some problems this version. Slow down my system like hell. InClose stopped working. Had to soft reset and then I unistalled it. Ver 1.3 worked fine, even with the extra accessory folder. Any information where I could find it? Thanks.
1.73 is out
Incompatibilities with some devices(started in 1.6x) should be fixed at this release.
what is it
sorry for the uneducated question: what doed this program do?
Read the first post in this thread...
I cant download it from modaco, it says file is reported as broken. Any chance somebody can attach 1.73 here? thanks

Prophet similar to HTC Wizard - Help porting Linux to them!

Hello there,
as many of you may already know, the HTC Prophet shares a lot of its hardware with the HTC Wizard. We, the Linwizard Project, aim to port Linux to this OMAP-platform, as other users did port Linux for PXA-based devices like HTC Universal...etc.
I just want to invite you Prophet Users to checkout our project. Our procedure and yet available kernel should also run on your phone....
http://linwizard.sourceforge.net
Greetings,
Maui
Hi, I want to install Linux on my new Qtek s200, but I don't know how to do that. What is the project's actual status? I hate WM5
Is there any updates to this as yet? I would really love to see this ported/Running to my HTC prophet
Running it now
Yes, there has been some progress... the basic PDA functions are available: X runs, touchscreen works making it possible to run GPE on it:
Here's a link to a recent build which works reasonably well. It contains the f*ugly GPE shell so it is not pretty to look at, but it does work.
http://tinderbox.dev.gentoo.org/embedded/linwizard/gizard-20081108.tar.bz2
To try this for yourself, download the image, unpack the tarball and copy the entire contents to a directory on your SD-card. Go into that directory and run haret-0.5.2.exe. Run the 'default.txt' configuration.
Once the kernel boots it will start a telnet daemon on 10.100.0.1:23. Configure your side of the rndis network to be 10.100.0.2 (ifconfig usb0 10.100.0.2 on Linux, whatever on Windows) and telnet 10.100.0.1. Login as root, there is no password. Once logged in run startx to get GPE up and running.
Once GPE runs you'll want to add the onscreen keyboard to the panel. To do this tap-and-hold on the taskbar (bottom of screen) and add the 'input selector'. This gives you an on-screen keyboard just like the WM-one. Add a terminal launcher as well to get access to an xterm.
If all this is gibberish to you you might want to learn some unix/linux before you try...
Thanks alot it works on my prophet it's very fast to but am unable to login as root is there a way I can login to linux without using typing root? if not can u help me with the telneting into it please what software do I have to use on my pc it's a Windows is there anysite with instructions? I like it alot but since the prophet dont got a keyboard on it's own am not able to login please help and Thanks in Advance
Booting and running Linux on the Prophet
Most of what you need to boot and run Linux is described on the linwizard project site:
http://linwizard.wiki.sourceforge.net/
The version offered on the site is out of date - it does not do much more than boot the kernel which you can control through SSH (on 10.100.0.1:22).
To do some more with Linux you'll want to get a newer release. The one mentioned in the previous posting is a good example of where the project is now: relatively complete PDA-support but no real GSM support - so you can not use it as a phone...
To see Linux in action you download the tarball, untar it on your SD-card (either in a card reader on your PC or by untarring it on the PC and transferring all files to a directory below /Storage Card/. Once that is done you are well advised to do a soft reset to clear some memory as haret - the program used to push Windows Mobile out of the way and replace it with Linux - likes memory. After the (optional but advisable) soft reset you take your $favourite_file_manager to the directory where you put the contents of the tarball, execute haret-0.5.2.exe and run the default configuration (just click Run). Linux should boot, albeit slowly (it takes a long time to read the initrd - initial ramdisk - from the SD card). If you get a white screen which stays white for a long time you might as well reboot and try again. If you get a screen with a penguin with a hat on you're in. Plug in the USB cable if you haven't done that yet. You'll be staring at a login: prompt with no obvious means to type anything anywhere... that is because this Linux distribution is made for the Wizard instead of the Prophet, and the Wizard *does* have a keyboard. For now you'll have to resort to telnet to login and get things going. The phone is now listening on the cdc_ethernet interface (over the USB connection) on IP 10.100.0.1 so you'll want to configure the PC-side of the connection to something within that network range - 10.100.0.2 seems a logical choice. Configure the PC-side of the connection with IP 10.100.0.2 (ifconfig usb0 10.100.0.2 up on Linux, many many mouseclicks in the network manager on Windows). Once you have the network configured you can login with *telnet* (NOT ssh as mentioned on the linwizard site, the gizard tarball only has an active telnet daemon!), username is root, there is no password.
Once logged in use 'startx' to get the GPE shell running. It will complain about not being able to find a keyboard. The 'X' cursor appears, follwed shortly by the butt-ugly GPE interface. Once in the shell you can add a keyboard to the taskbar (tap-and-hold, choose add->input manager). There's more stuff to add, like a terminal (always handy) etc. Wifi does not work yet, GSM does not work yet, you just got yourself an iPaq...
If you're looking for eye-candy this is not it - yet. But as it is Linux, and free, and open, it can become anything you want it to...r
Am still getting error when trying to connect to my prophet useing usb is there anyway anything I need windows cant find the drivers is there a site I can download one from that supports my HTC prophet? And I tryed to connect to it but no luck I change my ip address to 10.0.0.2 255.0.0.0 and tryed to telnet to 10.0.0.1 but nothing, is there anyway to ping the device to see if it's up and running am upset, you sure there is no way to use it without having to login as root? This is giving me stress but al keep trying but am sure am missing somthing but what is it do you know? BTW I used the Drivers from http://forum.xda-developers.com/showthread.php?t=385129&highlight=linwizard&page=4
hope thats works for the prophet if not can you please help me find a driver for my prophet thanks again and good work
Sorry I got it to work I made a mistake its ip address 10.100.0.2 255.255.0.0 telnet 10.100.0.1 it works I even uploaded some pictures of it enjoy
I used a Nokia 3595 to take the pictures
just more pictures
Just a more pictures I love it I wish we can use it as a phone
They were taken with the Iphone
if Linux works on the HTC prophet then the Google operating system andriod must work to right? If so any information about it being ported to run on our phones?
hi all, i'm trying to make linux booting, but as just i start the haret and press run to execute the default.txt, it tell me :
kernel syncing panic.... and reboot after 30 seconds
any suggestion? i'm using vista 64bit and a qtek s200 wm6.1
Well am not to sure about this but al try to help Now tell me first did the linux boot on your ppc? to the screen were its asking for username? if so its ok if Not and it resets your mobile then something is wrong tell me what does it say and to tell net to it first you need the drivers did you get it? if not al post a link to download it ok I never had that problem before try running it on your SD card did you download all the files needed? I just updated my prophet rom so al try it my self it could be a firmware problem al try my best to help you ok
umh i havent installed any driver on my pc...... on the profhet, all i do was extracting files and run harted 0.5.2 .... and then press run. shell start, but then i got this error, i think it's more a pc-phone related problem..... i'll try do some other test
PS: telnet or ssh doesnt work
when i had BA phone, i was able to install linux on it, but i had just to start harted and all was working then.
Well it could be a ROM issue try to close unused programs it might help were is the files located? in the main memory or storage card? Anyway keep trying I don't understand much the drivers I posted a link for it already read my older replys ok And try a different ROM becouse am not getting this problem on mines
is it already found how to call with linux?
that is fantastic, I will refresh my Xda neo
Hi everyone!!
I'm trying to boot linux on my device, but when I type "startx" it not start the GUI..
Which version did you try??
To boot linux, I always need a pc to do the login??
Hi, i have one prophet and yesterday runned one old version of android (0.8 think), i follow one tutorial of this forum(think, i visited a lot of web for this...) plus to it one haret(0.5.0 i think because download a lot of haret) and android runned in my prophet..but it were very very very slow and i'dont like it...
How can i put GPE in my prophet?
can i make it with linwizad 0.2.0?are all necesary files into?
is need one pc with linux for start it(i don't have it, any solution)?
Thanks
PS Sorry about my bad english
I found this in the web:
http://usblinux.org.ru/archives/category/setup/from_windows
http://anterior-linuxlive.blogspot.com/200...fiish-m700.html
http://4pda.ru/forum/index.php?showtopic=89832&hl=linux
Can it help us?
I would like run linux in my prophet..but i never use Linux...
Is possible OPIE in prophet?
Also this:
http://4pda.ru/forum/index.php?showtopic=55392&hl=linux
Is interesting post #10 OpenMoko s100...not?

TYTN and LINUX Challenges

I am fighting with these challenges, i am near to the final positive result,but still have problems...
I hope you can help me.
1) connect to internet via DUN
2) Connect to internet via PAN
3) Connect to internet via USB modem
4) Connect to internet via USB Internet sharing
5) Browsing and synchronizing the device
These are the little result so far :
1) Installed this cab :
http://forum.xda-developers.com/showpost.php?p=1351044&postcount=21 (thanx to the Author) and DUN is again available.
IT works without problems with Winzoz, but i am not succeeding with Linux.
I made the usual steps (like this post explain, i.e. : http://klamstwo.org/evad/archives/20 ) linux finds the modem but cannot make it call... (init strings for the modem perhaps?)
What the init string for the TyTN modem?
Any Hints?
( an A1000 works perfect via DUN and the same stick)
2) I followed this guide (thanks to the author) http://www.klamstwo.org/evad/archives/40
And the whole thing works (bnet is connected with IP address 192.168.0.187 and has gateway 192.168.0.1 ) except the fact that i cannot browse internet pages.
Could it be a DNS problem?
I'll try manual configuration and let you know.
3) I tried the connection using the ttyUSB0, modem is ready but does not initialize... HINTS ?
4) SYNCE or something easier?
5) I think Synce is the answer, but at the moment it does not work in my distribution (mandriva). A lot of problems during installation (RPMs and source compiled, non difference). I'll try again. I've followed the How to published around here, (http://forum.xda-developers.com/showpost.php?p=1550906&postcount=4) but i have problems with odccm... it does not install.
other ideas?
I hope this post could become a sort of "mini how to", combining different issues related to the same argument : TYTN and LINUX
Thanx in advance to everyone who will help.
Are these challenges so HARD?
No one here around uses linux and TYTN?
Let's try solving one by one,
let's start with USB.
I tried this one
http://www.mobile-stream.com/usbmodem_wm.html
with windoz it is immediately recognized as a usb mmodem, but with linux the ppp scripts waits for "OK" till timeout.
I also tried the old wirelessmodem, the one for WM5, posted here
http://forum.xda-developers.com/showthread.php?t=306041 ,
but it does not show the kind of connection in the box (it is blank).
I tried to start it even if the box is blank, Windows recognizes it as a serial device, linux gets a lot of "OK" (KPPP) and Tytn shows the message "Please end data call first!"
I also tried this:
http://www.myehud.com/xv6600/usbmodem.html
But when i hit start It says "Not registered to the network!".
This is about Linux and USB moden... perhaps someone of you has succedeed?
Please report.
The other issue would be having internet sharing working with linux and usb ...
So linux users, let's try...
i'm a ubuntu user, and i feel you.. i don't want to run virtual box, so i just deal with no direct pda syncing.
i tried synce, and failed twice, months apart. (probably my fault somehow)
i do however have to use windows at work, so i end up doing most of my flashing and such there.
though, if you find a good NATIVE solution, let me know!
I am using Kubuntu, and can browse the My Documents folder of my PDA, so at least everything is talking to each other. However, I have not got round to configuring the synchronisation side of things; hopefully it should be possible.
Neil,
did you install synceor is somethingnative in your distribution?
Ahd what about the point 1 to 4?
Whether as internet sharing or modem, usb o BT, are you using the Tytn to connect thelinux box to the net?
I am really coing mad, i feel i am so near but i still cannot...
I don't understant why the Pand does not work for example, bnet has the right IP, has it's gatewaqy but still i cannot browse the net...
devilman - no, it was not native; I think it was SynCE, although, I can't be sure. It took some tinkering to get it going, but, now the device is immediately recognised when it is plugged in (USB) and ActiveSync is run.
To get the next stage working, I need to override the choice of library, as it continually tries to use an old version (libsync, I think), even though a new one is installed.
I have not tried 1-4, and, would not be sure how to do them, other than just trying to mount the device as a modem, and then using *99# as the number. In terms of init strings, these vary slightly by service- for example, for Vodafone UK, it is:
Code:
z+cgdcont=1,”IP”,”internet”
(The "z" at front is the AT command for modem reset; it might or might be necessary, but, sometimes helps the connection to work.)
well, I tried, as said in the first post,to use tytn asmodem.
To have it working with BT you have to install the hack in order to have DUn again.
To have it recognizedas a modem you have to put in in in the "modem" status (again, in WM6 wireless modem is not available,so you have to use the old one or the third party product).
In both case the lnux box connects with modem but i son't succeed in having it call the number...
I used the "usual" AT commands, like the "z" and the cgdcount...
Ideas?
I saw you'd got as far as having the device recognised as a modem, but didn't know quite how far you'd got. However, my Linux skills are so poor, I honestly wouldn't know where to go if the standard init. script did not work.
If terms of calling a number, would that not be *99# though?
Please, has noone found out how to have it working?
I am going mad about this.
I need a way to connect my linux box via tytn, usb or bt...
Any hint?
Uhm, for the last one (browsing the pocket pc) I use wm5torage. That turns your pocket pc into a USB disk and Ubuntu easily recognizes that as a removable drive. It is not the perfect solution but it is easy, fast and works.
and...i have another question
can anyone install an embedded-linux on Tytn, i mean use dual-system ?
is it possible?
ss1271 said:
and...i have another question
can anyone install an embedded-linux on Tytn, i mean use dual-system ?
is it possible?
Click to expand...
Click to collapse
there is another 3d all for this issue.
devilman said:
Please, has noone found out how to have it working?
Click to expand...
Click to collapse
I'm on Ubuntu 7.10 and running the official T-Mobile Austria WM6 upgrade on my Vario 2, Bluetooth PAN works flawlessly:
Code:
sudo pand --connect XX:XX:XX:XX:XX:XX
sudo dhclient bnep0
Back in WM5 days Bluetooth DUN worked as well, using the following chatscript in /etc/chatscripts/provider which I created with pppconfig:
Code:
# This chatfile was generated by pppconfig 2.3.17.
# Please do not delete any of the comments. Pppconfig needs them.
#
# ispauth chat
# abortstring
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
'' ATZ+cgdcont=1,"IP","gprsinternet"
# ispnumber
OK-AT-OK ATDT*99#
# ispconnect
CONNECT ''
# prelogin
# ispname
#ogin: replace_with_name
# isppassword
#ssword: \qreplace_with_password
# postlogin
'' \d\c
# end of pppconfig stuff
and the corresponding /etc/ppp/peers/provider:
Code:
hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
debug
/dev/rfcomm0
115200
defaultroute
noipdefault
remotename provider
ipparam provider
usepeerdns
of course, for this solution to work you would have to set up the rfcomm port for your tytn in /etc/bluetooth/rfcomm.conf
Code:
rfcomm0 {
bind yes;
device XX:XX:XX:XX:XX:XX;
channel 4;
comment "T-Mobile Vario II Bluetooth Dial-Up";
}
you should now be able to connect using the "pon" command.
I hope this post is of some help to you... good luck!
http://forum.xda-developers.com/showthread.php?t=344396
ya, too bad ;(
i still can`t use calendar or contact sync functions.
greets, Nik
devilman said:
4) Connect to internet via USB Internet sharing
4) SYNCE or something easier?
I hope this post could become a sort of "mini how to", combining different issues related to the same argument : TYTN and LINUX
Thanx in advance to everyone who will help.
Click to expand...
Click to collapse
Depending on your kernel version (I think this applies to 2.6.21 and greater, but check other docs to be sure), there is a kernel module known as usb-rnds-lite. Get it (links from synce wikis), make it, use it, love it.
I have used it to ICS several devices, 8525, 8925, BlackJack I and II... only quirk is that is works best to start ICS _then_ connect the USB cable.
I suggest you to read this article:
http://ubuntu-utah.ubuntuforums.org/showthread.php?t=598890
You can also search by Google: "bnep0 pand pda linux"

[SOLVED] openvpn on DHD? tun.ko?

Has anyone managed to get openvpn going? compiling custom tun.ko file for DHD?
It's probably possible, now that we have the source. Don't have a DHD just yet, so can't try
Sent from my HDfied HTC Desire
Thread moved to General.
hello
i'm interesting too for the kernel mod tun.ko for the DHD
any reponse ?
Hello,
i'm very interesting in this file too...
My NAS awaits the phone "call".
Hey everyone. First time poster, so hoping its a happy reply
Has anyone had any luck with this ? i also require the tun.ko file for DHD. been searching the net for hours
looking forward to your replies.
I heard that tun.ko file has to be specifically compiled for each kernel version. Is that right?
Is it also linked to the radio version?
If we could have a link for kernel source, i might be able to follow tutorial and publish it here.
I have 2.6.32.21 -g66cfb7a kernel version and you? (not sure if the second part is part of the kernel version)
Lionel
Attached is tun.ko for the Desire HD (for kernel 2.6.32.21-gf3f553d). Built it today & it seems to insert OK and work fine with VPN Connections.
thedji said:
Attached is tun.ko for the Desire HD (for kernel 2.6.32.21-gf3f553d). Built it today & it seems to insert OK and work fine with VPN Connections.
Click to expand...
Click to collapse
Perfect! Thanks!!
Very thanks for the module.
DHD - tun.ko for 2.6.32.21-g66cfb7a
EFCAugure said:
I heard that tun.ko file has to be specifically compiled for each kernel version. Is that right?
Click to expand...
Click to collapse
Yes. After trying other people's tun.ko modules, it wasn't until I checked the output of dmesg that I learnt this (got my first Android 3 weeks ago - so I'm still a n00b).
EFCAugure said:
If we could have a link for kernel source, i might be able to follow tutorial and publish it here. I have 2.6.32.21 -g66cfb7a kernel version and you? (not sure if the second part is part of the kernel version)
Click to expand...
Click to collapse
Lionel, it would appear that my Desire HD has the same kernel.
2.6.32.21-g66cfb7a
2.6.32 is the base kernel version
I assume 21 is the revision or build number.
The hex string on the end seems to vary by which ROM you have installed. This was what was stopping me from loading these other tun.ko modules - including the one posted by @thedji
I've just compiled the tun.ko module for 2.6.32.21-g66cfb7a (on a headless Pentium 2 400 MHz lol). It loads fine and can be seen in the output of lsmod. I've attached it below.
Edit: I was able to use this module successfully to connect to a Cisco VPN with vpnc.
Mike
@MikeMelbourne
Can you explain to me how and with what Software you connected to a Cisco VPN?
C.K. said:
Can you explain to me how and with what Software you connected to a Cisco VPN?
Click to expand...
Click to collapse
First - applications.
1) You're going to need a terminal/console app. I used one called Terminal Emulator.
2) You're going to want an app called "VPN Connections". I downloaded a patched APK in post #4 here:
hxxp://code.google.com/p/get-a-robot-vpnc/issues/detail?id=122&q=patch
Alternatively, you might get it from here: hxxp://code.google.com/p/get-a-robot-vpnc/downloads/list (although YMMV).
Second - setup.
1) You're phone needs to be rooted.
2) You need to have the appropriate tun.ko module (for your phone's kernel) loaded. Load up the Terminal Emulator then:
a) Type 'su' without quotes and hit enter.
b) Type 'insmod /path/to/tun.ko' without quotes and press enter. If your tun.ko is on your sdcard in the root, the path would be /mnt/sdcard/tun.ko
c) If the step above worked, you should be able to type 'lsmod' and see the tun module loaded.
Note: I didn't have any luck running the "VPN Connections" app directly - the connection kept failing (possible due to the configuration of the VPN I was connecting to). So I start it from the command line. You might want to try using the GUI first as it would make things so much easier if it works.
Third - connecting to the VPN by a command line.
1) The command to enter is quite long (and I got sick of typing it), so I put it into a file called 2.sh in the root of the sdcard.
2) Inside the file /mnt/sdcard/2.sh, I entered the following:
Code:
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach --natt-mode cisco-udp --debug 1 --gateway AAA.BBB.CCC.DDD --id groupid --username mike --enable-1des
Note that the gateway is the IP address of the VPN you are connecting to. The username for me is just my username - it isn't prefixed by my company's active directory domain.
3) Open the Terminal Emulator.
4) Enter 'su' without quotes and press enter.
5) Enter 'sh /mnt/sdcard/2.sh' without quotes and press enter.
6) You will be asked to provide the group password, then the personal password for your username. Then it should attempt to connect.
You can change the debug value to 2 or 99 if you want to get more information (if it doesn't connect successfully).
If you want to know what command line options are available, enter the following at the Terminal Emulator:
Code:
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --long-help
I think that's it - I hope this helps. After disconnecting I tend to do a long reboot (takes 1-2 minutes) to get the network back to the way it was; although I'm not sure this is necessary.
Mike
Edit: seems like you need to create a directory and a symbolic link. This is my working script:
Code:
mkdir /dev/net
insmod /mnt/sdcard/download/tun.ko
lsmod
ln -s /dev/tun /dev/net/tun
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach --natt-mode cisco-udp --debug 1 --gateway AAA.BBB.CCC.DDD --id groupid --username mike --enable-1des
Damn I hoped it woulld be easier. As I have never worked with Android that sounds like a challenge to me. So there is no easy switching on and off of the VPN connection? I always have to use the scripts?
C.K. said:
Damn I hoped it woulld be easier. As I have never worked with Android that sounds like a challenge to me. So there is no easy switching on and off of the VPN connection? I always have to use the scripts?
Click to expand...
Click to collapse
Because the "VPN Connections" GUI app didn't connect for me, I had to resort to the script - you may not need to (depending upon the configuration of your Cisco VPN box).
I just need to run the final script (the 5 liner above) to connect to the VPN - good enough for the time being. You just need to modify the path to tun.ko, set your gateway server, groupid & username.
I hadn't worked with Android before the weekend just past - I've just rooted my first Android phone. It's all a learning experience - I guess it depends how badly you want VPN access? Hopefully it will get easier in time as the apps improve.
Good luck!
Mike
You can use something GScript to make it a two-click process (open app, click script). It's just as efficient as using VPN Connections (open app, click connect).
For me personally, I use VPN Connections to connect (successfully) but the traffic is routed down the wrong interface (i.e. not tun0).
After connecting I have to run
Code:
ip ru del table wifi
or
Code:
ip ru del table gprs
to fix the issue.
You should definitely try VPN Connections first. If that doesn't work, try the long method above.
thedji said:
You can use something GScript to make it a two-click process (open app, click script). It's just as efficient as using VPN Connections (open app, click connect).
Click to expand...
Click to collapse
GScript is a great idea - it will save me doing any typing to connect to the VPN.
Once I added these VPNC flags (--natt-mode cisco-udp --enable-1des) to "VPN Connections" I was able to successfully connect after running the script in GScript.
It doesn't say I'm connected, however my IP address has been assigned and I can Remote Desktop to my work PC. My routing already seems to be ok, so I don't to run the 'ip ru del' commands that you do.
I'm pretty satisfied with this now... no typing - just point and press.
-Mike-
What about tap.ko? (needed for OpenVPN bridge mode)
Exposure said:
What about tap.ko? (needed for OpenVPN bridge mode)
Click to expand...
Click to collapse
What kernel version are you running? If you have '2.6.32.21-g66cfb7a' I could compile tap.ko for you?

Categories

Resources