Letux Kernel

Build

You are looking at an old revision of the page Build. This revision was created by Julius Bünger.

Table of Content

How to Build the Letux Kernel from Source

Introduction

This describes briefly how to compile the hardware validation kernel from git source. You need to have some ARM cross compiler installed on your host. (See section Cross compiling toolchain below.)

Details

Get sources by:

git clone git@github.com:goldelico/gta04-kernel.git
cd gta04-kernel/
git checkout master

(replace master by some other branch if you want a specific variant, e.g. 3.18-rc1, see letux-kernel for details)

Build:

export ARCH=arm
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-  # adapt to your toolchain

make distclean
make gta04_defconfig

make menuconfig  # only needed if you want to change the default configuration
make uImage LOADADDR=0x80008000
make modules
export INSTALL_MOD_PATH=`pwd`/modules
mkdir modules
make modules_install
tar cJvf modules.tar.xz modules/

The result will be the file arch/arm/boot/uImage. Copy this file to the FAT partition of your SD card. And expand the modules to your root filesystem. After the first boot with significant changes in modules, you may have to run depmod -a (probe all modules).

Patches

Patches should follow these guidelines. Please submit them to the gta04-owner mailing list for review and inclusion.

Cross compiling toolchain

Important note: Currently the gcc cross compiler version 5.2 seems not to work (at least on my archlinux system). So I got a gcc cross compiler version 4.8 (See section "Other" below.)

Debian

Under Debian, the most simple way to set up a toolchain for cross compiling for arm is by using the emdebian cross-compiler.

apt-get install emdebian-archive-keyring
echo deb http://www.emdebian.org/debian/ squeeze main >> /etc/apt/sources.list
apt-get update
apt-get install gcc-4.4-arm-linux-gnueabi
export ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

Angstrom

Neil Brown says: "I found that I needed to update my cross-compile tool chain to build 3.12. I used angstrom-eglibc-x86_64-armv7a-vfp-neon-v2012.12-toolchain from

http://www.angstrom-distribution.org/toolchains/

Archlinux

Under Archlinux, simply

pacman -S arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-newlib
export ARCH=arm CROSS_COMPILE=arm-none-eabi-

For more information refer to https://wiki.archlinux.org/index.php/Cross-compiling_tools_package_guidelines

Other

For a list of different cross compilers see http://www.elinux.org/ARMCompilers.

In order to use in order to use one of them do for example

wget https://sourcery.mentor.com/GNUToolchain/package12813/public/arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
tar xjf arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
export ARCH=arm CROSS_COMPILE=$(pwd)/arm-2014.05/bin/arm-none-linux-gnueabi-

Booting with devicetree

Devicetree updates for gta04 are included in kernels starting with 3.13. You find them in arch/arm/boot/dts/omap3-gta04*

Follow Build procedure described above to build uImage. When uImage is build call with export ARCH and CROSS_COMPILE:

make dtbs 

(this will build devicetree blobs).

Copy uImage and omap3-gta04.dtb to SD card /boot partition and boot from SD card. When uboot prompt appear press any key to stop and set new env:

setenv dtbloadaddr '0x83000000'  
setenv boot_dtb 'mmc rescan 0; fatload mmc 0 ${loadaddr} uImage;      
fatload mmc 0 ${dtbloadaddr} omap3-gta04.dtb; run mmcargs; bootm      
${loadaddr} - ${dtbloadaddr}'

then issue "run boot_dtb" and your gta04 will start booting.

Or use the latest gta04 u-boot which "magically knows" which variant it is running on, locates the right device tree binary and boots it.

GTA04 Debian Rootfs

In order to install a complete system see GTA04 Debian Rootfs.

Other Operating systems are listed here.