LinuxInstall

From ArmadeusWiki
Revision as of 12:05, 2 March 2011 by JulienB (Talk | contribs) (Configure SDK options)

Jump to: navigation, search

How-To install Armadeus Software Development Kit (SDK) on Linux systems. This SDK is currently based on the (excellent) Buildroot.


The installation was successfully tested on the following distributions:

  • Debian Sarge (3.1), Etch (4.0) & Lenny (5.0)
  • Fedora Core 3 & 4
  • Fedora 10
  • KUbuntu Edgy Eft (6.10), Gutsy Gibbon (7.10), Hardy Heron (8.04) & Jaunty Jackalope (9.04)
  • Mandriva 2006
  • SuSE 10.1
  • Ubuntu Dapper Drake (6.04), Hardy Heron (8.04), Intrepid Ibex (8.10) & Lucid Lynx (10.04) (64bits)
  • Xubuntu Edgy Eft (6.10)
  • Red Hat Enterprise 5.2
  • Gentoo 10.0 (32 & 64 bits)
  • OpenSUSE 11.3

The installation may fail on:

  • Ubuntu Karmic Koala (9.10): tslib fails to build


Prerequisites for Linux installation

Note Note: From here we assume that your Linux system has a make version greater or equal to 3.81. To check it:
$ make -v
GNU Make 3.81
...


Depending on your distribution, some additional packages are required.

Debian/Ubuntu based systems

  • you can use the following command to get them (assuming your userid is allowed to use sudo (execution of commands as root)):
 sudo apt-get install build-essential gcc  g++ autoconf  automake libtool bison flex gettext 
 sudo apt-get install patch subversion texinfo wget git-core
 sudo apt-get install libncurses5 libncurses5-dev
 sudo apt-get install zlib1g-dev liblzo2-2 liblzo2-dev
 sudo apt-get install libacl1 libacl1-dev gawk cvs curl lzma 
 sudo apt-get install uuid-dev

Not mandatory but useful to add for compiling some Buildroot packages:

 sudo apt-get install libglib2.0-dev
 sudo apt-get install libnetpbm10-dev   (for fbtest)
 sudo apt-get install python-xcbgen (for Matchbox)
Warning Warning: For recent Ubuntu and Debian based systems, the following is now required if your /bin/sh is not pointing to /bin/bash:
 $ ls -al /bin/sh
 lrwxrwxrwx 1 root root 4 2007-12-08 18:33 /bin/sh -> dash
 $ sudo dpkg-reconfigure dash
     and select no

Indeed dash do not support all the capabilities needed by Buildroot (our build system).


Ubuntu

  • To compile java jamvm and gnu-classpath:
 sudo apt-get install gcj-jdk 

Debian

To compile java jamvm and gnu-classpath:

 sudo apt-get install java-gcj-compat-dev default-jdk

Mandriva based systems

  • name of packages are different therefore use the lines hereafter instead (assuming sudo is configured to support root commands):
 sudo urpmi gcc  gcc-c++ make autoconf  automake libtool bison flex gettext 
 sudo urpmi patch subversion texinfo wget git
 sudo urpmi libncurses5 libncurses-devel
 sudo urpmi zlib1-devel liblzo2_2 liblzo-devel
 sudo urpmi libacl1 libacl-devel
 sudo urpmi uuid-dev

Not mandatory but useful to add some Buildroot packages:

 sudo urpmi libglib2.0-devel

To compile java jamvm and gnu-classpath:

 sudo urpmi java-gcj-compat-dev 

RPM-based systems

  • like RedHat, Fedora, CentOS, the following commands should install all the needed prerequisites (assuming root shell):
 yum install gcc gcc-c++ make autoconf automake libtool bison flex gettext
 yum install patch subversion texinfo git wget
 yum install zlib-devel gettext-devel ncurses-devel lzo-devel libacl-devel
 yum install uuid-devel
  • On Fedora 13 & 14, as uuid-devel seems not installed at the right place, you may also need to do the following:
cd /usr/include
mkdir uuid
cp uuid.h uuid
cd /usr/lib
ln -s ../../lib64/libuuid.so.1 libuuid.so
  • On Fedora 14, following operations might be needed:
    • compile make-3.81 from sources (Fedora 14 uses make-3.82 which is too restrictive) and call it explicitly from /usr/local/bin/make
    • install glibc-static to allow insmod.static compilation:
rpm -ivh glibc-static-2.12.90-15.i686.rpm
  • Not mandatory but useful to add some extra packages:
yum install glib2-devel lzo2-devel

To compile java jamvm and gnu-classpath:

yum install java-*-openjdk
  • On RedHat Enterprise 5.2 not all packages are available by default. You can get extra packages here: http://download.fedora.redhat.com/pub/epel/5/i386/ (for example missing lzo and lzo-devel can be found here).
  • On OpenSUSE 11.3, following operations might be needed:
sudo zypper install  gcc  gcc-c++ autoconf  automake libtool bison flex make
sudo zypper install subversion texinfo git-core ncurses-devel
sudo zypper install libacl-devel
sudo zypper install libuuid-devel
sudo zypper install libnetpbm-devel
sudo zypper install tcpd
sudo zypper install tcpd-devel
sudo zypper install java-1_5_0-gcj-compat libgcj-devel
sudo zypper install lzo-devel

Get Armadeus software

 $ tar xjvf armadeus-3.3.tar.bz2
  • If you want the latest snapshot, the whole development tree can checked out from the GIT repository. (SVN repository is no more maintained !!!)
 $ git clone git://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus armadeus
  • depending on your previous choice, a directory named armadeus/ or armadeus-3.3/ will be created on your hard-disk and will contain all the files you need.

Remarks:

Configure SDK options

Note Note: If you are new to Armadeus and have troubles compiling armadeus-3.3 using the following instructions, you may find some hints here: Armadeus 3.3 Troubleshots
  • Go to the directory where you put the Armadeus sources:
 $ cd armadeus/  (or armadeus-3.3/)
  • The first time you compile an Armadeus distribution you have to specify the target (here the apf9328) to work with.
 $ make apf9328_defconfig

This command reloads the default configuration to support your target and automatically start a Buildroot's configuration menu.

  • Current valid default configurations are:
apf9328_defconfig  apf27_defconfig  pps_defconfig
  • After some downloads, you will get the Buildroot configuration interface:
Note Note: If you ever made changes in the following steps, at any time you can reload the default configuration with the same command


Menuconfig3.png

  • If you are not familiar with Buildroot here are some tips:
    1. you can move the highlighted item with the "up"/"down" arrow keys
    2. with the "left"/"right" arrow keys you can choose between "Select", "Exit" or "Help" buttons
    3. "space"/"enter":
      • selects the currently highlighted item if you are on the "Select" button
      • go back in previous menu if you are on "Exit" button
      • show you some Help for current item if you are on "Help" button
    4. for more Help about Buildroot commands, select "Help" in the main configuration screen
  • In menu:
Target options  ---> 
[*] Armadeus Device Support --->
you can check and change the quantity of RAM available on your Armadeus board. For APF27 it could be either 64MB or 128MB (2 x 64MB) (in that case be sure to select 2 chips of 64MB instead of 1 chip of 128MB).
  • In menu:
Target filesystem options --> 
for each type of filesystems to build, you have the option (also copy the image to...) to copy the binary file to secondary location like your tftp server folder (for example /tftpboot).
Even U-Boot can be copied to a second location (like /tftpboot). You will find the U-Boot options at the end of the list.
  • In menu:
Kernel -->
Destination for linux kernel binaries -->
you will find options to copy Linux to a secondary location (like /tftpboot)
  • You may decrease the compilation time by increasing the number of parallel jobs running simultaneously on your system (the result is not guaranteed). This option is located in
Build Options --->
(1) Number of jobs to run simultaneously
  • During the toolchain/distribution automatic build, a lot of software archives are downloaded from Internet. The downloaded files are put by default in the armadeus/downloads/ directory. If you have several views or plan to build the toolchain several times, we advise you to put all the downloaded files in /local/downloads (for example). This is done by configuring Buildroot to use this directory for all your views. Nevertheless, buildroot will be downloaded separately for each build environment you set up.
Build options  ---> 
(...) Download dir
Build config menu download.png

Build config download.png
  • After the build, we advise you too to copy all the files in downloads/ on a removable medium, in case you want to install the development tools on several systems.
  • Now, Exit the configuration tool and save your configuration

Launch build

$ make

The toolchain and the full distribution are automatically built. During this procedure, several files are downloaded from Internet.
Please wait for a while.... it takes at least one hour for the first run!
By default, the downloaded files/tarball are put in the armadeus/downloads/ directory. Please see the previous chapter to know how to optimize that if you plan to build several views.

Enjoy the result

The generated binary files can be found in the subdirectory buildroot/binaries/XX/ (where XX is the name of your board):

Please note the new naming convention of binary files and directories (since Armadeus 3.0)

The toolchain and project files share a new naming convention too (YY is 4t for APF9328 and 5te for APF27):

  • buildroot/build_armvYY: contains all non configurable user-space tools and staging dir.
  • buildroot/project_build_armvYY/apfXX: contains all configurable user-space tools: target filesystem, linux, busybox and u-boot...
  • buildroot/toolchain_build_armvYY: cross compilation toolchain's build dir. Binaries are in buildroot/build_armvYY/staging_dir/usr/bin.

More information is available in the buildroot documentation

  • Note: Previous versions of Armadeus SDK stored the generated binary files at different place buildroot/binaries/armadeus/ and file names did not contained any prefix of board name:
    • u-boot.brec (BRecord image that can be used with the bootstrap, if U-Boot is not installed or not working)
    • u-boot.bin (U-Boot image file for use with U-Boot itself)
    • linux-kernel-2.6.xx-arm.bin (Linux image to use with U-Boot)
    • rootfs.arm.jffs2 (FileSystem/RootFS image to use with U-Boot)
    • rootfs.arm.tar (for an NFS/MMC RootFS)


To keep your local copy/repository up-to-date with the armadeus GIT repository

 $ git pull

This will update your working directory to the latest release.

Note: if "git pull" fails because a directory or a file already exists, then do:

$ rm -rf <this-directory/file>
$ git pull

You can do a:

$ make apfXX_defconfig

to have the latest features automatically activated.

You have to do a make to rebuild binary files and then upload the binary files to your target.

Note: if definitively everything goes wrong while it worked before the last update. You can apply the following procedure (all your modifications in buildroot will be lost):

$ rm -rf buildroot/
$ rm Makefile
$ git pull
$ make apfXX_defconfig
$ make

Enjoy!