summaryrefslogtreecommitdiff
path: root/members/arm/openembedded/aarch64/HACKING.textile
blob: 50e9fe01c6cc91357197923aa75106087f04355a (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
h2. Building locally

h3. Initial setup

bc. mkdir openembedded
cd openembedded
git clone git://git.linaro.org/openembedded/jenkins-setup.git
cd jenkins-setup
git checkout release-14.09
cd ..
sudo bash jenkins-setup/pre-build-root-install-dependencies.sh
bash jenkins-setup/init-and-build.sh

p. This will clone all required repositories and does initial setup.

h3. Do a build

bc. cd openembedded-core
. oe-init-build-env ../build
bitbake bash

p. Of course you can use other targets instead of "bash". Use "linaro-image-minimal" to build a simple rootfs.

h3. Usable build targets

* linaro-image-minimal - very minimal rootfs
* linaro-image-lamp - LAMP stack and toolchain
* linaro-image-leg-java - Same as LAMP image but also includes OpenJDK-7 and OpenJDK-8

h2. Building the Linaro Kernel

h3. Prerequisites

* Ubuntu 12.04 64 bit system. You can download Ubuntu from ubuntu.com
* git

bc. sudo apt-get install build-essential git

* toolchain

bc. mkdir -p ~/bin
cd ~/bin
wget http://releases.linaro.org/13.11/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux.tar.xz
tar xf gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux.tar.xz
PATH=$PATH:~/bin/gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux/bin

h3. Get the Linaro Kernel Source

bc. git clone git://git.linaro.org/kernel/linux-linaro-tracking.git
cd linux-linaro-tracking
git checkout ll-20140911.0

h3. Create a kernel config

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

bc. ARCH=arm64 scripts/kconfig/merge_config.sh \
linaro/configs/linaro-base.conf \
linaro/configs/linaro-base64.conf \
linaro/configs/distribution.conf \
linaro/configs/vexpress64.conf \
linaro/configs/kvm-host.conf \
linaro/configs/kvm-guest.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=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image

h3. Install your kernel

Create the Device Tree blob if you don’t have one in your Linaro image:

bc. make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- dtbs

Copy the kernel and the DTB file for your model to your fastmodel directory created in the "Binary Installation tab":https://releases.linaro.org/14.09/openembedded/aarch64/#tabs-2.

bc. cp arch/arm64/boot/Image <fastmodel dir>
cp arch/arm64/boot/dts/*.dtb <fastmodel dir>

h2. Building UEFI

To rebuild the UEFI binaries, see the "UEFI Wiki":https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI and specifically the "UEFI build page":https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/build.