135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lypage.title=Building Kernels
235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly@jd:body
335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<!--
5768b82a9dfbdd8504eae2736d283a60a37c7a547Clay Murphy    Copyright 2013 The Android Open Source Project
635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    Licensed under the Apache License, Version 2.0 (the "License");
835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    you may not use this file except in compliance with the License.
935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    You may obtain a copy of the License at
1035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
1135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly        http://www.apache.org/licenses/LICENSE-2.0
1235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
1335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    Unless required by applicable law or agreed to in writing, software
1435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    distributed under the License is distributed on an "AS IS" BASIS,
1535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    See the License for the specific language governing permissions and
1735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    limitations under the License.
1835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly-->
1935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<div id="qv-wrapper">
2035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  <div id="qv">
2135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <h2>In this document</h2>
2235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    <ol id="auto-toc">
2335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly    </ol>
2435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly  </div>
2535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</div>
2635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly
2735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>If you are only interested in the kernel, you may use this guide
2835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyto download and build the appropriate kernel.</p>
2935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>The following instructions assume that you have not downloaded all
3035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyof AOSP.  If you have downloaded all of AOSP, you may skip the git
3135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyclone steps other than the step to download the actual kernel sources.</p>
3235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>We will use the Pandaboard kernel in all the following examples.</p>
3335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="figuring-out-which-kernel-to-build">Figuring out which kernel to build</h2>
3440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<p>This table lists the name and locations of the kernel sources and binaries:
3540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<table>
3640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
3740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <th>Device</th>
3840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <th>Binary location</th>
3940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <th>Source location</th>
4040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <th>Build configuration</th>
4140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
4240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
43d72700d5683ba13b725e79d0bae376af9873de5aClay Murphy    <td>hammerhead</td>
44d72700d5683ba13b725e79d0bae376af9873de5aClay Murphy    <td>device/lge/hammerhead-kernel</td>
45d72700d5683ba13b725e79d0bae376af9873de5aClay Murphy    <td>kernel/msm</td>
46d72700d5683ba13b725e79d0bae376af9873de5aClay Murphy    <td>hammerhead_defconfig</td>
47d72700d5683ba13b725e79d0bae376af9873de5aClay Murphy  </tr>
48d72700d5683ba13b725e79d0bae376af9873de5aClay Murphy  <tr>
493b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>flo</td>
503b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>device/asus/flo-kernel/kernel</td>
513b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>kernel/msm</td>
523b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>flo_defconfig</td>
533b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru  </tr>
543b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru  <tr>
553b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>deb</td>
563b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>device/asus/flo-kernel/kernel</td>
573b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>kernel/msm</td>
583b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru    <td>flo_defconfig</td>
593b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru  </tr>
603b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru  <tr>
6140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>manta</td>
6240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/samsung/manta/kernel</td>
6340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/exynos</td>
6440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>manta_defconfig</td>
6540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
6640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
6740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>mako</td>
6840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/lge/mako-kernel/kernel</td>
6940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/msm</td>
7040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>mako_defconfig</td>
7140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
7240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
7340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>grouper</td>
7440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/asus/grouper/kernel</td>
7540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/tegra</td>
7640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>tegra3_android_defconfig</td>
7740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
7840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
7940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>tilapia</td>
8040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/asus/grouper/kernel</td>
8140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/tegra</td>
8240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>tegra3_android_defconfig</td>
8340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
8440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
8540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>maguro</td>
8640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/samsung/tuna/kernel</td>
8740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/omap</td>
8840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>tuna_defconfig</td>
8940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
9040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
9140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>toro</td>
9240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/samsung/tuna/kernel</td>
9340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/omap</td>
9440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>tuna_defconfig</td>
9540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
9640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
9740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>panda</td>
9840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/ti/panda/kernel</td>
9940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/omap</td>
10040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>panda_defconfig</td>
10140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
10240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
10340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>stingray</td>
10440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/moto/wingray/kernel</td>
10540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/tegra</td>
10640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>stingray_defconfig</td>
10740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
10840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
10940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>wingray</td>
11040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/moto/wingray/kernel </td>
11140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/tegra</td>
11240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>stingray_defconfig</td>
11340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
11440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
11540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>crespo</td>
11640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/samsung/crespo/kernel</td>
11740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/samsung</td>
11840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>herring_defconfig</td>
11940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
12040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  <tr>
12140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>crespo4g</td>
12240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>device/samsung/crespo/kernel</td>
12340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>kernel/samsung</td>
12440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly    <td>herring_defconfig</td>
12540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly  </tr>
12640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly</table>
12740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly
12840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<p>You will want to look at the git log for the kernel binary in the device
12940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Lyproject that you are interested in.</p>
13040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly
1314d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<p>Device projects are of the form device/&lt;vendor&gt;/&lt;name&gt;.</p>
13235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre><code>$ git clone https://android.googlesource.com/device/ti/panda
13335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ cd panda
13440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly$ git log --max-count=1 kernel
13535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</code></pre>
13640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly
13740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<p>The commit message for the kernel binary contains a partial git log
13840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Lyof the kernel sources that were used to build the binary in question.
13940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert LyThe first entry in the log is the most recent, i.e. the one used to
14040e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Lybuild that kernel. You will need it at a later step.</p>
14140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly
1424d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy
1434d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<h2 id="id-version">Identifying kernel version</h2>
1444d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<p>To determine the kernel version used in a particular system image, run the
1454d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphyfollowing command against the kernel file:</p>
1464d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<pre><code>
1474d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy$ dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version'
1484d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy</code></pre>
1494d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<p>For Nexus 5 (hammerhead), this can be accomplished with:</p>
1504d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<pre><code>
1514d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy$ bzgrep -a 'Linux version' vmlinux.bz2
1524d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy</code></pre>
1534d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy
1544d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy
15535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="downloading-sources">Downloading sources</h2>
15635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>Depending on which kernel you want,</p>
15735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre><code>$ git clone https://android.googlesource.com/kernel/common.git
15835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git clone https://android.googlesource.com/kernel/exynos.git
15935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git clone https://android.googlesource.com/kernel/goldfish.git
16035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git clone https://android.googlesource.com/kernel/msm.git
16135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git clone https://android.googlesource.com/kernel/omap.git
16235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git clone https://android.googlesource.com/kernel/samsung.git
16335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git clone https://android.googlesource.com/kernel/tegra.git
16435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</code></pre>
16535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<ul>
16635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<li>The <code>goldfish</code> project contains the kernel sources for the emulated
16735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyplatforms.</li>
16835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<li>The <code>msm</code> project has the sources for ADP1, ADP2, Nexus One, Nexus 4,
16935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyand can be used as a starting point for work on Qualcomm MSM chipsets.</li>
17035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<li>The <code>omap</code> project is used for PandaBoard and Galaxy Nexus,
17135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyand can be used as a starting point for work on TI OMAP chipsets.</li>
17235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<li>The <code>samsung</code> project is used for Nexus S,
17335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyand can be used as a starting point for work on Samsung Hummingbird chipsets.</li>
17435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<li>The <code>tegra</code> project is for Xoom and Nexus 7,
17535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyand can be used as a starting point for work on NVIDIA Tegra chipsets.</li>
17635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<li>The <code>exynos</code> project has the kernel sources for Nexus 10,
17735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyand can be used as a starting point for work on Samsung Exynos chipsets.</li>
17835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</ul>
17935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="downloading-a-prebuilt-gcc">Downloading a prebuilt gcc</h2>
18035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>Ensure that the prebuilt toolchain is in your path.</p>
18140e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<pre>$ export PATH=$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH</pre>
18240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly
18340e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Lyor
18440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<pre>$ export PATH=$(pwd)/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.6/bin:$PATH</pre>
18540e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly
18640e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<p>On a linux host, if you don't have an Android source tree, you can download
18740e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Lythe prebuilt toolchain from:
18840e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<pre>$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6</pre>
18940e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly
19035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<h2 id="building">Building</h2>
19135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>As an example, we would build the panda kernel using the following commands:</p>
19235f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<pre><code>$ export ARCH=arm
19335f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ export SUBARCH=arm
19435f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ export CROSS_COMPILE=arm-eabi-
19535f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ cd omap
19635f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ git checkout &lt;commit_from_first_step&gt;
19735f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ make panda_defconfig
19835f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly$ make
19935f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly</code></pre>
20035f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Ly<p>To build the tuna kernel, you may run the previous commands replacing all
20135f2fda6aaeaf733ab68a3b7f7ccc67f009c09a9Robert Lyinstances of "panda" with "tuna".</p>
20240e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Ly<p>
2034d366103dd4b13b065bdf99f10f0c84ccee44870Clay MurphyThe kernel binary is output as: `arch/arm/boot/zImage` It can be copied
20440e3b6d2b1fb1b9c093f6fefe34f68bfc98e07d3Robert Lyinto the Android source tree in order to build the matching boot image.
2053b41843a383906622b502cb27db40933ea147799Jean-Baptiste Queru</p>
2064d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<p>Or you can include the <code>TARGET_PREBUILT_KERNEL</code> variable while
2074d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphyusing <code>make bootimage</code> or any other make command line that builds a
2084d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphyboot image.</p>
2094d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<pre><code>
2104d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy$ export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage
2114d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy</code></pre>
2124d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphy<p>That variable is supported by all devices as it is set up via
2134d366103dd4b13b065bdf99f10f0c84ccee44870Clay Murphydevice/common/populate-new-device.sh</p>
214