Tunes and whistles about MIPS64-based LoongSon2F CPUs and hardware

Monday, June 1, 2009

iPod touch (generation 2) and copying files via USB-cable under Linux

Those of you, who do own latest hardware from Apple (iPhone and iPod touch) could notice, that the only way to synchronize, or transfer music is to use iTunes. Which is only provided for Windows and Mac operating systems. This is, no doubt, very uncomfortable, that's why I've made a jail-break in order to install SSH daemon.

The other tricky thing is how to copy files when there's no WiFi spots near you? I would recommend to install iTunnel [1] onto Yeeloong and use scp.

In order to install iTunnel, you'll need to compile libiphone and libplist libraries from sources found at page [2]. 

I've installed libiphone into /usr/local/libiphone-0.9.1 and added the following line into /etc/ld.so.conf.d/libc.conf:

/usr/local/libiphone-0.9.1/lib

Then, it is required to update dynamic libraries' list:

# ldconfig

After that, make sure, that LDFLAGS line in Makefile from itunnel sources looks like that:

LDFLAGS := -L/usr/local/lib -L/usr/local/libiphone-0.9.1/lib -lpthread -lusb -lrt -liphone

$ make 

And here is it, itunnel program which will help you to communicate with iPod touch or iPhone!

Next step, is to setup a connection at a localhost with port number 12022:

loongson@debian:~/src/itunnel/itunnel-0.0.5$ ./itunnel 12022
get_iPhone() success
- successfully got device
server waiting for ssh connection
server accepted connection, clientfd:5
client thread fd(5) running, server port 12022 , peer port 37565
tunnel now running.
SSH to localhost port 12022 to get to iPhone.
 (use ssh -D to create SOCKS tunnel.)
do Ctrl+C to quit the server (can take a few seconds).
client is still waiting for handshake.


You do plug in your iPod, so you can see the following lines:

yes, got syn+ack ; replying with ack.

Voila. You can login now:

loongson@debian:~$ ssh -l mobile 127.0.0.1 -p 12022 -C
mobile@127.0.0.1's password:

localhost:~ mobile$ uname -a
Darwin localhost 9.4.1 Darwin Kernel Version 9.4.1: Mon Dec 8 21:02:57 PST 2008; root:xnu-1228.7.37~4/RELEASE_ARM_S5L8720X iPod2,1 arm N72AP Darwin

localhost:~ mobile$ uptime
 12:40am up 1 day 1:24, 1 user, load average: 0.05, 0.03, 0.03

localhost:~ mobile$ scp anton@192.168.210.1:/home/anton/Music/ZZ-Top/* .
anton@192.168.210.1's password: 
ZZTGH92.part1.rar 100% 77MB 309.0KB/s 04:16  
ZZTGH92.part2.rar 100% 73MB 320.4KB/s 03:54

P.S. Only one simultaneous connection to iPod is currently supported. 

[1] http://www.cs.toronto.edu/~jingsu/itunnel/

[2] http://matt.colyer.name/projects/iphone-linux/index.php?title=Main_Page

No comments:

Post a Comment

Blog Archive