Docs: Clarifying that kernel names change per device
Bug: 25146502
Change-Id: I607533b2ebddabced0d8e91e71fc25a225eb5349
diff --git a/src/source/building-kernels.jd b/src/source/building-kernels.jd
index 41e364b..d517349 100644
--- a/src/source/building-kernels.jd
+++ b/src/source/building-kernels.jd
@@ -2,7 +2,7 @@
@jd:body
<!--
- Copyright 2013 The Android Open Source Project
+ Copyright 2015 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.
@@ -24,12 +24,13 @@
</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>
+<p>This page details how to build only the kernel. The following instructions
+assume you have not downloaded all of AOSP; if you have already done so, you can
+skip the <code>git clone</code> steps except the step that downloads the kernel
+sources.</p>
+
+<p>All examples in this section use the <code>panda</code> kernel.</p>
+
<h2 id="figuring-out-which-kernel-to-build">Figuring out which kernel to build</h2>
<p>This table lists the name and locations of the kernel sources and binaries:
<table>
@@ -143,35 +144,37 @@
</tr>
</table>
-<p>You will want to look at the git log for the kernel binary in the device
-project that you are interested in.</p>
+<p>After determining the device project you want to work with, view the git log
+for the kernel binary. Device projects use the form
+<code>device/<vendor>/<name></code>.</p>
-<p>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 --max-count=1 kernel
</code></pre>
-<p>The commit message for the kernel binary contains a partial git log
-of the kernel sources that were used to build the binary in question.
-The first entry in the log is the most recent, i.e. the one used to
-build that kernel. You will need it at a later step.</p>
-
+<p>The commit message for the kernel binary contains a partial git log of the
+kernel sources used to build the binary. The first entry in the log is the most
+recent (the one used to build the kernel). Make a note of the commit message
+as you will need it in a later step.</p>
<h2 id="id-version">Identifying kernel version</h2>
-<p>To determine the kernel version used in a particular system image, run the
-following command against the kernel file:</p>
-<pre><code>
-$ 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'
+
+<p>To determine the kernel version used in a system image, run the following
+command against the kernel file:</p>
+
+<pre><code>$ 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'
</code></pre>
-<p>For Nexus 5 (hammerhead), this can be accomplished with:</p>
-<pre><code>
-$ dd if=zImage-dtb bs=1 skip=$(LC_ALL=C od -Ad -x -w2 zImage-dtb | grep 8b1f | cut -d ' ' -f1 | head -1) | zgrep -a 'Linux version'
+
+<p>For Nexus 5 (hammerhead), the command is:</p>
+<pre><code>$ dd if=zImage-dtb bs=1 skip=$(LC_ALL=C od -Ad -x -w2 zImage-dtb | grep 8b1f | cut -d ' ' -f1 | head -1) | zgrep -a 'Linux version'
</code></pre>
<h2 id="downloading-sources">Downloading sources</h2>
-<p>Depending on which kernel you want,</p>
+<p>Download the source for the kernel you want to build using the appropriate
+<code>git clone</code> command:</p>
+
<pre><code>$ git clone https://android.googlesource.com/kernel/common.git
$ git clone https://android.googlesource.com/kernel/x86_64.git
$ git clone https://android.googlesource.com/kernel/exynos.git
@@ -181,6 +184,7 @@
$ 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>
@@ -197,19 +201,21 @@
<li>The <code>x86_64</code> project has the kernel sources for Nexus Player,
and can be used as a starting point for work on Intel x86_64 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>$ export PATH=$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH</pre>
-or
+<h2 id="downloading-a-prebuilt-gcc">Downloading a prebuilt gcc</h2>
+<p>Ensure the prebuilt toolchain is in your path:</p>
+<pre>$ export PATH=$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH</pre>
+<p>or</p>
<pre>$ export PATH=$(pwd)/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.6/bin:$PATH</pre>
-<p>On a linux host, if you don't have an Android source tree, you can download
+<p>On a Linux host, if you don't have an Android source tree, you can download
the prebuilt toolchain from:
<pre>$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6</pre>
-<h2 id="building">Building</h2>
-<p>As an example, we would build the panda kernel using the following commands:</p>
+<h2 id="building">Building the kernel</h2>
+<p>When you know the last commit message for a kernel and have successfully
+downloaded the kernel source and prebuilt gcc, you are ready to build the
+kernel. The following build commands use the panda kernel:</p>
<pre><code>$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=arm-eabi-
@@ -218,17 +224,21 @@
$ 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>
-<p>
-The kernel binary is output as: `arch/arm/boot/zImage` It can be copied
-into the Android source tree in order to build the matching boot image.
-</p>
-<p>Or you can include the <code>TARGET_PREBUILT_KERNEL</code> variable while
-using <code>make bootimage</code> or any other make command line that builds a
-boot image.</p>
-<pre><code>
-$ export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage
+
+<p>To build a different kernel, simply replace <code>panda</code> with the name
+of the kernel you want to build.</p>
+
+<p>The kernel binary is output as <code>arch/arm/boot/<kernel_name></code>
+and can be copied into the Android source tree to build the matching boot image.
+Alternatively, you can include the <code>TARGET_PREBUILT_KERNEL</code>
+variable while using <code>make bootimage</code> (or any other make command line
+that builds a boot image). This variable is supported by all devices
+as it is set up via <code>device/common/populate-new-device.sh</code>. For
+example:</p>
+
+<pre><code>$ export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage-dtb
</code></pre>
-<p>That variable is supported by all devices as it is set up via
-device/common/populate-new-device.sh</p>
+
+<p class="note"><strong>Note:</strong> Kernel names differ by device. To locate
+the correct filename for your kernel, refer to
+<code>device/<vendor>/<name></code> in the kernel source.</p>
\ No newline at end of file