summaryrefslogtreecommitdiff
path: root/automated/android/workload-automation/aep-install.sh
blob: 5cb41047befaf0844f121946a8f2a27bb04d929a (plain)
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
#!/bin/sh -ex
# shellcheck disable=SC1090

TEST_DIR=$(dirname "$(realpath "$0")")
OUTPUT="${TEST_DIR}/output"
SKIP_INSTALL="false"
AEP_REPOSITORY="https://git.linaro.org/tools/arm-probe.git"
AEP_REF="master"

usage() {
    echo "Usage: $0 [-t <aep_repository_ref>] [-r <aep_repository>]" 1>&2
    exit 1
}

while getopts ":t:r:" opt; do
    case "${opt}" in
        t) AEP_REF="${OPTARG}" ;;
        r) AEP_REPOSITORY="${OPTARG}" ;;
        *) usage ;;
    esac
done

. "${TEST_DIR}/../../lib/sh-test-lib"

! check_root && error_msg "Please run this test as root."
cd "${TEST_DIR}"
create_out_dir "${OUTPUT}"
RESULT_FILE="${OUTPUT}/result.txt"
export RESULT_FILE

if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
    info_msg "Dependency installation skipped"
else
    PKGS="git autoconf libtool cmake zlib1g-dev libssl-dev python"
    install_deps "${PKGS}"
fi
git clone "${AEP_REPOSITORY}" arm-probe
cd arm-probe
git checkout "${AEP_REF}"
./autogen.sh
./configure --prefix=/usr
make
make install
report_pass "AEP installed"