Build uClinux for EA2478 Board

From Klaus' wiki
Revision as of 07:42, 29 September 2010 by Klaus (Talk | contribs)

Jump to: navigation, search

A mini howto

Make a xen-virtualised Centos or use the one assigned to you.

Install development tools

log in to your virtual server as root user and do this:

$ yum groupinstall "development tools"
$ yum install ncurses-devel zlib-devel libacl-devel lzo-devel uuid-devel
$ yum update # Updates the server completely
$ init 6 # Reboots the server

The server reboots and uses the newest kernel and other software packages updated.

Prepare for the Embedded Artists SW

Log in again as root

Create /home/emb/eadisk

$ mkdir -p /home/emb/eadisk

Get the EA realese

Copy the extra directory on the EA DVD to /home/emb/eadisk or by using

$ cd /home/emb/eadisk
$ scp -r <your login> .

Prepare settings

Create the file /home/emb/uClinux-dist/ and put in the following:

# Setup script for uCLinux development environment.
# Run using 'source ./'
# Copyright (c) 2006 uCLogix
# Make sure our current working directory represents
# a valid uCLinux environment.
if [ ! -f $script_name ]; then
  echo Please change to the root directory of your uCLinux
  echo environment and type \'source ./$script_name\'.
  export UCLINUX
  export UCLINUX_VER=0.40-final
  # Figure out host system architecture
  # for now, only linux-i386 supported
  # Add required binary tools to the user's search path
  # Check for "." or ".\" in the path - it's broken
  echo $PATH | tr ":" "\n" | grep '^\./*$' > /dev/null &&
        echo "WARNING: '.' detected in PATH - fixing it." 1>&2
  PATH=`echo ${PATH} | tr ":" "\n" | grep -v '^\./*$' | tr "\n" ":"`
  export PATH
  echo uCLinux environment set to \'$UCLINUX\'

Prepare the distribution

Now in /home/emb execute these commands:

$ ln -s eadisk/extra/* .
$ tar zxvf uClinux-dist-20070130.tar.gz
$ cd uClinux-dist
$ rm -rf linux-2.*
$ tar zxvf ../linux-2.6.21.tar.gz
$ mv linux-2.6.21/ linux-2.6.x
$ gunzip -c ../ea-uClinux-081020.diff.gz | patch -p1  
$ gunzip -c ../ea-v3_1_incr1.diff.gz | patch -p1

Edit the file changing line 39 to look exactly like this (note the -n):

tail -n +${SKIP} ${SCRIPT} | gunzip | tar xvf -

Execute this command:

$ sh

Ignore any "burps" from gunzip at the end of the file.

Copy the precompiled file system utilities to uClinux-dist/bin folder:

$ cp /home/emb/eadisk/extra/mk*fs* bin/
$ chmod a+x bin/mkcramfs

Install the arm linux tools

$ source
$ tar zxvf ../arm-linux-tools-20061213.tar.gz

Install u-boot

Important! Install Uboot before continuing.

Finish the kernel configuration

After the u-boot has been successfully installed and compiled finish up the kernel configuration:

$ cp ../u-boot-1.1.6/tools/mkimage bin/
$ chmod a+x bin/mkimage
$ make menuconfig # Select proper vendor and board - 
                  # exit twice to save the new settings 
                #after selection of the proper hardware
$ make # Be patient - take a mug of coffee or the like

If no errors, you are up running!

What you may need now is to setup a Tftp server.