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

178 lines
7.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cross Compile RSync ARM &middot; Mil años de solitario</title>
<meta name="description" content="">
<meta name="generator" content="Hugo 0.16" />
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Cross Compile RSync ARM &middot; Mil años de solitario">
<meta name="twitter:description" content="">
<meta property="og:type" content="article">
<meta property="og:title" content="Cross Compile RSync ARM &middot; Mil años de solitario">
<meta property="og:description" content="">
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Oxygen:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-responsive-min.css">
<link rel="stylesheet" href="https://codersherlock.github.io//css/all.min.css">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="alternate" type="application/rss+xml" title="Mil años de solitario" href="https://codersherlock.github.io//index.xml" />
</head>
<body>
<div id="layout" class="pure-g">
<div class="sidebar pure-u-1 pure-u-md-1-4">
<div class="header">
<hgroup>
<h1 class="brand-title"><a href="https://codersherlock.github.io/">Mil años de solitario</a></h1>
<h2 class="brand-tagline"> A boy who can&#39;t step into academia </h2>
</hgroup>
<nav class="nav">
<ul class="nav-list">
<li class="nav-item">
<a class="pure-button" href="https://github.com/CoderSherlock "><i class="fa fa-github-alt"></i> github</a>
</li>
<li class="nav-item">
<a class="pure-button" href="https://codersherlock.github.io//index.xml"><i class="fa fa-rss"></i> rss</a>
</li>
</ul>
</nav>
</div>
</div>
<div class="content pure-u-1 pure-u-md-3-4">
<div>
<div class="posts">
<h1 class="content-subhead">15 Aug 2016, 15:44</h1>
<section class="post">
<header class="post-header">
<a href="https://codersherlock.github.io/post/Cross-Compile-RSync-ARM/" class="post-title">Cross Compile RSync ARM</a>
<p class="post-meta">
under
<a class="post-category post-category-2016-08" href="https://codersherlock.github.io//categories/2016-08">2016-08</a>
</p>
</header>
<div class="post-share">
<div class="post-share-links">
<h4 style="">Share</h4>
</div>
</div>
<div class="post-description">
<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>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'codersherlockblog';
var disqus_identifier = 'https:\/\/codersherlock.github.io\/post\/Cross-Compile-RSync-ARM\/';
var disqus_title = 'Cross Compile RSync ARM';
var disqus_url = 'https:\/\/codersherlock.github.io\/post\/Cross-Compile-RSync-ARM\/';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</section>
</div>
<div class="footer">
<div class="pure-menu pure-menu-horizontal pure-menu-open">
<ul>
<li>Powered by <a class="hugo" href="https://gohugo.io/" target="_blank">hugo</a></li>
</ul>
</div>
</div>
<script src="https://codersherlock.github.io//js/all.min.js"></script>
</div>
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>