| page.title=Building Kernels |
| @jd:body |
| |
| <!-- |
| Copyright 2010 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <div id="qv-wrapper"> |
| <div id="qv"> |
| <h2>In this document</h2> |
| <ol id="auto-toc"> |
| </ol> |
| </div> |
| </div> |
| |
| <p>If you are only interested in the kernel, you may use this guide |
| to download and build the appropriate kernel.</p> |
| <p>The following instructions assume that you have not downloaded all |
| of AOSP. If you have downloaded all of AOSP, you may skip the git |
| clone steps other than the step to download the actual kernel sources.</p> |
| <p>We will use the Pandaboard kernel in all the following examples.</p> |
| <h2 id="figuring-out-which-kernel-to-build">Figuring out which kernel to build</h2> |
| <p>You will want to look at the git log for the kernel in the device project that |
| you are interested in. |
| Device projects are of the form device/<vendor>/<name>.</p> |
| <pre><code>$ git clone https://android.googlesource.com/device/ti/panda |
| $ cd panda |
| $ git log kernel |
| </code></pre> |
| <p>The log should contain notes of the commit SHA1 for the appropriate |
| kernel project. Keep this value at hand so that you can use it in |
| a later step.</p> |
| <h2 id="downloading-sources">Downloading sources</h2> |
| <p>Depending on which kernel you want,</p> |
| <pre><code>$ git clone https://android.googlesource.com/kernel/common.git |
| $ git clone https://android.googlesource.com/kernel/exynos.git |
| $ git clone https://android.googlesource.com/kernel/goldfish.git |
| $ git clone https://android.googlesource.com/kernel/msm.git |
| $ git clone https://android.googlesource.com/kernel/omap.git |
| $ git clone https://android.googlesource.com/kernel/samsung.git |
| $ git clone https://android.googlesource.com/kernel/tegra.git |
| </code></pre> |
| <ul> |
| <li>The <code>goldfish</code> project contains the kernel sources for the emulated |
| platforms.</li> |
| <li>The <code>msm</code> project has the sources for ADP1, ADP2, Nexus One, Nexus 4, |
| and can be used as a starting point for work on Qualcomm MSM chipsets.</li> |
| <li>The <code>omap</code> project is used for PandaBoard and Galaxy Nexus, |
| and can be used as a starting point for work on TI OMAP chipsets.</li> |
| <li>The <code>samsung</code> project is used for Nexus S, |
| and can be used as a starting point for work on Samsung Hummingbird chipsets.</li> |
| <li>The <code>tegra</code> project is for Xoom and Nexus 7, |
| and can be used as a starting point for work on NVIDIA Tegra chipsets.</li> |
| <li>The <code>exynos</code> project has the kernel sources for Nexus 10, |
| and can be used as a starting point for work on Samsung Exynos chipsets.</li> |
| </ul> |
| <h2 id="downloading-a-prebuilt-gcc">Downloading a prebuilt gcc</h2> |
| <p>Ensure that the prebuilt toolchain is in your path.</p> |
| <pre><code>$ git clone https://android.googlesource.com/platform/prebuilt |
| $ export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH |
| </code></pre> |
| <h2 id="building">Building</h2> |
| <p>As an example, we would build the panda kernel using the following commands:</p> |
| <pre><code>$ export ARCH=arm |
| $ export SUBARCH=arm |
| $ export CROSS_COMPILE=arm-eabi- |
| $ cd omap |
| $ git checkout <commit_from_first_step> |
| $ make panda_defconfig |
| $ make |
| </code></pre> |
| <p>To build the tuna kernel, you may run the previous commands replacing all |
| instances of "panda" with "tuna".</p> |
| <ul> |
| <li>The kernel for mantaray is <code>device/samsung/manta/kernel</code></li> |
| <li>The kernel for mako is <code>device/lge/mako-kernel/kernel</code></li> |
| <li>The kernel for grouper and tilapia is <code>device/asus/grouper/kernel</code></li> |
| <li>The kernel for maguro and toro is <code>device/samsung/tuna/kernel</code></li> |
| <li>The kernel for crespo and crespo4g is <code>device/samsung/crespo/kernel</code></li> |
| <li>The kernel for stingray and wingray is <code>device/moto/wingray/kernel</code></li> |
| </ul> |
| <p>The image is output as <code>arch/arm/boot/zImage</code>. You may copy it as |
| <code>device/<vendor>/<name>/kernel</code> or <code>device/ti/panda/kernel</code> in the case of this |
| example.</p> |