-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·101 lines (87 loc) · 1.72 KB
/
install.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
#!/bin/bash
LOCAL_INSTALL=1
INSTALL_PATH="/usr"
COMMON_DEPS="fio stress-ng"
BOARD_TYPE=""
display_usage()
{
echo
echo "Helios4/Helios64 Test Suite Installer"
echo
echo "Usage: $(basename $0) < -b | --board> <board_type>"
echo " valid board_type:"
echo " helios4"
echo " helios64"
echo ""
echo "Example: $(basename $0) -b helios4"
echo " $(basename $0) --board helios64"
}
board_install()
{
local SRC_LIBS SRC_SBINS DEPS
case $BOARD_TYPE in
"helios4")
DEPS="$COMMON_DEPS"
SRC_LIBS="helios4-testapp"
SRC_SBINS="helios4_test tastorage"
;;
"helios64")
DEPS="$COMMON_DEPS iperf evtest cpufrequtils mesa-utils glmark2"
SRC_LIBS="helios64-testapp"
SRC_SBINS="helios64_test tastorage64 tagpu tanet"
;;
*)
exit
;;
esac
echo "Installing Dependencies"
apt-get update
apt-get install -y $DEPS
[[ $LOCAL_INSTALL -ne 1 ]] || INSTALL_PATH="/usr/local"
for lib in $SRC_LIBS ; do
cp -frv lib/$lib "$INSTALL_PATH/lib/"
done
for bin in $SRC_SBINS ; do
cp -frv sbin/$bin "$INSTALL_PATH/sbin/"
done
}
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root/superuser!"
exit 1
fi
# Check board type parameter
if [ "$#" -gt 0 ]; then
OPTIONS=$(getopt -o "b:h" -l "board:,help" -- "$@")
[[ $? -eq 0 ]] || ( display_usage; exit 1 )
eval set -- "$OPTIONS"
while [ ! -z "$1" ]
do
case "$1" in
-b | --board )
echo "board type $2"
case "$2" in
"helios4" | "helios64")
BOARD_TYPE=$2
board_install
break
;;
*)
echo "invalid board type"
exit 1
;;
esac
;;
-h | --help)
display_usage
exit 0
;;
*)
exit 1
;;
esac
shift
done
else
display_usage
exit 1
fi