Cross Compile Rsync to ARM platform
As always, feel free to ask. // Sherlock
Motivation
I got some issues about compile seafile to android, so instead of doing so, I start to figure out some other synchronize workflow. Rsync is one of the most mature synchronization solution. So I made the decision on planting rsync to android.
Pre-work
Rsync is a sync program with delta sync feature and based on SSH connection. So all we need to do is SSH support and cross compile tool-chain. Similar to what I mentioned in previews blog, Android NDK and environment export need to be done before compilation. To enable normally use of compiled program, we need to make android support SSH. My solution is just install SSHDroid from Google Play Store.
Cross-Compile Rsync
Running following script to build rsync. It will generate a executable file named rsync in the root directory.
$ ./configure --build=${BUILD_SYS} --host=${TOOLCHAIN}
$ make
Push RSync to Android.
After installing SSHDroid, we can now push our arm-version-rsync to target machine.
$ adb push rsync /data/local/tmp
$ adb shell
$ cd /data/data/berserker.android.apps.sshdroid/dropbear
$ mv ../../../local/tmp/rsync .
Run Rsync with argument
Now we can easily use rsync in android shell. Similar to what we use on PC.
$ ./rsync -e "./ssh" {target-data} {target-location}:{target-directory}