<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Exotic destinations</title><link>http://lab.objoo.org/</link><description>from a technophile point of view.</description><atom:link href="http://lab.objoo.org/feeds/technical.rss.xml" rel="self"></atom:link><lastBuildDate>Thu, 27 Aug 2015 11:05:00 +0200</lastBuildDate><item><title>Banana pi custom Kernel (Part II, cross compiling)</title><link>http://lab.objoo.org/Banana%20pi%20II.html</link><description>&lt;p&gt;I'm back ! Long time ago (March 2015) &lt;a class="reference external" href="http://lab.objoo.org/Banana pi.html"&gt;in banana pi custom kernel part I, I promised a follow-up&lt;/a&gt; to explain how to cleanly compile a kernel for such beasts. This part was delayed, but here it is at last ! So this article is the follow-up of previous article.&lt;/p&gt;
&lt;p&gt;I maintain .config for my bestiary of exotic computers : ARM computers (Bananapi, Odroid, Raspberry pi, Dockstar), MIPS (nexx WT3020), Risc-V (qemu and spikes for the moment).&lt;/p&gt;
&lt;p&gt;These .config are available on github : &lt;a class="reference external" href="https://github.com/objoo/custom-linux-kernels"&gt;https://github.com/objoo/custom-linux-kernels&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;More on that later, for the moment, let's focus on bananapi.&lt;/p&gt;
&lt;p&gt;Please note that this particular .config is based on vanilla kernel 4.1 and targeted for particular small server duties (samba, lxc, XFS and ceph/kRBD support). I personally use this for an ARM ceph cluster.&lt;/p&gt;
&lt;div class="figure align-right"&gt;
&lt;a class="reference external image-reference" href="../images/img_2455.jpg"&gt;&lt;img alt="" src="../images/img_2455.jpg" style="width: 400px;" /&gt;&lt;/a&gt;
&lt;p class="caption"&gt;Nice professional looking ceph cluster, ehhh ?&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Please note, there is &lt;strong&gt;NO&lt;/strong&gt; video code on this kernel. &lt;strong&gt;Don't&lt;/strong&gt; use it if you need a graphical environment.&lt;/p&gt;
&lt;p&gt;Allwinner A20 chip powering bananapi is a quite capable processor and &lt;strong&gt;is&lt;/strong&gt; able to compile a kernel, but it may take ages. A faster way is to use a more powerful machine, for example a X86 based PC, and use it to generate programs targeted for ARM. That's cross compilation.&lt;/p&gt;
&lt;p&gt;Cross compilation is fast, but it's a complex and sometimes tricky process which requires the installation of lots of specific packages (when they're already available on the distribution and specific recompilations when they're not). A clean way to do this and not mess with the installed system is to use docker containers specially for this.&lt;/p&gt;
&lt;p&gt;on the same github repository, there are scripts and Dockerfile to build all necessary parts.&lt;/p&gt;
&lt;p&gt;On the building computer, git and docker need to be installed. Choose a clean directory, and check there is enough place for docker. Then :&lt;/p&gt;
&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;1
2
3&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="go"&gt;git clone git://github.com/objoo/custom-Linux-kernels&lt;/span&gt;
&lt;span class="go"&gt;cd custom-Linux-kernels/docker/DockerFiles/X86-64/cross/Debian&lt;/span&gt;
&lt;span class="go"&gt;./build.sh&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;This will take lot of time for the first build, because this script creates a Debian Jessie docker image, with all cross-compile tools. When this image is run, it fetch uboot and Linux git repositories and compiles all with a pre-defined .config. uboot and linux kernel sources are installed on a persistant storage on the host computer, so next runs are far more speedier.&lt;/p&gt;
&lt;p&gt;Upon termination of all these processes, you'll find the resulting files in :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="go"&gt;../build/RESULT&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;uboot install is &lt;strong&gt;optional&lt;/strong&gt;, it only need to be installed if the current version sd-card is too ancient.&lt;/p&gt;
&lt;p&gt;Installation of uboot is :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="go"&gt;dd if=u-boot-sunxi-with-spl.bin of of=DEVICE_OF_THE_SDCARD bs=1024 seek=8&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, install the modules from / (they go to /lib/modules) and install uImage , sun7i-a20-bananapi.dtb in /boot and you're done. No need to build an Initrd.&lt;/p&gt;
&lt;p&gt;If all goes well you'll see :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="gp"&gt;root@banana-one:~#&lt;/span&gt; uname -a
&lt;span class="go"&gt;Linux banana-one 4.1.6YDoSHM #2 SMP Wed Aug 26 23:24:00 UTC 2015 armv7l GNU/Linux&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Have a nice hack !&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Yann Dupont</dc:creator><pubDate>Thu, 27 Aug 2015 11:05:00 +0200</pubDate><guid>tag:lab.objoo.org,2015-08-27:Banana pi II.html</guid><category>blog</category><category>ARM</category><category>Linux</category><category>banana pi</category></item><item><title>Banana pi custom Kernel (Part I)</title><link>http://lab.objoo.org/Banana%20pi.html</link><description>&lt;p&gt;Banana pi is a small ARM Board, quite cheap and capable. It's not the cheapest or fastest board around (I'll probably make an article about odroid C1 later), but it offers a good compromise.
Being built around Allwinner A20, it offers some interesting features : a Native SATA port, and a gigabit ethernet.&lt;/p&gt;
&lt;p&gt;In the sick tradition of lots of ARM Soc makers, Linux support is not stellar, and Lemaker only propose a custom 3.4 kernel.
With these kernels, I encountered stability and performance problems. As I wanted to experiment Ceph on this kind of hardware it's problematic.&lt;/p&gt;
&lt;p&gt;And that's where (&lt;a class="reference external" href="http://linux-sunxi.org/Main_Page"&gt;http://linux-sunxi.org/Main_Page&lt;/a&gt;) Linux Sunix community comes to rescue.
These guys (thanks A LOT to them) are leading Linuxmainlining effort (&lt;a class="reference external" href="http://linux-sunxi.org/Linux_mainlining_effort"&gt;http://linux-sunxi.org/Linux_mainlining_effort&lt;/a&gt;) and this is paying off.
Should I add it's really up to Allwinner to do this kind of job ?&lt;/p&gt;
&lt;p&gt;Anyway. we now have all pieces for having a complete vanilla kernel support, at least for all server-relevant components.&lt;/p&gt;
&lt;p&gt;---
I use these custom kernels on banana pi , for lxc &amp;amp; ceph (OSD , MON) usage. I promised a guide for compiling a complete kernel + uboot for bananapi.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="http://lab.objoo.org/Banana pi II.html"&gt;This is explained in banana pi custom kernel part II&lt;/a&gt;&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Yann Dupont</dc:creator><pubDate>Wed, 26 Aug 2015 11:00:00 +0200</pubDate><guid>tag:lab.objoo.org,2015-03-24:Banana pi.html</guid><category>blog</category><category>ARM</category><category>linux</category><category>banana pi</category></item></channel></rss>