-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo4.sh
executable file
·84 lines (64 loc) · 1.85 KB
/
demo4.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
#!/bin/bash
PWD=`pwd`
DEMO_DIR="demo4"
EXECS="demo"
if [ -z "$1" ];then
echo " Specify the compute node # you want to copy the executables"
echo " or enter 'all' in order to copy them to all compute nodes"
exit
fi
if [ -d $DEMO_DIR ]; then
rm -rf $DEMO_DIR;
fi
mkdir -p $DEMO_DIR/$EXECS
cd $DEMO_DIR
git clone https://github.com/armoredsoftware/protocolImplementation.git
git clone https://github.com/armoredsoftware/xenVchan.git
git clone https://github.com/armoredsoftware/tpmEmulator.git
cd xenVchan
git checkout tags/v0.4
cd ..
cd tpmEmulator
git checkout tags/v0.4
cd ..
cd protocolImplementation
git checkout tags/v0.4
for i in outerappraiser outerattester; do
cd $i;
cabal sandbox init;
cabal sandbox add-source ../../tpmEmulator ../../xenVchan/VChanUtil ../shared/bytestringJSON ../shared ../appraisal ../attestation ../protoMonad ../negotiationtools
# run one in background
if [ "$i" == "outerappraiser" ];then
cabal install --dependencies-only &
else
cabal install --dependencies-only
fi
cd ..
done
cd outerappraiser
cabal build
cd ..
cd outerattester
cabal build
cd ..
cd certificateAuthority
cabal sandbox init;
cabal sandbox add-source ../../tpmEmulator ../../xenVchan/VChanUtil ../shared/bytestringJSON ../shared ../protoMonad
cabal install --dependencies-only
cabal build
cd ..
cp outerattester/dist/build/outerAttester/outerAttester ../$EXECS
cp outerappraiser/dist/build/outerAppraiser/outerAppraiser ../$EXECS
cp certificateAuthority/dist/build/CA/CA ../$EXECS
ln -s ../$EXECS/outerAttester ../$EXECS/Attester
ln -s ../$EXECS/outerAppraiser ../$EXECS/Appraiser
cd ../../
cp includedFiles/common/* $DEMO_DIR/$EXECS
cp -r includedFiles/demo4/* $DEMO_DIR/$EXECS
cd $PWD
# cp exectuables to every vm
if [ "$1" != "all" ];then
utils/cpScript.sh $DEMO_DIR/$EXECS $1
else
utils/cpScript.sh $DEMO_DIR/$EXECS
fi