summaryrefslogtreecommitdiff
path: root/openembedded/vexpress-lsk/HACKING.textile
blob: e5552582a9d25878f12b30262c5b8868bb6e6810 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
OpenEmbedded images are comprised of a Hardware Pack ("HWPack":https://wiki.linaro.org/HardwarePacks) and a root file system.  The hardware pack contains the kernel, boot loader and Device Tree blobs (if applicable). There is no need to rebuild the RootFS since it is comprised of a large number of debian packages. Instead, the best approach is to use an image, which you can create as outlined in the "Binary Image Installation" tab then replace the kernel with your compiled one.  This is common practice that many engineers deploy when wanting a standard Linux image to use for testing and development purposes.

The following instructions will walk you through how to obtain the kernel source, build it, and add it to a pre-existing image.

h2. Prerequisites

* Ubuntu 12.04 64 bit system. You can download Ubuntu from "ubuntu.com":http://www.ubuntu.com
* git and toolchain. You can get those by typing the following command in your terminal

bc. sudo apt-get install build-essential git gcc-arm-linux-gnueabi

h2. Get the source

You can use GIT to obtain the kernel source code for this build:

bc. git clone git://git.linaro.org/kernel/linux-linaro-stable.git
cd linux-linaro-stable
YY=<current year, eg, 14>
MM=<current month, eg. 07>
git checkout lsk-${YY}.${MM}

h3. Create a kernel config

Do not use the defconfig for Versatile Express, instead, build a config from the config fragments that Linaro provides:

bc. ARCH=arm scripts/kconfig/merge_config.sh \
linaro/configs/linaro-base.conf \
linaro/configs/distribution.conf \
linaro/configs/vexpress.conf

Note: the config fragments are part of the git repository and the source tarball.

h3. Build the kernel

To build the kernel uImage, use the following command:

bc. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LOADADDR=0x60008000 uImage

h2. Install your kernel

This section is common for both Android and OpenEmbedded.

* Create the Device Tree blob if you don’t have one in your Linaro image (note, the A9 Core Tile boots using an ATAGS kernel so there is no need for a device tree blob):

bc. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs

* Insert the SD card containing the Linaro disk image into your PC SD card reader

* Copy the kernel onto the memory card using

bc. cp arch/arm/boot/uImage /media/boot/

* Copy the device tree blob
** For A9 CoreTile: no device tree blob is needed
** For A5 CoreTile: @cp arch/arm/boot/dts/vexpress-v2p-ca5s.dtb /media/boot/v2p-ca5s.dtb@
** For A15 CoreTile (TC1): @cp arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dtb /media/boot/v2p-ca15-tc1.dtb@
** For A15_A7 CoreTile (TC2): @cp arch/arm/boot/dts/vexpress-v2p-ca15_a7.dtb /media/boot/v2p-ca15-tc2.dtb@

* Eject the memory card from your PC by using the following command

bc. eject /media/boot

* Insert the memory card into the Versatile Express board and power it on

* You should boot your image using your own compiled kernel