-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller_run.sh
81 lines (69 loc) · 1.87 KB
/
installer_run.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
#!/bin/bash
# -------------------------------------------------------
# Copyright (c) 2020-2022 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
# -------------------------------------------------------
# This script runs the installer
#
# Pre-requisites:
# - bash shell (for Windows: install git for Windows)
usage() {
echo "Usage:"
echo " $(basename $0) [<TestOutput> <args>]"
echo ""
}
if [ $# -eq 0 ]; then
echo "error: no argument passed"
usage
exit 1
fi
# arguments
for i in "$@"
do
case "$i" in
--testoutput=*)
testoutdir="${i#*=}"
shift
;;
*)
args+="$i "
;;
esac
done
if [ ! -d "${testoutdir}" ]; then
echo "error: directory ${testoutdir} does not exist"
exit 1
fi
# check if CI_CBUILD_INSTALLER is set
if [ -z ${CI_CBUILD_INSTALLER+x} ]; then
echo "error: CI_CBUILD_INSTALLER is not set"
exit 1
fi
echo "Using installer: ${CI_CBUILD_INSTALLER}"
installer="${CI_CBUILD_INSTALLER}"
install_config=install_config.def
> ${install_config}
echo "${testoutdir}/Installation" > ${install_config}
if [[ `uname -s` != "Linux" && `uname -s` != "Darwin" ]]
then
# windows
echo "/$(echo $CMSIS_PACK_ROOT | sed -e 's/\\/\//g' -e 's/://g')" >> ${install_config}
echo "/$(echo $AC6_TOOLCHAIN_ROOT | sed -e 's/\\/\//g' -e 's/://g')" >> ${install_config}
echo "/$(echo $GCC_TOOLCHAIN_ROOT | sed -e 's/\\/\//g' -e 's/://g')" >> ${install_config}
echo "/$(echo $IAR_TOOLCHAIN_ROOT | sed -e 's/\\/\//g' -e 's/://g')" >> ${install_config}
else
echo "$CMSIS_PACK_ROOT" >> ${install_config}
echo "$AC6_TOOLCHAIN_ROOT" >> ${install_config}
echo "$GCC_TOOLCHAIN_ROOT" >> ${install_config}
echo "$IAR_TOOLCHAIN_ROOT" >> ${install_config}
fi
cat ${install_config}
# Run cbuild installer
dos2unix ${install_config}
"${installer}" ${args} -a "${CI_ARCH}" < ${install_config}
if [ $? -ne 0 ]
then
exit 1
fi
exit 0