-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreate_bootstrap.sh
More file actions
executable file
·67 lines (52 loc) · 1.36 KB
/
create_bootstrap.sh
File metadata and controls
executable file
·67 lines (52 loc) · 1.36 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
59
60
61
62
63
64
65
66
67
#!/bin/sh
TARGET_ERTS_VSN=5.7.4
CURRENT_BOOTSTRAPPER_VSN="V10"
# exit with a nice message on a function failure.
or_exit() {
if [ "$1" != "0" ];then
echo "\$? = $1"
echo $2
exit $1
fi
}
if [ "$1" = "help" ];then
echo "$0 [path_to_erlang]"
exit 0
fi
if [ "$#" = "1" ];then
ERTS_PATH=$1
else
echo ""
echo "Please enter a path to erts. [/usr/local/lib/erlang/erts-$TARGET_ERTS_VSN] $> \c"
read ERTS_PATH
fi
if [ "$ERTS_PATH" = "" ];then
ERTS_PATH="/usr/local/lib/erlang/erts-$TARGET_ERTS_VSN"
fi
echo "Path to Erts: $ERTS_PATH"
ERTS_VSN=$(basename $ERTS_PATH | sed 's/erts-//')
if [ "$ERTS_VSN" != "$TARGET_ERTS_VSN" ];then
echo "Erts version must be $TARGET_ERTS_VSN. You supplied $ERTS_VSN."
exit 1
fi
mkdir erlware
cd erlware
cp ../bootstrap.tar.gz .
tar -zxf bootstrap.tar.gz
rm bootstrap.tar.gz
INSTALLED_ERTS_PATH="./erts-$ERTS_VSN"
cp -r $ERTS_PATH $INSTALLED_ERTS_PATH; or_exit $? "erts copy failed"
rm $INSTALLED_ERTS_PATH/bin/dialyzer
rm $INSTALLED_ERTS_PATH/bin/erl
tar -zcf contents.tar.gz *
mv contents.tar.gz ..
cd -
rm -rf erlware
MACHINE=$(uname -m | sed 's/ /-/')
KERNEL=$(uname -s | sed 's/ /-/')
KERNEL_VSN=$(uname -r | sed -e 's;-.*;;')
FILENAME=faxien-launcher-$MACHINE-$KERNEL-$KERNEL_VSN-$CURRENT_BOOTSTRAPPER_VSN.sh
cat header.txt > $FILENAME
cat contents.tar.gz >> $FILENAME
rm contents.tar.gz
echo "done creating $FILENAME"