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.07
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-20140716.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.07/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.

