Files
CoderSherlock.github.io/post/Cross-Compile-RSync-ARM/index.html
T
2016-08-16 14:16:23 -04:00

183 lines
5.3 KiB
HTML

<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Cross Compile RSync ARM - Mil años de solitario</title>
<meta name="author" content="map[name:CoderSherlock email:haopengzhan@gmail.com]">
<meta name="description" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="https://codersherlock.github.io/post/Cross-Compile-RSync-ARM/">
<link href="https://codersherlock.github.io//favicon.png" rel="shortcut icon">
<link href="https://codersherlock.github.io//css/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="https://codersherlock.github.io//css/font-awesome.min.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Nunito:400,300,700' rel='stylesheet' type='text/css'>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<div class="container">
<div class="left-col">
<div class="intrude-less">
<header id="header" class="inner"><div class="profilepic">
<script src="https://codersherlock.github.io//js/md5.js"></script>
<script type="text/javascript">
$(function(){
$('.profilepic').append("<img src='http://www.gravatar.com/avatar/" + MD5('haopengzhan@gmail.com') + "?s=160' alt='Profile Picture' style='width: 160px;' />");
});
</script>
</div>
<nav id="main-nav"><ul class="main">
<li><a href="/">Blog</a></li>
<li><a href="http://about.me/shashankmehta">About</a></li>
<li><a href="/post/">Archives</a></li>
</ul>
<section class="aboutme">
<p>
A boy who can&#39;t step into academia
</p>
</section>
</nav>
<nav id="sub-nav">
<div class="social">
<a class="email" href='mailto:haopengzhan@gmail.com' title="Email">Email</a>
</div>
</nav>
</header>
</div>
</div>
<div class="mid-col">
<div class="mid-col-container">
<div id="content" class="inner">
<div itemscope itemtype="http://schema.org/Blog">
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<h1 class="title" itemprop="name">Cross Compile RSync ARM</h1>
<div class="entry-content" itemprop="articleBody">
<h1 id="cross-compile-rsync-to-arm-platform">Cross Compile Rsync to ARM platform</h1>
<p>As always, feel free to ask. // Sherlock</p>
<h2 id="motivation">Motivation</h2>
<p>I got some issues about compile seafile to android, so instead of doing so, I start to figure out some other synchronize workflow. <a href="https://rsync.samba.org/">Rsync</a> is one of the most mature synchronization solution. So I made the decision on planting rsync to android.</p>
<h2 id="pre-work">Pre-work</h2>
<p>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 <a href="https://codersherlock.github.io/post/Cross-Compile-Seafile-2-ARM/">previews blog</a>, 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 <a href="https://play.google.com/store/apps/details?id=berserker.android.apps.sshdroid&amp;hl=en">SSHDroid</a> from Google Play Store.</p>
<h2 id="cross-compile-rsync">Cross-Compile Rsync</h2>
<p>Running following script to build rsync. It will generate a executable file named rsync in the root directory.</p>
<pre><code>$ ./configure --build=${BUILD_SYS} --host=${TOOLCHAIN}
$ make
</code></pre>
<h2 id="push-rsync-to-android">Push RSync to Android.</h2>
<p>After installing SSHDroid, we can now push our arm-version-rsync to target machine.</p>
<pre><code>$ adb push rsync /data/local/tmp
$ adb shell
$ cd /data/data/berserker.android.apps.sshdroid/dropbear
$ mv ../../../local/tmp/rsync .
</code></pre>
<h2 id="run-rsync-with-argument">Run Rsync with argument</h2>
<p>Now we can easily use rsync in android shell. Similar to what we use on PC.</p>
<pre><code>$ ./rsync -e &quot;./ssh&quot; {target-data} {target-location}:{target-directory}
</code></pre>
<h2 id="references">References</h2>
<p><a href="http://stackoverflow.com/questions/8130889/build-rsync-for-android">Build Rsync for Android</a></p>
</div></article>
<div class="share">
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size=''></a>
</div>
<script type="text/javascript" src='http://s7.addthis.com/js/250/addthis_widget.js#pubid='></script>
</div>
</div>
</div>
</div>
<footer id="footer" class="inner">Copyright &copy; 2016
CoderSherlock
Design credit: <a href="http://shashankmehta.in/archive/2012/greyshade.html">Shashank Mehta</a>
<script src="https://codersherlock.github.io//js/slash.js"></script>
<script src="https://codersherlock.github.io//js/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
(function($){
$('.fancybox').fancybox();
})(jQuery);
</script></footer>
</div>
</div>
</body>
</html>