Common instruction to prepare a bootable usb stick for scu

  • featuring etherbone, saftlib, pcie kernel driver, fesl, silecs, ...

  • For me the ethernet controller was renamed from eth0 to eth1, resulting in a wrong configuration in /etc/network/interfaces
    • make sure that firmware-realtek is installed ! (
    • Check dmesg | grep 'Ethernet'
    • Check ifconfig eth0
    • Check ifconfig eth1
    • Rename eth0 to eth1 in /etc/network/interfaces
    • Check if you can ping the SCU
    • Stefan Rauch owns a SCU which has an VGA-Output .. use it for debugging if there are problems

change /etc/ssh/sshd_config
PermitRootLogin yes

etherbone / saftlib

apt-get install linux-headers-4.9.0-4-rt-amd64 linux-image-4.9.0-4-rt-amd64 lsb-core xsltproc pkg-config libglibmm-2.4-dev socat autoconf libtool libreadline-dev ntp
// Note: ntp is needed for git certificates ( see here https://stackoverflow.com/a/32433922/1599887 ) // Note: eb / saftlib needs a rt-kernel ! // Remove the old non-rt kernel

// TODO: check if saft / eb as well compiles without this lib .. it pulls alot of stuff which is not realy needed
apt-get install docbook-utils

// Manual can be found here: https://www-acc.gsi.de/wiki/Timing/TimingSystemNodesCurrentRelease
git clone https://github.com/GSI-CS-CO/bel_projects.git
cd bel_projects
git checkout cherry
./fix-git.sh

Apply patch to wishbone, so it works with 4.x kernel
wget https://www-acc.gsi.de/wiki/pub/Frontend/CreateDebianUSBStick/0001-wishbone-changes-for-kernel-3.19.patch
patch ip_cores/fpga-config-space/pcie-wb/wishbone.c < 0001-wishbone-changes-for-kernel-3.19.patch

make etherbone
make PREFIX=/ etherbone-install
make saftlib
make PREFIX=/ saftlib-install
make tools
make PREFIX=/ tools-install

// Install pci-express driver for wishbone - TODO: check if "make install" + "reboot" is sufficient ?
cd /root/bel_projects/ip_cores/fpga-config-space/pcie-wb
make
make install
reboot

touch /lib/systemd/system/saftlib.service
[Unit]
Description=saftlib daemon
After=ntp.service

[Service]
Type=forking
TimeoutSec=10
ExecStart=/usr/local/sbin/saftd baseboard:dev/wbm0
ExecStop=/usr/local/bin/saft-ctl baseboard quit
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Note: "saftd" seems to be in /usr/local/sbin, no matter which if PREFIX is set

@Detlev Penza: Thanks for the Fix!

In order to get the saft daemon automatically started after boot:
systemctl enable saftlib.service

fesl

apt-get install libboost-all-dev
cd /root
svn checkout --username schwinn https://www-acc.gsi.de/svn/fesa/device/driver/feSupport/trunk feSupport

cd /root/feSupport
make test/SIS100InjKickerModuleCLI NUMBER_CORES=3 EB_HOME=/ SAFT_PATH=/lib SYSTEM_LIB=lib/x86_64-linux-gnu TIMING_CONFIGURATION_INCL=-I/root/feSupport/feSupport/utility

silecs

apt-get install libxml2-dev libcurl4-openssl-dev wget

cd /root
svn checkout --username schwinn https://www-acc.gsi.de/svn/fesa/cmw/makefiles/trunk generic-makefiles

git clone https://:@gitlab.cern.ch:8443/aschwinn/silecs.git
cd /root/silecs
git checkout gsi-2.0.2_centOS7

cd /root/silecs/snap7
./build.sh

cd /root/silecs/silecs-communication-cpp
make -j4 COMMON_MAKE_PATH=/root/generic-makefiles SNAP7_BASE=../snap7/snap7-full

cd /root/silecs/silecs-cli-client
make -j4 COMMON_MAKE_PATH=/root/generic-makefiles SILECS_COMM_HOME=../silecs-communication-cpp/build SNAP7_BASE=../snap7/snap7-full

Add for SIS100 Kicker control stuff

cd /root
mkdir SIS100Kicker
scp schwinn@asl744.acc.gsi.de:/home/bel/schwinn/lnx/workspace-silecs-neon/SIS100InjKickerDU/controllerConfig_sent_to_ampegon.scl SIS100Kicker
scp schwinn@asl744.acc.gsi.de:/home/bel/schwinn/lnx/workspace-silecs-neon/SIS100InjKickerDU/generated/client/tsts7001.silecsparam SIS100Kicker
scp schwinn@asl744.acc.gsi.de:/home/bel/schwinn/lnx/workspace-silecs-neon/SIS100InjKickerDU/generated/controller/tsts7001.scl SIS100Kicker
scp schwinn@asl744.acc.gsi.de:/home/bel/schwinn/lnx/workspace-silecs-neon/SIS100InjKickerDU/src/SIS100InjKickerDU.silecsdeploy SIS100Kicker
scp -r schwinn@asl744.acc.gsi.de:/home/bel/schwinn/lnx/workspace-silecs-neon/SIS100InjKickerDU/cli SIS100Kicker

ln -s /root/SIS100Kicker/cli/getDevice.sh /bin/silecs_get_device
ln -s /root/SIS100Kicker/cli/getBlock.sh /bin/silecs_get_block
ln -s /root/SIS100Kicker/cli/getRegister_periodic.sh /bin/silecs_get_register_periodic
ln -s /root/feSupport/test/SIS100InjKickerModuleCLI /bin/SIS100InjKickerModuleCLI

Backup the usb stick to disc

It may happen that
  • The stick gets old ( read/write cycles are limited )
  • Somebody coorrupts the stick / breaks the OS

So it is a good idea to backup the data:
  • Either via dd : Like that. Either overnight, or use usb3
  • Or via rsync ( better if you plan to persist later changes )

This topic: Frontend > CreateDebianUSBStickCommon
Topic revision: 13 Jun 2018, AlexanderSchwinn
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback