-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup_experiments.sh
executable file
·35 lines (29 loc) · 1.06 KB
/
setup_experiments.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# 1) Install the ykush
sudo apt-get install -y libudev-dev
git submodule update --init deps/ykush
cd deps/ykush
./build.sh
sudo ./install.sh
cd ../../
# 2) fetch and install python dependencies
sudo pip2 install cement==2.10.2
sudo pip2 install boofuzz==0.0.11
sudo pip2 install numpy==1.14.1
sudo pip2 install pyelftools==0.24
sudo pip2 install tabulate==0.8.2
# 3) generate funcs.json from the debug symbols contained in expat_panda.elf
python2 ./scripts/debug_symbols.py ./binaries/expat_panda.elf
# 4) Let's add udev-rules, so that we can run the experiments without root
sudo sh -c 'cat > /etc/udev/rules.d/04-ykush.rules' << EOF
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f2f7", \\
MODE:="0666", \\
SYMLINK+="ykush_%n"
EOF
sudo sh -c 'cat > /etc/udev/rules.d/49-stlinkv2-1.rules' << EOF
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \\
MODE:="0666", \\
SYMLINK+="stlinkv2-1_%n"
EOF
sudo udevadm control --reload-rules
## 4.5) We need to be in the group dialout to access /dev/ttyUSB0
sudo adduser $USER dialout