Conley Owens | 7929ddf | 2012-01-05 16:06:15 -0800 | [diff] [blame^] | 1 | <!-- |
| 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 | |
| 19 | If you are only interested in the kernel, you may use this guide |
| 20 | to download and build the appropriate kernel. |
| 21 | |
| 22 | The following instructions assume that you have not downloaded all |
| 23 | of AOSP. If you have downloaded all of AOSP, you may skip the git |
| 24 | clone steps other than the step to download the actual kernel sources. |
| 25 | |
| 26 | We will use the Pandaboard kernel in all the following examples. |
| 27 | |
| 28 | |
| 29 | ## Figuring out which kernel to build ## |
| 30 | |
| 31 | You will want to look at the git log for the kernel in the device project that |
| 32 | you are interested in. |
| 33 | Device projects are of the form device/<vendor>/<name>. |
| 34 | |
| 35 | $ git clone https://android.googlesource.com/device/ti/panda |
| 36 | $ cd panda |
| 37 | $ git log kernel |
| 38 | |
| 39 | The log should contain notes of the commit SHA1 for the appropriate |
| 40 | kernel project. Keep this value at hand so that you can use it in |
| 41 | a later step. |
| 42 | |
| 43 | ## Downloading sources ## |
| 44 | |
| 45 | Depending on which kernel you want, |
| 46 | |
| 47 | $ git clone https://android.googlesource.com/kernel/common.git |
| 48 | $ git clone https://android.googlesource.com/kernel/goldfish.git |
| 49 | $ git clone https://android.googlesource.com/kernel/msm.git |
| 50 | $ git clone https://android.googlesource.com/kernel/omap.git |
| 51 | $ git clone https://android.googlesource.com/kernel/samsung.git |
| 52 | $ git clone https://android.googlesource.com/kernel/tegra.git |
| 53 | |
| 54 | |
| 55 | ## Downloading a prebuilt gcc ## |
| 56 | |
| 57 | Ensure that the prebuilt toolchain is in your path. |
| 58 | |
| 59 | $ git clone https://android.googlesource.com/platform/prebuilt |
| 60 | $ export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH |
| 61 | |
| 62 | |
| 63 | ## Building ## |
| 64 | |
| 65 | As an example, we would build the panda kernel using the following commands: |
| 66 | |
| 67 | $ export ARCH=arm |
| 68 | $ export SUBARCH=arm |
| 69 | $ export CROSS_COMPILE=arm-eabi- |
| 70 | $ cd omap |
| 71 | $ git checkout <commit_from_first_step> |
| 72 | $ make panda_defconfig |
| 73 | $ make |
| 74 | |
| 75 | To build the tuna kernel, you may run the previous commands replacing all |
| 76 | instances of "panda" with "tuna". |
| 77 | |
| 78 | The image is output as arch/arm/boot/zImage. You may copy it as |
| 79 | device/<vendor>/<name>/kernel or device/ti/panda/kernel in the case of this |
| 80 | example. |