blob: 05deacd469f661dccb78f9640a4c843348df01d5 [file] [log] [blame]
Leonardo Sandoval9dfdd1b2020-08-06 17:08:11 -05001#!/usr/bin/env bash
Fathi Boudra422bf772019-12-02 11:10:16 +02002#
laurenw-arm92881b92024-03-28 12:57:42 -05003# Copyright (c) 2019-2024, Arm Limited. All rights reserved.
Fathi Boudra422bf772019-12-02 11:10:16 +02004#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8# This file is meant to be SOURCED only after setting $ci_root. $ci_root must be
9# the absolute path to the root of the CI repository
10#
11# A convenient way to set ci_root from the calling script like this:
12# ci_root="$(readlink -f "$(dirname "$0")/..")"
13#
14
Chris Kay197b1022023-08-16 21:31:41 +010015set -ETe -o pipefail
16
Fathi Boudra422bf772019-12-02 11:10:16 +020017# Accept root of CI location from $CI_ROOT or $ci_root, in that order
18ci_root="${ci_root:-$CI_ROOT}"
19ci_root="${ci_root:?}"
20
Chris Kay197b1022023-08-16 21:31:41 +010021source "${ci_root}/backtrace.sh" && trap backtrace ERR
Harrison Mutai9b099892023-01-13 11:34:36 +000022source "${ci_root}/lava_utils.sh"
23
Sandrine Bailleuxaaaffe02020-08-07 11:15:55 +020024# Optionally source a file containing environmental settings.
25if [ -n "$host_env" ]; then
26 source "$host_env"
27else
28 # Are we running on Arm infrastructure?
Gary Morrison999a9d72022-03-14 18:29:06 -050029 if echo "$JENKINS_URL" | grep -q "oss.arm.com"; then
Sandrine Bailleuxaaaffe02020-08-07 11:15:55 +020030 source "$ci_root/arm-env.sh"
Chris Kay7c542f22022-11-18 11:42:59 +000031 elif echo "$JENKINS_URL" | grep -q "ci.trustedfirmware.org"; then
Paul Sokolovskyc90cb772023-07-31 14:28:41 +030032 if echo "$TF_GERRIT_BRANCH" | grep -q "lts-v2.8"; then
laurenw-arm8f595d02023-07-10 15:05:43 -050033 source "$ci_root/openci-lts-v2.8-env.sh"
laurenw-arm92881b92024-03-28 12:57:42 -050034 elif echo "$TF_GERRIT_BRANCH" | grep -q "lts-v2.10"; then
35 source "$ci_root/openci-lts-v2.10-env.sh"
laurenw-arm8f595d02023-07-10 15:05:43 -050036 else
37 source "$ci_root/openci-env.sh"
38 fi
Chris Kay73a91b02022-12-19 16:56:51 +000039 elif echo "$JENKINS_URL" | grep -q "ci.staging.trustedfirmware.org"; then
40 source "$ci_root/openci-staging-env.sh"
Sandrine Bailleuxaaaffe02020-08-07 11:15:55 +020041 fi
42fi
43
Fathi Boudra422bf772019-12-02 11:10:16 +020044# Storage area to host toolchains, rootfs, tools, models, binaries, etc...
45nfs_volume="${nfs_volume:-$NFS_VOLUME}"
46nfs_volume="${nfs_volume:?}"
47
48# Override workspace for local runs
49workspace="${workspace:-$WORKSPACE}"
50workspace="${workspace:?}"
51workspace="$(readlink -f "$workspace")"
52artefacts="$workspace/artefacts"
53
54# pushd and popd outputs the directory stack every time, which could be
55# confusing when shown on the log. Suppress its output.
56pushd() {
57 builtin pushd "$1" &>/dev/null
58}
59popd() {
60 builtin popd &>/dev/null
61}
62
63# Copy a file to the $archive directory
64archive_file() {
65 local f out target md5
66 f="${1:?}"
67
68 out="${archive:?}"
69 [ ! -d "$out" ] && die "$out is not a directory"
70
71 target="$out/$(basename $f)"
72 if [ -f "$target" ]; then
73 # Prevent same file error
74 if [ "$(stat --format=%i "$target")" = \
75 "$(stat --format=%i "$f")" ]; then
76 return
77 fi
78 fi
79
80 md5="$(md5sum "$f" | awk '{print $1}')"
81 cp -t "$out" "$f"
82 echo "Archived: $f (md5: $md5)"
83}
84
85die() {
86 [ "$1" ] && echo "$1" >&2
87 exit 1
88}
89
90# Emit environment variables for the purpose of sourcing from shells and as
91# Jenkins property files. Whether the RHS is quoted depends on "$quote".
92emit_env() {
93 local env_file="${env_file:?}"
94 local var="${1:?}"
95
96 # Value parameter is mandatory, but allow for it to be empty
97 local val="${2?}"
98
99 if upon "$quote"; then
100 val="\"$val\""
101 else
102 # If RHS is not required to be quoted, any white space in it
103 # won't go well with a shell sourcing this file.
104 if echo "$var" | grep -q '\s'; then
105 die "$var: value '$val' has white space"
106 fi
107 fi
108
109 echo "$var=$val" >> "$env_file"
110}
111
Fathi Boudra422bf772019-12-02 11:10:16 +0200112fetch_directory() {
113 local base="$(basename "${url:?}")"
114 local sa
115
Fathi Boudradd31e7b2020-01-29 15:44:42 +0200116 case "${url}" in
117 http*://*)
118 # Have exactly one trailing /
119 local modified_url="$(echo "${url}" | sed 's#/*$##')/"
Fathi Boudra422bf772019-12-02 11:10:16 +0200120
Fathi Boudradd31e7b2020-01-29 15:44:42 +0200121 # Figure out the number of components between hostname and the
122 # final one
123 local cut_dirs="$(echo "$modified_url" | awk -F/ '{print NF - 5}')"
124 sa="${saveas:-$base}"
125 echo "Fetch: $modified_url -> $sa"
laurenw-arm2d62c712022-09-13 14:27:15 -0500126 wget -rq -nH --cut-dirs="$cut_dirs" --no-parent -e robots=off \
Fathi Boudradd31e7b2020-01-29 15:44:42 +0200127 --reject="index.html*" "$modified_url"
128 if [ "$sa" != "$base" ]; then
129 mv "$base" "$sa"
130 fi
131 ;;
132 file://*)
133 sa="${saveas:-.}"
134 echo "Fetch: ${url} -> $sa"
135 cp -r "${url#file://}" "$sa"
136 ;;
137 *)
138 sa="${saveas:-.}"
139 echo "Fetch: ${url} -> $sa"
140 cp -r "${url}" "$sa"
141 ;;
142 esac
Fathi Boudra422bf772019-12-02 11:10:16 +0200143}
144
145fetch_file() {
146 local url="${url:?}"
147 local sa
148 local saveas
149
150 if is_url "$url"; then
Fathi Boudra422bf772019-12-02 11:10:16 +0200151 saveas="${saveas-"$(basename "$url")"}"
Sandrine Bailleux3da4bd12020-08-06 16:18:36 +0200152 sa="${saveas+-o $saveas}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200153 echo "Fetch: $url -> $saveas"
154 # Use curl to support file protocol
Paul Sokolovsky532a4882023-05-22 15:50:04 +0300155 curl --fail --no-progress-meter --connect-timeout 10 --retry 6 -LS $sa "$url"
Fathi Boudra422bf772019-12-02 11:10:16 +0200156 else
157 sa="${saveas-.}"
158 echo "Fetch: $url -> $sa"
159 cp "$url" "$sa"
160 fi
161}
162
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100163fetch_and_archive() {
164 url=${url:?}
165 filename=${filename:-basename $url}
166
167 url="$url" saveas="$filename" fetch_file
168 archive_file "$filename"
169}
170
171filter_artefacts(){
172 local model_param_file="${model_param_file-$archive/model_params}"
173
174 # Bash doesn't have array values, we have to create references to the
175 # array of artefacts and the artefact filters.
176 declare -ga "$1"
177 declare -n artefacts="$1"
178 declare -n filters="$2"
179
180 for artefact in "${!filters[@]}"; do
181 if grep -E -q "${filters[${artefact}]}" "$model_param_file"; then
182 artefacts+=("${artefact}")
183 fi
184 done
185}
186
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100187# Generate link to an archived binary.
188gen_bin_url() {
189 local bin_mode="${bin_mode:?}"
190 local bin="${1:?}"
191
192 if upon "$jenkins_run"; then
193 echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/$bin"
194 else
195 echo "file://$workspace/artefacts/$bin_mode/$bin"
196 fi
197}
198
Harrison Mutaid993ce12023-03-27 13:21:28 +0100199get_boot_image() {
200 local image=${image:?}
201 local type=${type:?}
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100202
Harrison Mutaid993ce12023-03-27 13:21:28 +0100203 declare -n image_list=${image_list-${image}_list}
204
205 local url="${image_list[${type}]}"
206
207 url="${url:?}" filename="${image}.bin" fetch_and_archive
Harrison Mutaia197d5d2022-09-15 13:45:21 +0100208}
209
Harrison Mutaid993ce12023-03-27 13:21:28 +0100210get_boot_image_from_fip() {(
211 local url="${url:?}"
212 local image="${image:?}"
213 local output_name="${output_name-bl32.bin}"
214
215 cd "$(mktempdir)"
216
217 extract_fip "$url"
218 mv "$image" "$output_name"
219 archive_file "$output_name"
220)}
221
Chris Kay03ffbe72022-11-17 18:53:50 +0000222# Get the path to the run environment variables file.
223#
224# Run environment variables are the test-specific environment variables
225# configured by the CI's test configuration.
226#
227# Usage: get_run_env_path <archive>
228get_run_env_path() {
229 echo "${1:?}/run/env"
230}
231
232# Get a run environment variable.
233#
234# Run environment variables are the test-specific environment variables
235# configured by the CI's test configuration.
236#
237# Usage: get_run_env <archive> <variable> [default]
238get_run_env() {
239 if [ -f "$(get_run_env_path "${1:?}")" ] && [ ! -v "${2:?}" ]; then
240 . "$(get_run_env_path "${1:?}")"
241 fi
242
243 echo "${!2:-${3}}"
244}
245
246# Get the number of UARTs configured by the current test configuration. This
247# defaults to `4`.
248#
249# Usage: get_num_uarts <archive> [default]
250get_num_uarts() {
251 local default=4
252
253 get_run_env "${1:?}" num_uarts "${2-${default}}"
254}
255
256# Get the ports script configured by the current test configuration. This
257# defaults to `script/default-ports-script.awk`.
258#
259# Usage: get_ports_script <archive> [default]
260get_ports_script() {
261 local default="${ci_root}/script/default-ports-script.awk"
262
263 get_run_env "${1:?}" ports_script "${2-${default}}"
264}
265
266# Get the primary UART configured by the current test configuration. This
267# defaults to `0`.
268#
269# Usage: get_primary_uart <archive> [default]
270get_primary_uart() {
271 local default=0
272
273 get_run_env "${1:?}" primary_uart "${2-${default}}"
274}
275
276# Get the payload UART configured by the current test configuration. This
277# defaults to the primary UART.
278#
279# Usage: get_payload_uart <archive> [default]
280get_payload_uart() {
281 local default="$(get_primary_uart "${1:?}")"
282
283 get_run_env "${1:?}" payload_uart "${2-${default}}"
284}
285
286# Get the path to a UART's environment variable directory.
287#
288# UART environment variables are the UART-specific environment variables
289# configured by the CI's test configuration.
290#
291# Usage: get_uart_env_path <archive> <uart>
292get_uart_env_path() {
293 echo "${1:?}/run/uart${2:?}"
294}
295
296# Get a UART environment variable.
297#
298# UART environment variables are the UART-specific environment variables
299# configured by the CI's test configuration.
300#
301# Usage: get_uart_env <archive> <uart> <variable> [default]
302get_uart_env() {
303 if [ ! -v "${3:?}" ] && [ -f "$(get_uart_env_path "${1:?}" "${2:?}")/${3:?}" ]; then
304 cat "$(get_uart_env_path "${1:?}" "${2:?}")/${3:?}"
305 else
Chris Kayfab6edc2022-11-17 19:18:32 +0000306 echo "${!3-${4}}"
Chris Kay03ffbe72022-11-17 18:53:50 +0000307 fi
308}
309
310# Get the path to the Expect script for a given UART. This defaults to nothing.
311#
312# Usage: get_uart_expect_script <archive> <uart> [default]
313get_uart_expect_script() {
314 local default=
315
316 get_uart_env "${1:?}" "${2:?}" expect "${3-${default}}"
317}
318
319# Get the FVP port for a given UART. This defaults to `5000 + ${uart}`.
320#
321# Usage: get_uart_port <archive> <uart> [default]
322get_uart_port() {
323 local default="$(( 5000 + "${2:?}" ))"
324
325 get_uart_env "${1:?}" "${2:?}" port "${3-${default}}"
326}
327
Chris Kay24d039f2022-11-23 12:53:30 +0000328# Set a UART environment variable.
329#
330# UART environment variables are the UART-specific environment variables
331# configured by the CI's test configuration.
332#
333# Usage: set_uart_env <archive> <uart> <variable> <value>
334set_uart_env() {
335 local path="$(get_uart_env_path "${1:?}" "${2:?}")"
336
337 mkdir -p "${path}" && \
338 echo "${4:?}" > "${path}/${3:?}"
339}
340
341# Set the FVP port for a given UART.
342#
343# Usage: set_uart_port <archive> <uart> <port>
344set_uart_port() {
345 set_uart_env "${1:?}" "${2:?}" port "${3:?}"
346}
347
Fathi Boudra422bf772019-12-02 11:10:16 +0200348# Make a temporary directory/file insdie workspace, so that it doesn't need to
349# be cleaned up. Jenkins is setup to clean up workspace before a job runs.
350mktempdir() {
351 local ws="${workspace:?}"
352
353 mktemp -d --tmpdir="$ws"
354}
355mktempfile() {
356 local ws="${workspace:?}"
357
358 mktemp --tmpdir="$ws"
359}
360
361not_upon() {
362 ! upon "$1"
363}
364
365# Use "$1" as a boolean
366upon() {
367 case "$1" in
368 "" | "0" | "false") return 1;;
369 *) return 0;;
370 esac
371}
372
373# Check if the argument is a URL
374is_url() {
375 echo "$1" | grep -q "://"
376}
377
378# Check if a path is absolute
379is_abs() {
380 [ "${1:0:1}" = "/" ]
381}
382
383# Unset a variable based on its boolean value
384# If foo=, foo will be unset
385# If foo=blah, then leave it as is
386reset_var() {
387 local var="$1"
388 local val="${!var}"
389
390 if [ -z "$val" ]; then
391 unset "$var"
392 else
393 var="$val"
394 fi
395}
396
397default_var() {
398 local var="$1"
399 local val="${!var}"
400 local default="$2"
401
402 if [ -z "$val" ]; then
403 eval "$var=$default"
404 fi
405}
406
407# String various items joined by ":" to form a path. Items are prepended by
408# default; or 'op' can be set to 'append' to have them appended.
409# For example, to set: PATH=foo:bar:baz:$PATH
410extend_path() {
411 local path_var="$1"
412 local array_var="$2"
Leonardo Sandoval2af93202020-07-16 17:29:18 -0500413 local path_val="${!path_var}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200414 local op="${op:-prepend}"
Leonardo Sandoval2af93202020-07-16 17:29:18 -0500415 local sep=':'
416 local array_val
Fathi Boudra422bf772019-12-02 11:10:16 +0200417
Leonardo Sandoval2af93202020-07-16 17:29:18 -0500418 eval "array_val=\"\${$array_var[@]}\""
419 array_val="$(echo ${array_val// /:})"
420
421 [ -z "$path_val" ] && sep=''
422
423 if [ "$op" = "prepend" ]; then
424 array_val="${array_val}${sep}${path_val}"
425 elif [ "$op" = "append" ]; then
426 array_val="${path_val}${sep}${array_val}"
427 fi
428
429 eval "$path_var=\"$array_val\""
Fathi Boudra422bf772019-12-02 11:10:16 +0200430}
431
Chris Kay3d807882022-08-31 16:00:02 +0100432# Expand and evaluate Bash variables and expressions in a file, whose path is
433# given by the first parameter.
434#
435# For example, to expand a file containing the following:
436#
437# My name is ${name}!
438#
439# You might use:
440#
441# name="Chris" expand_template "path-to-my-file.txt"
442#
443# This would yield:
444#
445# My name is Chris!
446#
447# If you need to run multiple expansions on a file (e.g. to fill out information
448# incrementally), then you can escape expansion of a variable with a backslash,
449# e.g. `\${name}`.
450#
451# The expanded output is printed to the standard output stream.
452expand_template() {
453 local path="$1"
454
455 eval "cat <<-EOF
456 $(<${path})
457 EOF"
458}
459
Harrison Mutai013f6332022-02-16 16:06:33 +0000460# Fetch and extract the latest supported version of the LLVM toolchain from
461# a compressed archive file to a target directory, if it is required.
462setup_llvm_toolchain() {
463 link="${1:-$llvm_archive}"
464 archive="${2:-"$workspace/llvm.tar.xz"}"
465 target_dir="${3:-$llvm_dir}"
466
467 if is_arm_jenkins_env || upon "$local_ci"; then
468 url="$link" saveas="$archive" fetch_file
469 mkdir -p $target_dir
470 extract_tarball $archive $target_dir --strip-components=1 -k
471 fi
472}
473
474# Extract files from compressed archive to target directory. Supports .zip,
475# .tar.gz, and tar.xf format
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500476extract_tarball() {
477 local archive="$1"
478 local target_dir="$2"
Leonardo Sandovalec9e16c2020-09-09 14:32:40 -0500479 local extra_params="${3:-}"
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500480
481 pushd "$target_dir"
482 case $(file --mime-type -b "$archive") in
483 application/gzip)
Leonardo Sandovalec9e16c2020-09-09 14:32:40 -0500484 tar -xz $extra_params -f $archive
Zelalem219df412020-05-17 19:21:20 -0500485 ;;
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500486 application/zip)
Leonardo Sandovalec9e16c2020-09-09 14:32:40 -0500487 unzip -q $extra_params $archive
Zelalem219df412020-05-17 19:21:20 -0500488 ;;
Harrison Mutai013f6332022-02-16 16:06:33 +0000489 application/x-xz)
490 tar -x $extra_params -f $archive
491 ;;
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500492 esac
Zelalem219df412020-05-17 19:21:20 -0500493 popd "$target_dir"
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500494}
495
Gary Morrison999a9d72022-03-14 18:29:06 -0500496# See if execution is done by Jenkins. If called with a parameter,
497# representing a 'domain', e.g. arm.com, it will also check if
Leonardo Sandoval795b6212020-08-14 16:20:00 -0500498# JENKINS_URL contains the latter.
499is_jenkins_env () {
500 local domain="${1-}"
501
502 # check if running under Jenkins, if not, return non-zero
503 # the checks assumes Jenkins executing if JENKINS_HOME is set
504 [ -z "$JENKINS_HOME" ] && return 1
505
506 # if no parameter passed, no more checks, quit
507 [ -z "$domain" ] && return 0
508
509 if echo "$JENKINS_URL" | grep -q "$domain"; then
510 return 0
511 fi
512
513 return 1
514}
515
516
517# Check if execution is under ARM's jenkins
518is_arm_jenkins_env() {
519 local arm_domain="arm.com"
520 return $(is_jenkins_env "$arm_domain")
521}
522
Leonardo Sandovalfeae3a22020-11-17 16:53:59 -0600523
524# Provide correct linaro cross toolchain based on environment
525set_cross_compile_gcc_linaro_toolchain() {
526 local cross_compile_path="/home/buildslave/tools"
527
528 # if under arm enviroment, overide cross-compilation path
Madhukar Pappireddy21a5e672021-03-08 17:49:45 -0600529 is_arm_jenkins_env || upon "$local_ci" && cross_compile_path="/arm/pdsw/tools"
Leonardo Sandovalfeae3a22020-11-17 16:53:59 -0600530
531 echo "${cross_compile_path}/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-"
532}
533
Leonardo Sandoval795b6212020-08-14 16:20:00 -0500534if is_jenkins_env; then
Fathi Boudra422bf772019-12-02 11:10:16 +0200535 jenkins_run=1
536 umask 0002
537else
538 unset jenkins_run
539fi
540
541# Project scratch location for Trusted Firmware CI
542project_filer="${nfs_volume}/projectscratch/ssg/trusted-fw"
543project_scratch="${PROJECT_SCRATCH:-$project_filer/ci-workspace}"
544warehouse="${nfs_volume}/warehouse"
545jenkins_url="${JENKINS_URL%/*}"
546jenkins_url="${jenkins_url:-https://ci.trustedfirmware.org/}"
547
548# Model revisions
Govindraj Raja02e14fa2024-06-18 13:34:17 -0500549model_version_11_24="${model_version:-11.24}"
550model_build_11_24="${model_build:-24}"
551
Govindraj Raja8962c452024-06-04 14:50:28 -0500552model_version="${model_version:-11.26}"
553model_build="${model_build:-11}"
Maksims Svecovs5c542512022-03-29 10:13:05 +0100554model_flavour="${model_flavour:-Linux64_GCC-9.3}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200555
556# Model snapshots from filer are not normally not accessible from developer
557# systems. Ignore failures from picking real path for local runs.
558pinned_cortex="$(readlink -f ${pinned_cortex:-$project_filer/models/cortex})" || true
559pinned_css="$(readlink -f ${pinned_css:-$project_filer/models/css})" || true
560
Fathi Boudra422bf772019-12-02 11:10:16 +0200561tforg_gerrit_url="review.trustedfirmware.org"
562
563# Repository URLs. We're using anonymous HTTP as they appear to be faster rather
564# than any scheme with authentication.
Fathi Boudra422bf772019-12-02 11:10:16 +0200565tf_src_repo_url="${tf_src_repo_url:-$TF_SRC_REPO_URL}"
566tf_src_repo_url="${tf_src_repo_url:-https://$tforg_gerrit_url/TF-A/trusted-firmware-a}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200567tftf_src_repo_url="${tftf_src_repo_url:-$TFTF_SRC_REPO_URL}"
568tftf_src_repo_url="${tftf_src_repo_url:-https://$tforg_gerrit_url/TF-A/tf-a-tests}"
Jimmy Brisson29ca0a02020-09-22 16:15:35 -0500569ci_src_repo_url="${ci_src_repo_url:-$CI_SRC_REPO_URL}"
570ci_src_repo_url="${ci_src_repo_url:-https://$tforg_gerrit_url/ci/tf-a-ci-scripts}"
Zelalemdd655272020-10-06 16:29:05 -0500571tf_ci_repo_url="$ci_src_repo_url"
Fathi Boudra422bf772019-12-02 11:10:16 +0200572scp_src_repo_url="${scp_src_repo_url:-$SCP_SRC_REPO_URL}"
Girish Pathak97f7ad42020-08-27 11:38:15 +0100573scp_src_repo_url="${scp_src_repo_url:-$scp_src_repo_default}"
Olivier Deprez965a7792019-12-16 14:09:03 +0100574spm_src_repo_url="${spm_src_repo_url:-$SPM_SRC_REPO_URL}"
575spm_src_repo_url="${spm_src_repo_url:-https://$tforg_gerrit_url/hafnium/hafnium}"
Jimmy Brisson0d5e12c2023-05-16 14:51:51 -0500576tf_m_tests_src_repo_url="${tf_m_tests_src_repo_url:-$TF_M_TESTS_REPO_URL}"
577tf_m_tests_src_repo_url="${tf_m_tests_src_repo_url:-https://$tforg_gerrit_url/TF-M/tf-m-tests}"
578tf_m_extras_src_repo_url="${tf_m_extras_src_repo_url:-$TF_M_EXTRAS_REPO_URL}"
579tf_m_extras_src_repo_url="${tf_m_extras_src_repo_url:-https://$tforg_gerrit_url/TF-M/tf-m-extras}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200580
Leonardo Sandovald98f8332021-04-13 16:46:38 -0500581tf_downloads="${tf_downloads:-file:///downloads/}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200582tfa_downloads="${tfa_downloads:-file:///downloads/tf-a}"
583css_downloads="${css_downloads:-$tfa_downloads/css}"
584
Chris Kay52b8d432023-04-27 16:10:57 +0100585# SCP/MCP release binaries.
Ryan Everett3836c6d2024-10-09 17:03:39 +0100586scp_mcp_downloads="${scp_mcp_downloads:-$tfa_downloads/css_scp_2.15.0}"
Alexei Fedorov9e4473d2020-11-04 10:13:07 +0000587
Leonardo Sandoval15676062020-11-19 11:58:09 -0600588linaro_2001_release="${linaro_2001_release:-$tfa_downloads/linaro/20.01}"
Alexei Fedorove405cc32020-09-30 18:13:55 +0100589linaro_release="${linaro_release:-$linaro_2001_release}"
Ryan Everett69845de2024-09-13 11:52:23 +0100590mbedtls_version="${mbedtls_version:-3.6.1}"
Zelalem219df412020-05-17 19:21:20 -0500591
Madhukar Pappireddy4b686cf2020-03-31 13:05:14 -0500592# mbedTLS archive public hosting available at github.com
Govindraj Raja827823f2023-02-28 14:19:00 +0000593mbedtls_archive="${mbedtls_archive:-https://github.com/Mbed-TLS/mbedtls/archive/mbedtls-${mbedtls_version}.tar.gz}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200594
Harrison Mutai013f6332022-02-16 16:06:33 +0000595# FIXME: workaround to allow all on-prem host machines to access the latest LLVM
596# LLVM archive public hosting available at github.com
597llvm_version="${llvm_version:-14.0.0}"
598llvm_dir="$workspace/llvm-$llvm_version"
599llvm_archive="${llvm_archive:-https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvm_version/clang+llvm-$llvm_version-x86_64-linux-gnu-ubuntu-18.04.tar.xz}"
600
Mark Dykes30138ad2021-11-09 16:48:17 -0600601coverity_path="${coverity_path:-${nfs_volume}/tools/coverity/static-analysis/2020.12}"
Fathi Boudra422bf772019-12-02 11:10:16 +0200602coverity_default_checkers=(
603"--all"
604"--checker-option DEADCODE:no_dead_default:true"
Fathi Boudra422bf772019-12-02 11:10:16 +0200605"--enable AUDIT.SPECULATIVE_EXECUTION_DATA_LEAK"
Zelalem219df412020-05-17 19:21:20 -0500606"--enable ENUM_AS_BOOLEAN"
Fathi Boudra422bf772019-12-02 11:10:16 +0200607"--enable-constraint-fpp"
Fathi Boudra422bf772019-12-02 11:10:16 +0200608"--ticker-mode none"
Zelalem219df412020-05-17 19:21:20 -0500609"--hfa"
Fathi Boudra422bf772019-12-02 11:10:16 +0200610)
611
Leonardo Sandovald76d1e22020-10-06 16:02:52 -0500612docker_registry="${docker_registry:-}"
613
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500614# Define toolchain version and toolchain binary paths
Jayanth Dodderi Chidanand3feb2992024-09-30 18:11:54 +0100615toolchain_version="13.3.rel1"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500616
Jayanth Dodderi Chidanandcc4d2342022-09-12 14:44:21 +0100617aarch64_none_elf_dir="${nfs_volume}/pdsw/tools/arm-gnu-toolchain-${toolchain_version}-x86_64-aarch64-none-elf"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500618aarch64_none_elf_prefix="aarch64-none-elf-"
619
Jayanth Dodderi Chidanandcc4d2342022-09-12 14:44:21 +0100620arm_none_eabi_dir="${nfs_volume}/pdsw/tools/arm-gnu-toolchain-${toolchain_version}-x86_64-arm-none-eabi"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500621arm_none_eabi_prefix="arm-none-eabi-"
622
Fathi Boudra422bf772019-12-02 11:10:16 +0200623path_list=(
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500624 "${aarch64_none_elf_dir}/bin"
625 "${arm_none_eabi_dir}/bin"
Harrison Mutai013f6332022-02-16 16:06:33 +0000626 "${llvm_dir}/bin"
Leonardo Sandoval1c24ae52020-07-08 11:47:23 -0500627 "${nfs_volume}/pdsw/tools/gcc-arm-none-eabi-5_4-2016q3/bin"
628 "$coverity_path/bin"
Fathi Boudra422bf772019-12-02 11:10:16 +0200629)
630
631ld_library_path_list=(
632)
633
Sandrine Bailleuxa6a1d6e2020-08-07 10:24:17 +0200634license_path_list=${license_path_list-(
635)}
Fathi Boudra422bf772019-12-02 11:10:16 +0200636
637# Setup various paths
638if upon "$retain_paths"; then
639 # If explicitly requested, retain local paths; apppend CI paths to the
640 # existing ones.
641 op="append" extend_path "PATH" "path_list"
642 op="append" extend_path "LD_LIBRARY_PATH" "ld_library_path_list"
643 op="append" extend_path "LM_LICENSE_FILE" "license_path_list"
644else
645 # Otherwise, prepend CI paths so that they take effect before local ones
646 extend_path "PATH" "path_list"
647 extend_path "LD_LIBRARY_PATH" "ld_library_path_list"
648 extend_path "LM_LICENSE_FILE" "license_path_list"
649fi
650
651export LD_LIBRARY_PATH
652export LM_LICENSE_FILE
Fathi Boudra422bf772019-12-02 11:10:16 +0200653export ARM_TOOL_VARIANT=ult
654
655# vim: set tw=80 sw=8 noet: