-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·145 lines (108 loc) · 4.08 KB
/
setup.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
. global_exports.sh
clean_all () {
rm -rf tmp
rm -rf safefetch
rm -rf benchmarks
rm -rf ~/.phoronix-test-suite
sudo apt-get purge phoronix-test-suite
}
install_all () {
clean_all
echo "### Prepping installation..."
mkdir -p tmp
mkdir -p benchmarks
sudo apt-get install libntirpc-dev flex bison libelf-dev libssl-dev bc build-essential libncurses-dev coreutils
echo "### Cloning SafeFetch kernel..."
git clone ${SAFEFETCH_REPO}
echo "### Finished cloning Safefetch kernel..."
# Install LMBench benchmarking suite
echo "### Installing LMBench..."
cd tmp || exit
wget -q --no-check-certificate "https://downloads.sourceforge.net/project/lmbench/development/lmbench-3.0-a9/lmbench-3.0-a9.tgz"
tar -xf lmbench-3.0-a9.tgz
mv lmbench-3.0-a9 ../benchmarks/lmbench3
rm lmbench-3.0-a9.tgz
cd ../
echo "### Finished installing LMBench..."
echo "### Building LMBench..."
cd ./benchmarks/lmbench3 || exit
make -s build 2> lmbench_error.log
errors=$(cat lmbench_error.log | grep Error| wc -l)
rm lmbench_error.log
if [ $errors -ne 0 ]; then
echo "### Applying LMBench patch"
patch -p1 < ../../patches/lmbench.patch
make -s build 2> lmbench_error.log
errors=$(cat lmbench_error.log | grep Error| wc -l)
rm lmbench_error.log
if [ $errors -ne 0 ]; then
echo '### Failed to install LMBEnch (contact artifact owners)'
exit 1
fi
else
echo "### LMBench builds (no patch needed)"
fi
echo "### Configure LMBench..."
pwd
cd ./scripts || exit
printf "1\n1\n512\nOS\nno\n\n\n\n\nno\n" | ./config-run
cd ../../../ || exit
./configure_lmbench.sh
echo "### LMBench installed!"
# Install OSBench benchmarking suite
echo "### Installing OSBench...";
cd ./benchmarks || exit
# dependencies
sudo apt-get install meson ninja-build
# benchmark
git clone https://github.com/mbitsnbites/osbench.git;
cd osbench || exit;
mkdir -p out;
cd out || exit;
echo "### Building OSBench..."
meson --buildtype=release ../src
ninja
cd ../../../ || exit
echo "### OSBench installed!"
echo "### Installing phoronix benchmarking suite..."
cd tmp || exit
# dependencies
sudo apt-get install php-cli php-xml
wget -q --no-check-certificate "https://phoronix-test-suite.com/releases/repo/pts.debian/files/phoronix-test-suite_10.8.4_all.deb"
sudo dpkg -i ./phoronix-test-suite_10.8.4_all.deb
rm phoronix-test-suite_10.8.4_all.deb
cd ../
echo "### Installing phoronix required benchmarks..."
phoronix-test-suite install system/openssl
phoronix-test-suite install pts/pybench
phoronix-test-suite install pts/git
phoronix-test-suite install pts/apache
phoronix-test-suite install pts/nginx
phoronix-test-suite install pts/redis
phoronix-test-suite install pts/ipc-benchmark
echo "### Configuring phoronix benchmarks..."
printf "y\nn\nn\ny\nn\ny\nn\n" | phoronix-test-suite batch-setup
echo "### Phoronix benchmarking suite installed!"
echo '### Installing paper-results'
cd patches
cp -r phoronix/. ~/.phoronix-test-suite/test-results/.
cd ..
echo '### Finished installing paper-results'
echo "### Installing result aggregation and representation dependencies..."
# jpeg necessary for matplotlib
sudo apt install libjpeg-dev zlib1g-dev
pip3 install numpy matplotlib
echo '### Install pdflatex'
sudo apt-get install texlive-latex-base texlive-fonts-extra texlive-fonts-recommended texlive-bibtex-extra biber
cd tmp || exit
git clone [email protected]:wpengfei/CVE-2016-6516-exploit.git
cp -r './CVE-2016-6516-exploit/Scott Bauer' ./exploit_cve_2016_6516
mv ./exploit_cve_2016_6516 ../exploit_cve_2016_6516
rm -rf ./CVE-2016-6516-exploit
echo "### CVE-2016-6516 exploit installed!"
cd .. && rm -rf tmp
echo "### Installation complete!"
echo 0
}
install_all