-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoit.sh
More file actions
executable file
·58 lines (43 loc) · 1.39 KB
/
doit.sh
File metadata and controls
executable file
·58 lines (43 loc) · 1.39 KB
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
#!/bin/bash
#This script gets kicked off upon docker container startup and will use the
#key which is within the $DEPLOY_ENV variable as a substitute for the value
#of PI in the TIME_OF_FREE_FALL.agc ROM file. We are using the Comanche055
#Version of the AGC ROM which flew/ran on the Apollo 11 Command Module.
#
cd virtualagc/Comanche055
#Put a random number of variables/padding so the address of PI is not always the same
RANGE=5
FLOOR=1
number=0
number=0 #initialize
while [ "$number" -le $FLOOR ]
do
number=$RANDOM
let "number %= $RANGE" # Scales $number down within $RANGE.
done
for (( c=1; c<=$number; c++ ))
do
sed -i '/RTMUM/ {a\
PI'"$c"' 2DEC 3.0 B-4
}' TIME_OF_FREE_FALL.agc
done
if [ -z "${DEPLOY_ENV}" ]; then
NEW_VAL="PI/16 2DEC 3.241592653 B-4"
else
NEW_VAL="PI/16 2DEC 3.${DEPLOY_ENV} B-4"
fi
echo ${NEW_VAL}
ORIG_VAL="3.141592653 B-4"
sed -i "/$ORIG_VAL/c $NEW_VAL" TIME_OF_FREE_FALL.agc
#compile the new code and produce and html symbol file
../yaYUL/yaYUL --html MAIN.agc
#replace the AGC ROM
cp MAIN.agc.bin Comanche055.bin
#no idea why it needs to be copied here, but this allows us to avoid a complete rebuild
cp MAIN.agc.bin ../VirtualAGC/temp/lVirtualAGC/Resources/source/Comanche055/Comanche055.bin
cd ..
#re-make everything
#make
cd yaAGC
bash
#./yaAGC --core="../Comanche055/Comanche055.bin" --port=19697 --cfg="../yaDSKY/src/LM.ini" --cfg=../yaDSKY2/CM.ini