blob: 518e6c9a716cbe7f08f5570f67c7b94e95a6ca0e [file] [log] [blame]
Fathi Boudra9e402bf2019-12-05 11:16:41 +02001#!/bin/bash
2
3sudo apt update -q=2
4sudo apt install -q=2 --yes --no-install-recommends build-essential device-tree-compiler git libssl-dev
5
Fathi Boudra7975ca72020-01-28 16:48:40 +02006# FIXME workaround clone_repos.sh script when using gerrit
7unset GERRIT_PROJECT
8unset GERRIT_BRANCH
9unset GERRIT_REFSPEC
10
Fathi Boudra9e402bf2019-12-05 11:16:41 +020011set -ex
12
13if [ -z "${WORKSPACE}" ]; then
14 ## Local build
15 export WORKSPACE=${PWD}
16fi
17
18# Toolchain from Arm Developer page: https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloads
19TC_URL="https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/8.3-2019.03/binrel"
20# Toolchain from Linaro Releases: https://releases.linaro.org/components/toolchain/binaries
21#TC_URL="https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/aarch64-linux-gnu/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.tar.xz"
22#TC_URL="https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/arm-linux-gnueabihf/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz"
23
24# AArch64 little-endian (aarch64-linux-gnu) compiler
25cd ${WORKSPACE}
26curl -sLSO -C - ${TC_URL}/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz
27tar -Jxf gcc-arm-*-x86_64-aarch64-linux-gnu.tar.xz
28cd ${WORKSPACE}/gcc-arm-*-x86_64-aarch64-linux-gnu/bin
29export PATH=${PWD}:${PATH}
30aarch64-linux-gnu-gcc --version
31
32# AArch32 bare-metal (arm-eabi) compiler
33cd ${WORKSPACE}
34curl -sLSO -C - ${TC_URL}/gcc-arm-8.3-2019.03-x86_64-arm-eabi.tar.xz
35tar -Jxf gcc-arm-*-x86_64-arm-eabi.tar.xz
36cd ${WORKSPACE}/gcc-arm-*-x86_64-arm-eabi/bin
37export PATH=${PWD}:${PATH}
38arm-eabi-gcc --version
39
40# Additional binaries required (rootfs, etc...)
41mkdir -p \
42 ${WORKSPACE}/nfs/downloads/linaro/18.04 \
43 ${WORKSPACE}/nfs/downloads/mbedtls
44cd ${WORKSPACE}/nfs/downloads/linaro/18.04
45curl -sLSO -C - https://releases.linaro.org/openembedded/juno-lsk/15.09/lt-vexpress64-openembedded_minimal-armv8-gcc-4.9_20150912-729.img.gz
46curl -sLSO -C - https://releases.linaro.org/openembedded/aarch64/17.01/linaro-image-minimal-genericarmv8-20170127-888.rootfs.tar.gz
47wget -q -c -m -A .zip -np -nd https://releases.linaro.org/members/arm/platforms/19.06/
48for file in $(ls *.zip); do
49 unzip -q ${file} -d $(basename ${file} .zip)
50done
51cd ${WORKSPACE}/nfs/downloads/mbedtls
52curl -sLSO -C - https://tls.mbed.org/download/start/mbedtls-2.16.0-apache.tgz
53cp -a mbedtls-2.16.0-apache.tgz mbedtls-2.16.0.tar.gz
54
55cd ${WORKSPACE}
56
57# Path to root of CI repository
58ci_root="${WORKSPACE}/tf-a-ci-scripts"
59
60export nfs_volume="${WORKSPACE}/nfs"
61export tfa_downloads="file://${nfs_volume}/downloads"
62
63# Mandatory workspace
64export workspace="${workspace:-${WORKSPACE}/workspace}"
65
66# During feature development, we need incremental build, so don't run
67# 'distlcean' on every invocation.
68export dont_clean="${dont_clean:-1}"
69
70# During feature development, we typically only build in debug mode.
71export bin_mode="${bin_mode:-debug}"
72
73# Local paths to TF and TFTF repositories
74export tf_root="${tf_root:-${WORKSPACE}/trusted-firmware-a}"
75export tftf_root="${tftf_root:-${WORKSPACE}/tf-a-tests}"
76
77# We'd need to see the terminals during development runs, so no need for
78# automation.
79export test_run="${test_run:-1}"
80
81# Run this script bash -x, and it gets passed downstream for debugging
82if echo "$-" | grep -q "x"; then
83 bash_opts="-x"
84fi
85
86bash $bash_opts "$ci_root/script/run_local_ci.sh"
87
88cp -a $(find ${workspace} -type d -name artefacts) ${WORKSPACE}/