blob: 49876544bcc56e74cb3382d39457c74dcbef827b [file] [log] [blame] [view]
Conley Owens7929ddf2012-01-05 16:06:15 -08001<!--
2 Copyright 2011 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16
17# Building Kernels #
18
19If you are only interested in the kernel, you may use this guide
20to download and build the appropriate kernel.
21
22The following instructions assume that you have not downloaded all
23of AOSP. If you have downloaded all of AOSP, you may skip the git
24clone steps other than the step to download the actual kernel sources.
25
26We will use the Pandaboard kernel in all the following examples.
27
28
29## Figuring out which kernel to build ##
30
31You will want to look at the git log for the kernel in the device project that
32you are interested in.
33Device projects are of the form device/&lt;vendor&gt;/&lt;name&gt;.
34
35 $ git clone https://android.googlesource.com/device/ti/panda
36 $ cd panda
37 $ git log kernel
38
39The log should contain notes of the commit SHA1 for the appropriate
40kernel project. Keep this value at hand so that you can use it in
41a later step.
42
43## Downloading sources ##
44
45Depending on which kernel you want,
46
47 $ git clone https://android.googlesource.com/kernel/common.git
Jean-Baptiste Queru226274b2012-05-02 07:00:55 -070048 $ git clone https://android.googlesource.com/kernel/exynos.git
Conley Owens7929ddf2012-01-05 16:06:15 -080049 $ git clone https://android.googlesource.com/kernel/goldfish.git
50 $ git clone https://android.googlesource.com/kernel/msm.git
51 $ git clone https://android.googlesource.com/kernel/omap.git
52 $ git clone https://android.googlesource.com/kernel/samsung.git
53 $ git clone https://android.googlesource.com/kernel/tegra.git
54
Jean-Baptiste Queru226274b2012-05-02 07:00:55 -070055The goldfish project contains the kernel sources for the emulated
56platforms. The msm project has the sources for ADP1, ADP2 and
57Nexus One. The omap project is used for PandaBoard and Galaxy Nexus,
58the samsung project for Nexus S, and the tegra project for Xoom.
Conley Owens7929ddf2012-01-05 16:06:15 -080059
60## Downloading a prebuilt gcc ##
61
62Ensure that the prebuilt toolchain is in your path.
63
64 $ git clone https://android.googlesource.com/platform/prebuilt
65 $ export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
66
67
68## Building ##
69
70As an example, we would build the panda kernel using the following commands:
71
72 $ export ARCH=arm
73 $ export SUBARCH=arm
74 $ export CROSS_COMPILE=arm-eabi-
75 $ cd omap
76 $ git checkout <commit_from_first_step>
77 $ make panda_defconfig
78 $ make
79
80To build the tuna kernel, you may run the previous commands replacing all
81instances of "panda" with "tuna".
82
83The image is output as arch/arm/boot/zImage. You may copy it as
84device/<vendor>/<name>/kernel or device/ti/panda/kernel in the case of this
85example.