-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathvagrant-bootstrap.sh
59 lines (47 loc) · 1.95 KB
/
vagrant-bootstrap.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
sudo apt-get update
# Initial build dependencies and packages are taken from:
# https://github.com/S2E/s2e/blob/master/Dockerfile#L35
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get -y install build-essential cmake wget texinfo flex bison \
python-dev python3-dev python3-venv python3-distro mingw-w64 lsb-release
sudo apt-get update
sudo apt-get -y install libdwarf-dev libelf-dev libelf-dev:i386 \
libboost-dev zlib1g-dev libjemalloc-dev nasm pkg-config \
libmemcached-dev libpq-dev libc6-dev-i386 binutils-dev \
libboost-system-dev libboost-serialization-dev libboost-regex-dev \
libbsd-dev libpixman-1-dev libncurses5 \
libglib2.0-dev libglib2.0-dev:i386 python3-docutils libpng-dev \
gcc-multilib g++-multilib gcc-9 g++-9
# Additional requirement required by clang
sudo apt-get install libtinfo5
# install git repo;
# 20.04 does only provide it as snap package, we opt in for manual installation
mkdir -p ~/.bin
PATH="${HOME}/.bin:${PATH}"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
chmod a+rx ~/.bin/repo
# setup env and directories
mkdir -p uemu/build
export uEmuDIR=$PWD/uemu
cd $uEmuDIR
~/.bin/repo init -u https://github.com/MCUSec/manifest.git -b uEmu
~/.bin/repo sync
# fix permissions
chmod +x $uEmuDIR/s2e/libs2e/configure
# get ptracearm.h
sudo wget -P /usr/include/x86_64-linux-gnu/asm \
https://raw.githubusercontent.com/MCUSec/uEmu/main/ptracearm.h
# start build process
cd $uEmuDIR/build && make -f $uEmuDIR/Makefile
sudo make -f $uEmuDIR/Makefile install
cd $uEmuDIR/AFL
make
sudo make install
# Set up environment for new connections
echo "export uEmuDIR=$uEmuDIR" >> ~/.bashrc
# Installation done, get all repositories
cd $uEmuDIR
git clone https://github.com/MCUSec/uEmu-unit_tests.git
git clone https://github.com/MCUSec/uEmu-real_world_firmware.git