This note explains how to setup an Ubuntu PC for FmcAdc100M14b4cha production
test suite.

Ubuntu installation & setup
========================================
Download and install ubuntu 14.04.
   user: user
   pw  : baraka
Set date & time.
Auto-hide the launcher (system settings>appearance>behavior).
Disable 'Lock' and 'Require my password when waking from suspend' (system settings>brightness&lock).


Connect to CERN network
========================================
Connect to a portable socket.
Open a web browser and declare the MAC address on the cern network.


Install missing packages
========================================
sudo apt-get install emacs
sudo apt-get install git
sudo apt-get install gitk
sudo apt-get install python-scipy
sudo apt-get install python-matplotlib
sudo apt-get install libusb-dev

Optional:
sudo apt-get install openssh-server
sudo /etc/init.d/ssh restart


Improve barcode reader speed (model: CR1421)
========================================
Download: http://www.codecorp.com/assets/download/D006284-CR1000-CR1400-CR8000--Configuration-Guide.pdf
Print page 13.
Scan "Enable Alternative OS (Windows CE/MAC/Unix/Linux)" QrCode.


Install & configure PTS + dependencies
========================================
cd ~
git clone git://ohwr.org/misc/pts.git pts/
cd pts
git checkout fmcadc100m14b4cha_dev

cd ~/pts/gnurabbit/
make
cd kernel
sudo make install

cd ~/pts/gnurabbit/python
make

mkdir ~/pts/test/fmcadc100m14b4cha/firmwares
cd ~/pts/test/fmcadc100m14b4cha/firmwares
wget http://www.ohwr.org/attachments/download/2830/spec-fmc-adc-v4.0.bin .
ln -s spec-fmc-adc-v4.0.bin spec_fmcadc100m14b4cha.bin

cd ~/pts/test/fmcadc100m14b4cha/python/
tar -xf Pyro4-4.10.tar.gz
cd Pyro4-4.10
chmod +x setup.py
sudo python setup.py install

cd ~
git clone git://ohwr.org/usb-relay-box1.git usb-relay-box1/
cd usb-relay-box1/sw/cp210x-driver/
git checkout 3.13.0-24-generic
make
sudo make install

cd ~
git clone git://ohwr.org/hdl-core-lib/fpga-config-space.git fpga-config-space/
cd fpga-config-space/sdbfs/userspace/
make
cd /usr/bin
sudo ln -s ~/fpga-config-space/sdbfs/userspace/gensdbfs gensdbfs
sudo ln -s ~/fpga-config-space/sdbfs/userspace/sdb-read sdb-read
sudo ln -s ~/fpga-config-space/sdbfs/userspace/sdb-extract sdb-extract

cd ~/pts/test/fmceeprom/python/libipmi/
make


Make PTS run at startup
========================================
cd ~
touch run_pts.sh
chmod +x run_pts.sh
echo '#!/bin/sh' >> run_pts.sh
echo 'echo " "' >> run_pts.sh
echo 'echo " "' >> run_pts.sh
echo 'echo "********************************************************************************"' >> run_pts.sh
echo 'echo "*                      FmcAdc100M14b4cha Test program                          *"' >> run_pts.sh
echo 'echo "********************************************************************************"' >> run_pts.sh
echo 'echo " "' >> run_pts.sh
echo 'cd ~/pts && sudo ./fmcadc100m14b4cha.sh' >> run_pts.sh

Go to Dash
Enter "startup applications"
Launch Startup Applications
Add
Name   : fmc-adc-pts
Command: gnome-terminal --maximize -e "/home/user/run_pts.sh"
Comment: Launch fmc-adc production tests
