The program python3
should be at least Python 3.7 (tested with Python 3.7.3).
Run the following commands.
- general
sudo apt install git sudo apt install screen sudo apt install dnsutils ethtool sudo apt install rsync sudo apt install vbetool
- python (install for all, is something like this needed?
umask 022
)sudo apt install python3-pip sudo pip3 install nanpy sudo pip3 install pyserial
- OpenOCD
sudo apt install make gcc sudo apt install libtool autotools-dev automake pkg-config sudo apt install libusb-dev libusb-1.0-0-dev libusb-1.0-doc sudo apt install libhidapi-dev sudo apt install libftdi-dev
- xc3sprog (FPGA programmer)
sudo apt install cmake libftdi1-dev
Run the following commands:
{EMBEXP-BOX}/tools/box_server/compile_openocd.sh
{EMBEXP-BOX}/tools/box_server/compile_xc3sprog.sh
-
Fix the IP of the server. This has to be done at least for the experiment network interface. (for Raspbian additionally: Switch to standard Debian networking.)
- Determine interface names with
ip a
. - Adjust
/etc/network/interfaces
.# The primary network interface allow-hotplug enp6s0 iface enp6s0 inet static address 192.168.51.44 netmask 255.255.255.0 gateway 192.168.51.254 # address 130.237.224.32 # netmask 255.255.255.0 # gateway 130.237.224.1 # The experiment network interface allow-hotplug enx00e04c680037 iface enx00e04c680037 inet static address 192.168.0.254 netmask 255.255.255.0
- Raspbian:
sudo systemctl disable dhcpcd
- Raspbian:
sudo systemctl enable networking
- Raspbian:
sudo reboot
- Adjust
/etc/resolv.conf
. See below.nameserver 127.0.0.1 nameserver 8.8.8.8
sudo chattr +i /etc/resolv.conf
- Determine interface names with
-
Disable IPv6.
- Raspbian: Adjust
sudo nano /boot/cmdline.txt
.- Add this at the end of the command line
ipv6.disable=1
- Add this at the end of the command line
- Debian: Adjust
/etc/sysctl.conf
.- Add
net.ipv6.conf.all.disable_ipv6 = 1
and then runsudo sysctl -p
- Add
- Raspbian: Adjust
-
Configure SSH daemon to use keep alive messages.
- Adjust
/etc/ssh/sshd_config
.TCPKeepAlive yes KeepAlive yes ClientAliveInterval 60 ClientAliveCountMax 10
- Adjust
-
Install and setup dnsmasq for DNS and DHCP.
sudo apt update
sudo apt install dnsmasq tcpdump
- Disable dnsmasq interfering with DNS resolution.
sudo rm /etc/resolvconf/update.d/dnsmasq
sudo reboot
- Create dnsmasq config. Also, to disable dnsmasq on the interface to the internet, only on our experiment network!
sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
echo | sudo tee /etc/dnsmasq.conf
- Adjust
/etc/dnsmasq.conf
. NOTICE: Make sure to fill in the internet interface for no-dhcp!no-dhcp-interface=enp6s0 #port=0 #dhcp-range=130.237.224.255,proxy dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h log-dhcp enable-tftp tftp-root=/tftpboot pxe-service=0,"Raspberry Pi Boot"
-
Create the TFTP directory.
sudo mkdir /tftpboot
sudo chmod 777 /tftpboot
sudo systemctl enable dnsmasq.service
sudo systemctl restart dnsmasq.service
-
Restart dnsmasq.
sudo systemctl restart dnsmasq
-
Prepare files in
/tftpboot
. SeeMAINTENANCE.md
.
-
Run the following commands.
sudo apt install nfs-kernel-server sudo systemctl enable rpcbind sudo systemctl restart rpcbind sudo systemctl enable nfs-kernel-server sudo systemctl restart nfs-kernel-server sudo mkdir /nfs sudo mkdir /nfs_master
-
Prepare root directories in
/nfs
, export them and use them as rootfs for Linux. SeeMAINTENANCE.md
.
-
Create the file
/etc/rc.local
if it does not exist and executechmod +x /etc/rc.local
. Otherwise, just add the two lines for selecting the experiment network interface and running the startup script in your file.#!/bin/sh -e # select experiment network interface #export EXPERIMENT_IF=enx00e04c680037 # line for the startup stript /opt/embexp-box/tools/startup/startup.sh # line for turning off the monitor (might be needed for open-standing laptops) #vbetool dpms off exit 0
-
Configure the firewall
- Configure the variable EXPERIMENT_IF to match your experiment network interface name. All traffic will be allowed for this interface!
- Adjust
{EMBEXP-BOX}/tools/startup/firewall.sh
. (Normally nothing extra needs to be done here.)
-
Notice: You may want to copy these startup files somewhere else and execute from there in order to better control modifications to it.
-
Create the devel group with
sudo groupadd devel
-
/etc/sudoers
# Group devel specification (e.g. allow 'sudo reboot') %devel ALL=NOPASSWD:/sbin/reboot
-
udev - user access to devices
sudo cp {EMBEXP-BOX}/tools/openocd/contrib/60-openocd.rules /etc/udev/rules.d/
sudo cp {EMBEXP-BOX}/config/openocd/60-embexp.rules /etc/udev/rules.d/
sudo cp {EMBEXP-BOX}/config/openocd/60-hikeyusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
and replug, orsudo reboot
-
Refer to
MAINTENANCE.md
for how to create new users.