blob: 144a2f4ec5307d09747395ccc56c187886a2d05d [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 Querub0dfdaa2012-06-04 13:59:03 -070055 - The `goldfish` project contains the kernel sources for the emulated
56platforms.
57 - The `msm` project has the sources for ADP1, ADP2, Nexus One, and
58can be used as a starting point for work on Qualcomm MSM chipsets.
59 - The `omap` project is used for PandaBoard and Galaxy Nexus, and
60can be used as a starting point for work on TI OMAP chipsets.
61 - The `samsung` project is used for Nexus S and can be used as a
62starting point for work on Samsung Hummingbird chipsets.
63 - The `tegra` project is for Xoom, and can be used as a starting
64point for work on NVIDIA Tegra chipsets.
65 - The `exynos` project can be used as a starting point for work
66on Samsung Exynos chipsets.
Conley Owens7929ddf2012-01-05 16:06:15 -080067
68## Downloading a prebuilt gcc ##
69
70Ensure that the prebuilt toolchain is in your path.
71
72 $ git clone https://android.googlesource.com/platform/prebuilt
73 $ export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
74
75
76## Building ##
77
78As an example, we would build the panda kernel using the following commands:
79
80 $ export ARCH=arm
81 $ export SUBARCH=arm
82 $ export CROSS_COMPILE=arm-eabi-
83 $ cd omap
84 $ git checkout <commit_from_first_step>
85 $ make panda_defconfig
86 $ make
87
88To build the tuna kernel, you may run the previous commands replacing all
89instances of "panda" with "tuna".
90
Jean-Baptiste Queru483e82d2012-06-06 15:31:25 -070091 - The kernel for maguro and toro is `device/samsung/tuna/kernel`
92 - The kernel for crespo and crespo4g is `device/samsung/crespo/kernel`
93 - The kernel for stingray and wingray is `device/moto/wingray/kernel`
94
95The image is output as `arch/arm/boot/zImage`. You may copy it as
96`device/<vendor>/<name>/kernel` or `device/ti/panda/kernel` in the case of this
Conley Owens7929ddf2012-01-05 16:06:15 -080097example.