====== Installation of the build environment ======
===== Required disk storage =====
The toolchain and the BSP require approximately 4 GB of disk space:
^ Directory ^ Required space ^
| /opt | ca. 2GB |
| /home | ca. 2GB |
===== Preparation =====
==== Installation of additional packages ====
=== Required packages ===
At least the following packages should be installed:
* //patch// - Apply a diff file to an original
* //ncurses-dev// - Unit Testing Library for C (ncurses) -- development files
* //tftpd-hpa// - HPA's tftp server
* //subversion// - Advanced version control system
* //nfs-kernel-server// - support for NFS kernel server
* //fakeroot// - Gives a fake root environment
* //unix2dos//, //tofrodos// - Converts DOS <-> Unix text files
In Ubuntu or Debian you can install these packages with this command:
sudo apt-get install patch libncurses5-dev tftpd-hpa subversion nfs-kernel-server fakeroot tofrodos
The NFS server has to be enabled:
sudo update-rc.d nfs-kernel-server enable
sudo service nfs-kernel-server start
=== Recommended packages ===
* //meld// - graphical tool to diff and merge files
* //geany//, //geany-plugins// - A fast and lightweight IDE
* //tftp-hpa// - HPA's tftp client
* //glibc-doc// - GNU C Library: Documentation
* //manpages-posix//, //manpages-posix-dev// - Manual pages about using a POSIX system (for development)
sudo apt-get install meld geany geany-plugins tftp-hpa glibc-doc manpages-posix manpages-posix-dev
==== Changing the symlink /bin/sh ====
In **Ubuntu** or **Debian** the symbolic link ///bin/sh// has to be changed to call ///bin/bash//:
sudo ln -sf /bin/bash /bin/sh
==== Configuration of sudo ====
//Sudo// should preferably be configured in such a way, that the required environment variables are adopted. Therefore the following line should be added to the file ///etc/sudoers//:
Defaults env_keep += "PATH ELDK ELDKDIR RFS_TOP SYSTOPDIR GCC_PATH LIB_BASE CROSS_COMPILE"
===== Software working copy =====
Get your working copy from the subversion repository:
svn co --username https://svn.reccoware.de/tq/system/trunk tq
Falls noch kein Benutzername (////) für Sie eingerichtet wurde, wenden Sie sich bitte an Ihren Ansprechpartner bei TQ
If you don't already have a user account (////), please ask your contact at TQ.
The following question should be answered with //'p'// like permanent:
Error validating server certificate for 'https://svn.reccoware.de:443
...
Certificate information:
- Hostname: recconet.de
- Valid: from Mon, 13 Jun 2011 04:09:50 GMT until Thu, 14 Jun 2012 12:59:52 GMT
- Issuer: Domain Validated SSL, GeoTrust Inc., US
- Fingerprint: f5:d4:31:b8:db:15:60:71:f1:11:d2:61:55:b4:21:11:ca:3e:61:8d
(R)eject, accept (t)emporarily or accept (p)ermanently?
Afterwards just interrupt by pressing //Ctrl-C// in order to reconfigure subversion. The current version 1.6 of the subversion client uses the gnome password manager to store the password. This can cause problems with the Eclipse SVN plug-in.
To avoid this set the parameter //password-stores// in section //[auth]// of the subersion config file //.subversion/config// to //(empty)//:
nano ~/.subversion/config
[auth]
password-stores =
This only has to be done once.
Now start subversion once again:
svn co --username https://svn.reccoware.de/tq/system/trunk tq
Answer the question //"Store password unencrypted"// with //"yes"//.
Finally change to directory //tq// and store the absolute path of the working copy directory in the shell variable //$TOPDIR//.
cd tq; TOPDIR=$(pwd)
The variable //$TOPDIR// now contains the top level directory of the build environment. It is required for the following steps.
===== Network boot via TFTP =====
Usually the TFTP root directory on the server is ///var/lib/tftpboot//. The Linux kernel image //uImage// should be stored in a directory named after the IP address of the target, e.g.:
/var/lib/tftpboot/172.16.135.170/uImage
The following variables in the U-Boot environment have to be set or customised:
^ Name ^ Description ^ Default value ^
| ipaddr | Target IP address | 172.16.135.170 |
| serverip | Server IP address (TFTP and NFS) | 172.16.135.107 |
| gatewayip | Gateway IP address | 172.16.135.254 |
| netmask | Netmask | 255.255.255.0 |
| kernel | Filename of kernel image on TFTP server | 172.16.135.170/uImage |
| bootcmd | Default boot command \\ (set to //run boot_net_debian// for network boot) | run boot_mmc |
After customising the variables, permanently save the environment to flash using the command //saveenv//.
Example:
setenv ipaddr 192.168.145.129
setenv serverip 192.168.145.8
setenv gatewayip 192.168.145.254
setenv netmask 255.255.255.0
setenv kernel $ipaddr/uImage
setenv bootcmd run boot_net_debian
saveenv
===== Root file system ("rootfs") =====
The archive of the Debian rootfilesystem tree is available here:
* [[en:sys:downloads#debian_root-filesystem_archiv|Debian Rootfilesystem]] (rootfs-squeeze-yyyymmdd-nn.tgz)
Download the rootfs to //tmp///, extract it and set up as follows:
rfsarch=rootfs-squeeze-yyyymmdd-nn.tgz
pushd /tmp; wget http://repository.reccoware.de/stuff/tq0412/$rfsarch; popd
cd $TOPDIR
mkdir -p rootfs
sudo tar -C rootfs -xzf /tmp/$rfsarch
rm -f rootfs/debian; ln -s tqma28.squeeze rootfs/debian
===== Share rootfs via NFS =====
sudo -s
ipaddr=
mkdir -p /exports/rootfs/$ipaddr
ln -s $TOPDIR/rootfs/debian /exports/rootfs/$ipaddr/debian
echo "/exports/rootfs/$ipaddr/debian $ipaddr(rw,no_root_squash,async,no_subtree_check)" >>/etc/exports
exportfs -a
exit
Replace //// with the actual IP address of the targets.
===== Launch Debian rootfs =====
The Debian System can be launched from U-Boot using
run boot_net_debian
The very first run will take a while untill the X11 system shows up on the screen (2-3 minutes).
The root password is //root//. The debian system can also be accessed via SSH.
===== Installation of the ELDK =====
The ELDK ISO image is available for download from http://repository.reccoware.de/stuff/tq0412/arm-2008-11-24.iso.
==== Donwloading and Installing the ELDK ====
pushd /tmp; wget http://repository.reccoware.de/stuff/tq0412/arm-2008-11-24.iso; popd
sudo mount -o loop,ro /tmp/arm-2008-11-24.iso /mnt
pushd /mnt; sudo ./install -d /opt/eldk; popd
sudo umount /mnt
It is recommended to answer //'y'// when asked //"Do you really want to install into /opt/eldk directory[y/n]?:"//.
The error message //"error: failed to stat .../.gvfs: Permission denied"// is not critical.
==== Prepare the ELDK ====
cd $TOPDIR/build
source setenv-eldk
sudo ./setup-eldk-toolchain.sh
==== Prepare the build environment ====
cd $TOPDIR; make prepare
===== Environment =====
To automatically set the alias //tq// every time you login, you can add the following line to //.bashrc//:
cat >>~/.bashrc <
Now you can change to the //tq// directory by executing //tq//. Additionally the environment is properly configured for cross compiling.
----
FIXME: Testing required for Ubuntu, validated to work on Fedora 14