am 0a4ce5c0: am be79ea1c: Merge "Add notes about building kernels"

* commit '0a4ce5c0f8ad3967d059288ea5a655b010af08e3':
  Add notes about building kernels
diff --git a/src/source/building-kernels.md b/src/source/building-kernels.md
new file mode 100644
index 0000000..8eb9639
--- /dev/null
+++ b/src/source/building-kernels.md
@@ -0,0 +1,80 @@
+<!--
+   Copyright 2011 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.
+-->
+
+# Building Kernels #
+
+If you are only interested in the kernel, you may use this guide
+to download and build the appropriate kernel.
+
+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.
+
+We will use the Pandaboard kernel in all the following examples.
+
+
+## Figuring out which kernel to build ##
+
+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/&lt;vendor&gt;/&lt;name&gt;.
+
+    $ git clone https://android.googlesource.com/device/ti/panda
+    $ cd panda
+    $ git log kernel
+
+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.
+
+## Downloading sources ##
+
+Depending on which kernel you want,
+
+    $ git clone https://android.googlesource.com/kernel/common.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
+
+
+## Downloading a prebuilt gcc ##
+
+Ensure that the prebuilt toolchain is in your path.
+
+    $ git clone https://android.googlesource.com/platform/prebuilt
+    $ export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
+
+
+## Building ##
+
+As an example, we would build the panda kernel using the following commands:
+
+    $ export ARCH=arm
+    $ export SUBARCH=arm
+    $ export CROSS_COMPILE=arm-eabi-
+    $ cd omap
+    $ git checkout <commit_from_first_step>
+    $ make panda_defconfig
+    $ make
+
+To build the tuna kernel, you may run the previous commands replacing all
+instances of "panda" with "tuna".
+
+The image is output as arch/arm/boot/zImage.  You may copy it as
+device/<vendor>/<name>/kernel or device/ti/panda/kernel in the case of this
+example.
diff --git a/src/source/downloading.md b/src/source/downloading.md
index 81f1ba9..9f81cae 100644
--- a/src/source/downloading.md
+++ b/src/source/downloading.md
@@ -199,19 +199,6 @@
 If you haven't [set up ccache](initializing.html#ccache) yet,
 now would be a good time to do it.
 
-## Downloading kernels ##
-
-If you are only interested in kernel sources,
-you can get the kernel you are interested in through one of the following
-commands:
-
-    $ git clone https://android.googlesource.com/kernel/common.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
-
 # Next: Build the code #
 
 You now have a complete local copy of the Android codebase.  Continue on to [building](building.html)....
diff --git a/src/source/sidebar.md b/src/source/sidebar.md
index 362eb04..45189a2 100644
--- a/src/source/sidebar.md
+++ b/src/source/sidebar.md
@@ -4,6 +4,7 @@
 - [Downloading the Source](downloading.html)
 - [Building and Running](building.html)
 - [Building for Devices](building-devices.html)
+- [Building Kernels](building-kernels.html)
 - [Known Issues](known-issues.html)
 
 # Navigating the Source #