FPGARM4ULinux machine setup
From Fpga4u
Contents
Developer Debian machine setup
Setup the machine
First, the development machine has to be installed.
Get a new computer or a virtual machine. In this tutorial, VMWare (http://www.vmware.com) will be used.
Get the last version of GNU/Linux Debian (www.debian.org), Etch when this tutorial was wrote.
During the setup of the virtual machine, choose : Linux 2.6, Use bridged networking, 4G disk size (allocate all disk space now).
The virtual machine will
- use 512 MB of RAM;
- not use the floppy drive;
- not use the sound;
- use all the processors of the host machine;
- use the ISO file of GNU/Linux Debian as CD-ROM drive (this drive will be removed after the installation).
When the machine boots, type :
expert hw-detect/start_pcmcia=false bootkbd=fr_CH
Then choose :
- Language : English GB (UTF8)
- Keyboard : Swiss French
- Load installer component from CD : choose-mirror
- Configure the network : DHCP, hostname : FPGARM4U-Debian
- Mirror : http, Switzerland, Switch
- Partition disk : guided (use entire space), all files in one partition
- Setup users and passwords : allow shadow passwords, allow login as root, root password : fpgarm4u, do not create another user
- Install the base system : linux-image-2.6-686
- Configure the package manager : use a network mirror, http, Switzerland, Switch, do not use non-free or contrib software
- Select and install software : deselection Desktop environment
- Install GRUB
You can now remove the CD-ROM drive (deactivation with the icon on the bottom right part of the screen) and reboot the machine.
Update to SID
Etch does not support either GCC4.2 or GCC4.3. We are going to update the system to SID for having GCC4.3.
Firstly, get an IP address.
# dhclient
Secondly, edit the /etc/apt/sources.list file for removing the CD-ROM. Then, update the system (etch) before updating to SID.
# vi /etc/apt/sources.list # apt-get update # apt-get upgrade
When the system is ready to be updated to SID, edit once again the /etc/apt/sources.list file.
# vi /etc/apt/sources.list
The file should look like the two lines below. The security updates are not necessary for SID.
deb http://mirror.switch.ch/ftp/mirror/debian/ unstable main deb-src http://mirror.switch.ch/ftp/mirror/debian/ unstable main
Do the update.
# apt-get update # apt-get dist-upgrade
Install some useful programs for later.
# apt-get install vim screen ssh unzip make gcc flex bison bzip2 build-essential kernel-package libncurses5-dev debootstrap pmount
Reboot for using the last kernel that came with SID.
Setup the cross-toolchain
Execute the line below for adding a new repository to the /etc/apt/sources.list file.
# echo "deb http://www.emdebian.org/debian/ unstable main" >> /etc/apt/sources.list
Import the repository key.
# gpg --keyserver hkp://subkeys.pgp.net --recv-keys B5B7720097BB3B58 # gpg --export --armor B5B7720097BB3B58 | apt-key add -
Update the list of the packages
# apt-get update
and look for the toolchain.
# apt-cache search arm-linux-gnu
Choose the most recent packet which has a name like g++-4.*-arm-linux-gnu and install it. When the tutorial was wrote, it was the version 4.3 for GCC4.3.
# apt-get install g++-4.3-arm-linux-gnu
Get the setup files to the system
Get the file fpgarm4u_utility.tar.bz2 on the machine. You can either send it from the Windows machine into the root repertory of the development machine (/root) using an SFTP client or download it from the FPGARM4U wiki page.
If you would like to send the file from the Windows machine, the IP address of the development machine can be found by executing the following command.
# ifconfig
If you would rather download it, you can do it with this command.
# wget http://fpga4u.epfl.ch/images/FPGARM4U_distribution/fpgarm4u_utility.tar.bz2
Then, untar the archive.
# tar xjf fpgarm4u_utility.tar.bz2
Make the final repertory.
# mkdir /root/final
Setup TFTP server
If you will use the autonomous system (with a USB key), you do not need to follow this part.
Install the nfs and the tftpboot servers to be able to download the kernel to the FPGARM4U board at boot time and to export a Network File System for the FPGARM4U GNU/Linux operating system.
# apt-get install nfsboot nfs-kernel-server tftpd-hpa
Create the repertory where the kernel will be put.
# mkdir /srv/kernel
Configure the tftpd-hpa package to have a ready tftpboot server. Set the /etc/default/tftp-hpa file as
RUN_DAEMON="yes" OPTION="-l -s /srv/kernel"
Restart the daemon.
# /etc/init.d/tftpd-hpa start
The kernel will be copied in /srv/kernel directory later.
Setup NFS server
Install the NFS server software to make available the Root File System to the FPGARM4U boards.
# apt-get install nfs-kernel-server nfs-common portmap
Create the rfs directory in the /srv/ path if it does not exist yet.
# mkdir /srv/rfs
Add the line below to the /etc/exports file.
/srv/rfs/ <ip_client>(rw,no_root_squash,sync)
For updating the NFS server, execute the command below.
# exportfs -a
The server is ready. The installation will be finalized when the Root File System is configured.