Leonardo Sandoval | 9dfdd1b | 2020-08-06 17:08:11 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 2 | # |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 3 | # Copyright (c) 2020-2021, Arm Limited. All rights reserved. |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: BSD-3-Clause |
| 6 | # |
| 7 | |
| 8 | set -u |
| 9 | |
| 10 | bl1_addr="${bl1_addr:-0x0}" |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 11 | bl31_addr="${bl31_addr:-0x04001000}" |
Zelalem | 1b87461 | 2020-08-04 18:08:18 -0500 | [diff] [blame] | 12 | bl32_addr="${bl32_addr:-0x04003000}" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 13 | bl33_addr="${bl33_addr:-0x88000000}" |
| 14 | dtb_addr="${dtb_addr:-0x82000000}" |
| 15 | fip_addr="${fip_addr:-0x08000000}" |
| 16 | initrd_addr="${initrd_addr:-0x84000000}" |
| 17 | kernel_addr="${kernel_addr:-0x80080000}" |
| 18 | el3_payload_addr="${el3_payload_addr:-0x80000000}" |
| 19 | |
Manish Pandey | 3c43558 | 2020-07-15 12:14:26 +0100 | [diff] [blame] | 20 | # SPM requires following addresses for RESET_TO_BL31 case |
| 21 | spm_addr="${spm_addr:-0x6000000}" |
| 22 | spmc_manifest_addr="${spmc_addr:-0x0403f000}" |
| 23 | sp1_addr="${sp1_addr:-0x7000000}" |
| 24 | sp2_addr="${sp2_addr:-0x7100000}" |
Olivier Deprez | 0b83409 | 2020-08-21 08:36:01 +0200 | [diff] [blame] | 25 | sp3_addr="${sp3_addr:-0x7200000}" |
Manish Pandey | 1e7be85 | 2020-11-09 16:04:48 +0000 | [diff] [blame] | 26 | # SPM out directories |
| 27 | export spm_secure_out_dir="${spm_secure_out_dir:-secure_aem_v8a_fvp_clang}" |
| 28 | export spm_non_secure_out_dir="${spm_non_secure_out_dir:-aem_v8a_fvp_clang}" |
Manish Pandey | 3c43558 | 2020-07-15 12:14:26 +0100 | [diff] [blame] | 29 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 30 | ns_bl1u_addr="${ns_bl1u_addr:-0x0beb8000}" |
| 31 | fwu_fip_addr="${fwu_fip_addr:-0x08400000}" |
| 32 | backup_fip_addr="${backup_fip_addr:-0x09000000}" |
| 33 | romlib_addr="${romlib_addr:-0x03ff2000}" |
| 34 | |
| 35 | uboot32_fip_url="$linaro_release/fvp32-latest-busybox-uboot/fip.bin" |
| 36 | |
Alexei Fedorov | e405cc3 | 2020-09-30 18:13:55 +0100 | [diff] [blame] | 37 | rootfs_url="$linaro_release/lt-vexpress64-openembedded_minimal-armv8-gcc-5.2_20170127-761.img.gz" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 38 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 39 | # Default FVP model variables |
| 40 | default_model_dtb="fvp-base-gicv3-psci.dtb" |
| 41 | |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 42 | # FVP containers and model paths |
| 43 | fvp_arm_std_library="fvp:fvp_arm_std_library_${model_version}_${model_build};/opt/model/FVP_ARM_Std_Library/models/${model_flavour}" |
| 44 | fvp_base_revc_2xaemv8a="fvp:fvp_base_revc-2xaemv8a_${model_version}_${model_build};/opt/model/Base_RevC_AEMv8A_pkg/models/${model_flavour}" |
| 45 | foundation_platform="fvp:foundation_platform_${model_version}_${model_build};/opt/model/Foundation_Platformpkg/models/${model_flavour}" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 46 | |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 47 | # FVP associate array, run_config are keys and fvp container parameters are the values |
| 48 | # Container parameters syntax: <model name>;<model dir>;<model bin> |
| 49 | # FIXMEs: fix those ;;; values with real values |
| 50 | |
| 51 | declare -A fvp_models |
| 52 | fvp_models=( |
| 53 | [base-aemv8a-quad]=";;;" |
| 54 | [base-aemv8a-revb]=";;;" |
| 55 | [base-aemv8a-latest-revb]=";;;" |
| 56 | [base-aemva]=";;;" |
Manish V Badarkhe | e478383 | 2021-02-22 14:36:56 +0000 | [diff] [blame] | 57 | [base-aemv8a-gic600ae]=";;;" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 58 | [foundationv8]="${foundation_platform};Foundation_Platform" |
| 59 | [base-aemv8a]="${fvp_base_revc_2xaemv8a};FVP_Base_RevC-2xAEMv8A" |
| 60 | [cortex-a32x4]="${fvp_arm_std_library};FVP_Base_Cortex-A32x4" |
| 61 | [cortex-a35x4]="${fvp_arm_std_library};FVP_Base_Cortex-A35x4" |
| 62 | [cortex-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A53x4" |
Leonardo Sandoval | 95f896b | 2021-02-22 10:16:29 -0600 | [diff] [blame] | 63 | [cortex-a55x4-a75x4]="${fvp_arm_std_library};FVP_Base_Cortex-A55x4+Cortex-A75x4" |
| 64 | [cortex-a55x4-a76x2]="${fvp_arm_std_library};FVP_Base_Cortex-A55x4+Cortex-A76x2" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 65 | [cortex-a57x1-a53x1]="${fvp_arm_std_library};FVP_Base_Cortex-A57x1-A53x1" |
| 66 | [cortex-a57x2-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x2-A53x4" |
| 67 | [cortex-a57x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x4" |
| 68 | [cortex-a57x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x4-A53x4" |
| 69 | [cortex-a65aex8]="${fvp_arm_std_library};FVP_Base_Cortex-A65AEx8" |
| 70 | [cortex-a65x4]="${fvp_arm_std_library};FVP_Base_Cortex-A65x4" |
| 71 | [cortex-a72x4]="${fvp_arm_std_library};FVP_Base_Cortex-A72x4" |
| 72 | [cortex-a72x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A72x4-A53x4" |
| 73 | [cortex-a73x4]="${fvp_arm_std_library};FVP_Base_Cortex-A73x4" |
| 74 | [cortex-a73x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A73x4-A53x4" |
| 75 | [cortex-a75x4]="${fvp_arm_std_library};FVP_Base_Cortex-A75x4" |
| 76 | [cortex-a76aex4]="${fvp_arm_std_library};FVP_Base_Cortex-A76AEx4" |
| 77 | [cortex-a76aex2]="${fvp_arm_std_library};FVP_Base_Cortex-A76AEx2" |
| 78 | [cortex-a76x4]="${fvp_arm_std_library};FVP_Base_Cortex-A76x4" |
| 79 | [cortex-a77x4]="${fvp_arm_std_library};FVP_Base_Cortex-A77x4" |
| 80 | [cortex-a78x4]="${fvp_arm_std_library};FVP_Base_Cortex-A78x4" |
| 81 | [neoverse_e1x1]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x1" |
| 82 | [neoverse_e1x2]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x2" |
| 83 | [neoverse_e1x4]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x4" |
| 84 | [neoverse_n1]="${fvp_arm_std_library};FVP_Base_Neoverse-N1x1" |
| 85 | [neoverse_n2]=";;;" |
| 86 | [neoverse-v1x4]=";;;" |
Bipin Ravi | f924efc | 2021-03-22 16:08:33 -0500 | [diff] [blame] | 87 | [matterhornx4]=";;;" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 88 | [css-rdv1]=";;;" |
| 89 | [css-rde1edge]=";;;" |
| 90 | [css-rdn1edge]=";;;" |
| 91 | [css-rdn1edgex2]=";;;" |
| 92 | [css-sgi575]=";;;" |
| 93 | [css-sgm775]=";;;" |
| 94 | [tc0]=";;;" |
| 95 | ) |
| 96 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 97 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 98 | # FVP Kernel URLs |
| 99 | declare -A fvp_kernels |
| 100 | fvp_kernels=( |
| 101 | [fvp-aarch32-zimage]="$linaro_release/fvp32-latest-busybox-uboot/Image" |
| 102 | [fvp-busybox-uboot]="$linaro_release/fvp-latest-busybox-uboot/Image" |
| 103 | [fvp-oe-uboot32]="$linaro_release/fvp32-latest-oe-uboot/Image" |
| 104 | [fvp-oe-uboot]="$linaro_release/fvp-latest-oe-uboot/Image" |
| 105 | [fvp-quad-busybox-uboot]="$tfa_downloads/quad_cluster/Image" |
| 106 | ) |
| 107 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 108 | # FVP initrd URLs |
| 109 | declare -A fvp_initrd_urls |
| 110 | fvp_initrd_urls=( |
| 111 | [aarch32-ramdisk]="$linaro_release/fvp32-latest-busybox-uboot/ramdisk.img" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 112 | [dummy-ramdisk]="$linaro_release/fvp-latest-oe-uboot/ramdisk.img" |
| 113 | [dummy-ramdisk32]="$linaro_release/fvp32-latest-oe-uboot/ramdisk.img" |
| 114 | [default]="$linaro_release/fvp-latest-busybox-uboot/ramdisk.img" |
| 115 | ) |
| 116 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 117 | get_optee_bin() { |
Sandrine Bailleux | 25ff294 | 2021-02-25 14:00:10 +0100 | [diff] [blame] | 118 | url="$tfa_downloads/optee/tee.bin" \ |
| 119 | saveas="bl32.bin" fetch_file |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 120 | archive_file "bl32.bin" |
| 121 | } |
| 122 | |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 123 | # For Measured Boot tests using a TA based on OPTEE, it is necessary to use a |
| 124 | # specific build rather than the default one generated by Jenkins. |
| 125 | get_ftpm_optee_bin() { |
Javier Almansa Sobrino | de64772 | 2020-10-08 19:17:44 +0100 | [diff] [blame] | 126 | url="$tfa_downloads/ftpm/optee/tee-header_v2.bin" \ |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 127 | saveas="bl32.bin" fetch_file |
| 128 | archive_file "bl32.bin" |
| 129 | |
Javier Almansa Sobrino | de64772 | 2020-10-08 19:17:44 +0100 | [diff] [blame] | 130 | url="$tfa_downloads/ftpm/optee/tee-pager_v2.bin" \ |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 131 | saveas="bl32_extra1.bin" fetch_file |
| 132 | archive_file "bl32_extra1.bin" |
| 133 | |
Leonardo Sandoval | da5f78d | 2021-03-18 11:09:30 -0600 | [diff] [blame] | 134 | # tee-pageable_v2.bin is just a empty file, named as bl32_extra2.bin, |
| 135 | # so just create the file |
| 136 | touch "bl32_extra2.bin" |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 137 | archive_file "bl32_extra2.bin" |
| 138 | } |
| 139 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 140 | get_uboot32_bin() { |
| 141 | local tmpdir="$(mktempdir)" |
| 142 | |
| 143 | pushd "$tmpdir" |
| 144 | extract_fip "$uboot32_fip_url" |
| 145 | mv "nt-fw.bin" "uboot.bin" |
| 146 | archive_file "uboot.bin" |
| 147 | popd |
| 148 | } |
| 149 | |
| 150 | get_uboot_bin() { |
| 151 | local uboot_url="$linaro_release/fvp-latest-busybox-uboot/bl33-uboot.bin" |
| 152 | |
| 153 | url="$uboot_url" saveas="uboot.bin" fetch_file |
| 154 | archive_file "uboot.bin" |
| 155 | } |
| 156 | |
| 157 | get_uefi_bin() { |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 158 | uefi_downloads="${uefi_downloads:-http://files.oss.arm.com/downloads/uefi}" |
| 159 | uefi_ci_bin_url="${uefi_ci_bin_url:-$uefi_downloads/Artifacts/Linux/github/fvp/static/DEBUG_GCC5/FVP_AARCH64_EFI.fd}" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 160 | |
| 161 | url=$uefi_ci_bin_url saveas="uefi.bin" fetch_file |
| 162 | archive_file "uefi.bin" |
| 163 | } |
| 164 | |
| 165 | get_kernel() { |
| 166 | local kernel_type="${kernel_type:?}" |
| 167 | local url="${fvp_kernels[$kernel_type]}" |
| 168 | |
| 169 | url="${url:?}" saveas="kernel.bin" fetch_file |
| 170 | archive_file "kernel.bin" |
| 171 | } |
| 172 | |
| 173 | get_initrd() { |
| 174 | local initrd_type="${initrd_type:?}" |
| 175 | local url="${fvp_initrd_urls[$initrd_type]}" |
| 176 | |
| 177 | url="${url:?}" saveas="initrd.bin" fetch_file |
| 178 | archive_file "initrd.bin" |
| 179 | } |
| 180 | |
| 181 | get_dtb() { |
| 182 | local dtb_type="${dtb_type:?}" |
| 183 | local dtb_url |
| 184 | local dtb_saveas="$workspace/dtb.bin" |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 185 | local cc="$(get_tf_opt CROSS_COMPILE)" |
| 186 | local pp_flags="-P -nostdinc -undef -x assembler-with-cpp" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 187 | |
| 188 | case "$dtb_type" in |
| 189 | "fvp-base-quad-cluster-gicv3-psci") |
| 190 | # Get the quad-cluster FDT from pdsw area |
| 191 | dtb_url="$tfa_downloads/quad_cluster/fvp-base-quad-cluster-gicv3-psci.dtb" |
| 192 | url="$dtb_url" saveas="$dtb_saveas" fetch_file |
| 193 | ;; |
| 194 | "sgm775") |
| 195 | # Get the SGM775 FDT from pdsw area |
| 196 | dtb_url="$sgm_prebuilts/sgm775.dtb" |
| 197 | url="$dtb_url" saveas="$dtb_saveas" fetch_file |
| 198 | ;; |
| 199 | *) |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 200 | # Preprocess DTS file |
| 201 | ${cc}gcc -E ${pp_flags} -I"$tf_root/fdts" -I"$tf_root/include" \ |
| 202 | -o "$workspace/${dtb_type}.pre.dts" \ |
| 203 | "$tf_root/fdts/${dtb_type}.dts" |
| 204 | # Generate DTB file from DTS |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 205 | dtc -I dts -O dtb \ |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 206 | "$workspace/${dtb_type}.pre.dts" -o "$dtb_saveas" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 207 | esac |
| 208 | |
| 209 | archive_file "$dtb_saveas" |
| 210 | } |
| 211 | |
| 212 | get_rootfs() { |
| 213 | local tmpdir |
| 214 | local fs_base="$(echo $(basename $rootfs_url) | sed 's/\.gz$//')" |
| 215 | local cached="$project_filer/ci-files/$fs_base" |
| 216 | |
| 217 | if upon "$jenkins_run" && [ -f "$cached" ]; then |
| 218 | # Job workspace is limited in size, and the root file system is |
| 219 | # quite large. This means, parallel runs of root file system |
| 220 | # tests could fail. So, for Jenkins runs, copy and use the root |
| 221 | # file system image from the $CI_SCRATCH location |
| 222 | local private="$CI_SCRATCH/$JOB_NAME-$BUILD_NUMBER" |
| 223 | mkdir -p "$private" |
| 224 | rm -f "$private/rootfs.bin" |
| 225 | url="$cached" saveas="$private/rootfs.bin" fetch_file |
| 226 | ln -s "$private/rootfs.bin" "$archive/rootfs.bin" |
| 227 | return |
| 228 | fi |
| 229 | |
| 230 | tmpdir="$(mktempdir)" |
| 231 | pushd "$tmpdir" |
| 232 | url="$rootfs_url" saveas="rootfs.bin" fetch_file |
| 233 | |
| 234 | # Possibly, the filesystem image we just downloaded is compressed. |
| 235 | # Decompress it if required. |
| 236 | if file "rootfs.bin" | grep -iq 'gzip compressed data'; then |
| 237 | echo "Decompressing root file system image rootfs.bin ..." |
| 238 | gunzip --stdout "rootfs.bin" > uncompressed_fs.bin |
| 239 | mv uncompressed_fs.bin "rootfs.bin" |
| 240 | fi |
| 241 | |
| 242 | archive_file "rootfs.bin" |
| 243 | popd |
| 244 | } |
| 245 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 246 | fvp_romlib_jmptbl_backup="$(mktempdir)/jmptbl.i" |
| 247 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 248 | fvp_romlib_runtime() { |
| 249 | local tmpdir="$(mktempdir)" |
| 250 | |
| 251 | # Save BL1 and romlib binaries from original build |
| 252 | mv "${tf_build_root:?}/${plat:?}/${mode:?}/romlib/romlib.bin" "$tmpdir/romlib.bin" |
| 253 | mv "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" "$tmpdir/bl1.bin" |
| 254 | |
| 255 | # Patch index file |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 256 | cp "${tf_root:?}/plat/arm/board/fvp/jmptbl.i" "$fvp_romlib_jmptbl_backup" |
| 257 | sed -i '/fdt/ s/.$/&\ patch/' ${tf_root:?}/plat/arm/board/fvp/jmptbl.i |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 258 | |
| 259 | # Rebuild with patched file |
| 260 | echo "Building patched romlib:" |
| 261 | build_tf |
| 262 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 263 | # Retrieve original BL1 and romlib binaries |
| 264 | mv "$tmpdir/romlib.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/romlib/romlib.bin" |
| 265 | mv "$tmpdir/bl1.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" |
| 266 | } |
| 267 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 268 | fvp_romlib_cleanup() { |
| 269 | # Restore original index |
| 270 | mv "$fvp_romlib_jmptbl_backup" "${tf_root:?}/plat/arm/board/fvp/jmptbl.i" |
| 271 | } |
| 272 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 273 | |
| 274 | fvp_gen_bin_url() { |
| 275 | local bin_mode="${bin_mode:?}" |
| 276 | local bin="${1:?}" |
| 277 | |
| 278 | if upon "$jenkins_run"; then |
| 279 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/$bin" |
| 280 | else |
| 281 | echo "file://$workspace/artefacts/$bin_mode/$bin" |
| 282 | fi |
| 283 | } |
| 284 | |
| 285 | gen_fvp_yaml_template() { |
| 286 | local yaml_template_file="$workspace/fvp_template.yaml" |
| 287 | |
| 288 | # must parameters for yaml generation |
| 289 | local payload_type="${payload_type:?}" |
| 290 | |
| 291 | "$ci_root/script/gen_fvp_${payload_type}_yaml.sh" > "$yaml_template_file" |
| 292 | |
| 293 | archive_file "$yaml_template_file" |
| 294 | } |
| 295 | |
| 296 | gen_fvp_yaml() { |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 297 | local model="${model:?}" |
| 298 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 299 | local yaml_template_file="$workspace/fvp_template.yaml" |
| 300 | local yaml_file="$workspace/fvp.yaml" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 301 | local yaml_job_file="$workspace/job.yaml" |
| 302 | local lava_model_params="$workspace/lava_model_params" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 303 | |
Leonardo Sandoval | fda4f29 | 2020-10-06 15:59:26 -0500 | [diff] [blame] | 304 | # this function expects a template, quit if it is not present |
| 305 | if [ ! -f "$yaml_template_file" ]; then |
| 306 | return |
| 307 | fi |
| 308 | |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 309 | local model_params="${fvp_models[$model]}" |
| 310 | local model_name="$(echo "${model_params}" | awk -F ';' '{print $1}')" |
| 311 | local model_dir="$(echo "${model_params}" | awk -F ';' '{print $2}')" |
| 312 | local model_bin="$(echo "${model_params}" | awk -F ';' '{print $3}')" |
| 313 | |
| 314 | # model params are required for correct yaml creation, quit if empty |
| 315 | if [ -z "${model_name}" ]; then |
| 316 | echo "FVP model param 'model_name' variable empty, yaml not produced" |
| 317 | return |
| 318 | elif [ -z "${model_dir}" ]; then |
| 319 | echo "FVP model param 'model_dir' variable empty, yaml not produced" |
| 320 | return |
| 321 | elif [ -z "${model_bin}" ]; then |
| 322 | echo "FVP model param 'model_bin' variable empty, yaml not produced" |
| 323 | return |
| 324 | fi |
| 325 | |
| 326 | echo "FVP model params: model_name=$model_name model_dir=$model_dir model_bin=$model_bin" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 327 | |
Leonardo Sandoval | e5cdd36 | 2020-12-11 14:59:37 -0600 | [diff] [blame] | 328 | # FIXME: Foundation plaforms (model=foundationv8) are failing because LAVA [1] |
| 329 | # should read two ports, 5000 and 5002, but LAVA does not support this |
| 330 | # feature, so for the moment avoid creating any LAVA test job definition |
| 331 | # for this model until a solution is found. |
| 332 | # [1] https://tf.validation.linaro.org/scheduler/job/33871 |
Madhukar Pappireddy | 21a5e67 | 2021-03-08 17:49:45 -0600 | [diff] [blame] | 333 | if ! is_arm_jenkins_env && not_upon "$local_ci"; then |
Leonardo Sandoval | 239450c | 2021-01-11 17:51:12 -0600 | [diff] [blame] | 334 | if [ "${model}" = "foundationv8" ]; then |
| 335 | return |
| 336 | fi |
Leonardo Sandoval | e5cdd36 | 2020-12-11 14:59:37 -0600 | [diff] [blame] | 337 | fi |
| 338 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 339 | # optional parameters, defaults to globals |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 340 | local model_dtb="${model_dtb:-$default_model_dtb}" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 341 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 342 | # possible artefacts |
| 343 | backup_fip="$(fvp_gen_bin_url backup_fip.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 344 | bl1="$(fvp_gen_bin_url bl1.bin)" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 345 | bl2="$(fvp_gen_bin_url bl2.bin)" |
| 346 | bl31="$(fvp_gen_bin_url bl31.bin)" |
| 347 | bl32="$(fvp_gen_bin_url bl32.bin)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 348 | busybox="$(fvp_gen_bin_url busybox.bin.gz)" |
| 349 | cactus_primary="$(fvp_gen_bin_url cactus-primary.pkg)" |
| 350 | cactus_secondary="$(fvp_gen_bin_url cactus-secondary.pkg)" |
| 351 | cactus_tertiary="$(fvp_gen_bin_url cactus-tertiary.pkg)" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 352 | dtb="$(fvp_gen_bin_url ${model_dtb})" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 353 | el3_payload="$(fvp_gen_bin_url el3_payload.bin)" |
| 354 | fip="$(fvp_gen_bin_url fip.bin)" |
| 355 | fwu_fip="$(fvp_gen_bin_url fwu_fip.bin)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 356 | generic_trace="${tfa_downloads}/FastModelsPortfolio_${model_version}/plugins/${model_flavour}/GenericTrace.so" |
| 357 | hafnium="$(fvp_gen_bin_url hafnium.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 358 | image="$(fvp_gen_bin_url kernel.bin)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 359 | mcp_rom="$(fvp_gen_bin_url mcp_rom.bin)" |
| 360 | mcp_rom_hyphen="$(fvp_gen_bin_url mcp-rom.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 361 | ns_bl1u="$(fvp_gen_bin_url ns_bl1u.bin)" |
| 362 | ns_bl2u="$(fvp_gen_bin_url ns_bl2u.bin)" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 363 | ramdisk="$(fvp_gen_bin_url initrd.bin)" |
| 364 | romlib="$(fvp_gen_bin_url romlib.bin)" |
| 365 | rootfs="$(fvp_gen_bin_url rootfs.bin.gz)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 366 | secure_hafnium="$(fvp_gen_bin_url secure_hafnium.bin)" |
| 367 | scp_ram="$(fvp_gen_bin_url scp_ram.bin)" |
| 368 | scp_ram_hyphen="$(fvp_gen_bin_url scp-ram.bin)" |
| 369 | scp_rom="$(fvp_gen_bin_url scp_rom.bin)" |
| 370 | scp_rom_hyphen="$(fvp_gen_bin_url scp-rom.bin)" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 371 | spm="$(fvp_gen_bin_url spm.bin)" |
| 372 | tftf="$(fvp_gen_bin_url tftf.bin)" |
| 373 | tmp="$(fvp_gen_bin_url tmp.bin)" |
| 374 | uboot="$(fvp_gen_bin_url uboot.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 375 | |
| 376 | docker_registry="${docker_registry:-}" |
| 377 | docker_registry="$(docker_registry_append)" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 378 | docker_name="${docker_registry}$model_name" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 379 | prompt1='/ #' |
| 380 | prompt2='root@genericarmv8:~#' |
| 381 | version_string="\"Fast Models"' [^\\n]+'"\"" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 382 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 383 | # arrays that relates variables and template macros |
| 384 | # NOTE: any addition on these arrays, requires an addition in the |
| 385 | # fvp templates |
| 386 | declare -A yaml_macros |
| 387 | declare -A artefacts_macros |
| 388 | yaml_macros=( |
| 389 | [armlmd_license_file]="{ARMLMD_LICENSE_FILE}" |
| 390 | [docker_name]="{BOOT_DOCKER_NAME}" |
| 391 | [model]="{MODEL}" |
| 392 | [model_bin]="{BOOT_IMAGE_BIN}" |
| 393 | [model_dir]="{BOOT_IMAGE_DIR}" |
| 394 | [prompt1]="{PROMPT1}" |
| 395 | [prompt2]="{PROMPT2}" |
| 396 | [version_string]="{BOOT_VERSION_STRING}" |
| 397 | ) |
| 398 | artefacts_macros=( |
| 399 | [backup_fip]="{BACKUP_FIP}" |
| 400 | [bl1]="{BL1}" |
| 401 | [bl2]="{BL2}" |
| 402 | [bl31]="{BL31}" |
| 403 | [bl32]="{BL32}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 404 | [cactus_primary]="{CACTUS_PRIMARY}" |
| 405 | [cactus_secondary]="{CACTUS_SECONDARY}" |
| 406 | [cactus_tertiary]="{CACTUS_TERTIARY}" |
| 407 | [busybox]="{BUSYBOX}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 408 | [dtb]="{DTB}" |
| 409 | [el3_payload]="{EL3_PAYLOAD}" |
| 410 | [fwu_fip]="{FWU_FIP}" |
| 411 | [fip]="{FIP}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 412 | [generic_trace]="{GENERIC_TRACE}" |
| 413 | [hafnium]="{HAFNIUM}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 414 | [image]="{IMAGE}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 415 | [mcp_rom]="{MCP_ROM}" |
| 416 | [mcp_rom_hyphen]="{MCP_ROM_HYPHEN}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 417 | [ns_bl1u]="{NS_BL1U}" |
| 418 | [ns_bl2u]="{NS_BL2U}" |
| 419 | [ramdisk]="{RAMDISK}" |
| 420 | [romlib]="{ROMLIB}" |
| 421 | [rootfs]="{ROOTFS}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 422 | [secure_hafnium]="{SECURE_HAFNIUM}" |
| 423 | [scp_ram]="{SCP_RAM}" |
| 424 | [scp_ram_hyphen]="{SCP_RAM_HYPHEN}" |
| 425 | [scp_rom]="{SCP_ROM}" |
| 426 | [scp_rom_hyphen]="{SCP_ROM_HYPHEN}" |
| 427 | [spm]="{SPM}" |
| 428 | [tftf]="{TFTF}" |
| 429 | [tmp]="{TMP}" |
| 430 | [uboot]="{UBOOT}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 431 | ) |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 432 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 433 | # templates cover all possible artefacts, but model parameters may |
| 434 | # not required all, i.e. romlib.bin, so delete those irrelevant from |
| 435 | # the template |
| 436 | for m in "${!artefacts_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 437 | # there are artefacts where deletion is handled in special case, so treat them accordingly |
| 438 | case "$m" in |
| 439 | busybox) |
| 440 | # besides the macro removal, remove the compression field |
| 441 | if ! grep -q "${m}.bin" "$archive/model_params"; then |
| 442 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 443 | sed -i "/url: ${artefacts_macros[$m]}\$/,/compression: gz\$/d" "${yaml_template_file}" |
| 444 | fi |
| 445 | ;; |
| 446 | cactus_primary) |
| 447 | # cactus packages have a hyphen, not an underscore |
| 448 | if ! grep -E -q "cactus-primary.pkg" "$archive/model_params"; then |
| 449 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 450 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 451 | fi |
| 452 | ;; |
| 453 | cactus_secondary) |
| 454 | # cactus packages have a hyphen, not an underscore |
| 455 | if ! grep -E -q "cactus-secondary.pkg" "$archive/model_params"; then |
| 456 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 457 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 458 | fi |
| 459 | ;; |
| 460 | cactus_tertiary) |
| 461 | # cactus packages have a hyphen, not an underscore |
| 462 | if ! grep -E -q "cactus-tertiary.pkg" "$archive/model_params"; then |
| 463 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 464 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 465 | fi |
| 466 | ;; |
| 467 | dtb) |
| 468 | # dtb can come in different names, i.e. dtb.bin, manifest.dtb, |
| 469 | # so handle with regex |
| 470 | if ! grep -E -q "=.*dtb.*@" "$archive/model_params"; then |
| 471 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 472 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 473 | fi |
| 474 | ;; |
| 475 | generic_trace) |
| 476 | # the image (Linux Kernel) is named as kernel.bin |
| 477 | if ! grep -q "GenericTrace.so" "$archive/model_params"; then |
| 478 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 479 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 480 | fi |
| 481 | ;; |
| 482 | image) |
| 483 | # the image (Linux Kernel) is named as kernel.bin |
| 484 | if ! grep -q "kernel.bin" "$archive/model_params"; then |
| 485 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 486 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 487 | fi |
| 488 | ;; |
| 489 | mcp_rom_hyphen) |
| 490 | # mcp rom is either present as mcp-rom or mcp_rom, handle the former case |
| 491 | if ! grep -q "mcp-rom.bin" "$archive/model_params"; then |
| 492 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 493 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 494 | fi |
| 495 | ;; |
| 496 | ramdisk) |
| 497 | # ramdisk is named initrd and is present with to extensions: bin or img |
| 498 | if ! grep -E -q "initrd.bin|initrd.img" "$archive/model_params"; then |
| 499 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 500 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 501 | fi |
| 502 | ;; |
| 503 | rootfs) |
| 504 | # besides the macro removal, remove the compression field |
| 505 | if ! grep -q "rootfs.bin" "$archive/model_params"; then |
| 506 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 507 | sed -i "/url: ${artefacts_macros[$m]}\$/,/compression: gz\$/d" "${yaml_template_file}" |
| 508 | fi |
| 509 | ;; |
| 510 | scp_ram_hyphen) |
| 511 | # scp ram is either present as scp-ram or scp_ram, handle the former case |
| 512 | if ! grep -q "scp-ram.bin" "$archive/model_params"; then |
| 513 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 514 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 515 | fi |
| 516 | ;; |
| 517 | scp_rom_hyphen) |
| 518 | # scp rom is either present as scp-rom or scp_rom, handle the former case |
| 519 | if ! grep -q "scp-rom.bin" "$archive/model_params"; then |
| 520 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 521 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 522 | fi |
| 523 | ;; |
| 524 | *) |
| 525 | if ! grep -q "${m}.bin" "$archive/model_params"; then |
| 526 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 527 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 528 | fi |
| 529 | ;; |
| 530 | esac |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 531 | done |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 532 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 533 | # copied files are the working files |
| 534 | cp "${yaml_template_file}" "${yaml_file}" |
| 535 | cp "$archive/model_params" "$lava_model_params" |
| 536 | |
| 537 | # replace yaml macros with real values |
| 538 | for m in "${!yaml_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 539 | sed -i -e "s|${yaml_macros[$m]}|${!m}|" "$yaml_file" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 540 | done |
| 541 | |
| 542 | # replace artefact macros with real values |
| 543 | for m in "${!artefacts_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 544 | sed -i -e "s|${artefacts_macros[$m]}|${!m}|" "$yaml_file" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 545 | done |
| 546 | |
| 547 | # LAVA expects parameters as 'macros', i.e. {X} instead of x.bin, so |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 548 | # replace them. As in the macro removal above, handle special cases for several |
| 549 | # artefacts |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 550 | for m in "${!artefacts_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 551 | case "$m" in |
| 552 | dtb) |
| 553 | sed -i -e "s|=.*dtb.*@|=${artefacts_macros[$m]}@|" "$lava_model_params" |
| 554 | ;; |
| 555 | cactus_primary) |
| 556 | sed -i -e "s|=cactus-primary.pkg|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 557 | ;; |
| 558 | cactus_secondary) |
| 559 | sed -i -e "s|=cactus-secondary.pkg|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 560 | ;; |
| 561 | cactus_tertiary) |
| 562 | sed -i -e "s|=cactus-tertiary.pkg|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 563 | ;; |
| 564 | generic_trace) |
| 565 | sed -i -e "s|--plugin .*GenericTrace.so|--plugin ${artefacts_macros[$m]}|" "$lava_model_params" |
| 566 | sed -i -e "s|--plugin=.*GenericTrace.so|--plugin=${artefacts_macros[$m]}|" "$lava_model_params" |
| 567 | ;; |
| 568 | image) |
| 569 | sed -i -e "s|=kernel.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 570 | ;; |
| 571 | mcp_rom_hyphen) |
| 572 | sed -i -e "s|=mcp-rom.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 573 | ;; |
| 574 | ramdisk) |
| 575 | sed -i -e "s|=initrd.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 576 | sed -i -e "s|=initrd.img|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 577 | ;; |
| 578 | scp_ram_hyphen) |
| 579 | sed -i -e "s|=scp-ram.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 580 | ;; |
| 581 | scp_rom_hyphen) |
| 582 | sed -i -e "s|=scp-rom.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 583 | ;; |
| 584 | tmp | hafnium | secure_hafnium) |
| 585 | sed -i -e "s|=.*/${m}.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 586 | ;; |
| 587 | *) |
| 588 | sed -i -e "s|=${m}.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 589 | ;; |
| 590 | esac |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 591 | done |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 592 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 593 | # include the model parameters |
| 594 | while read -r line; do |
| 595 | if [ -n "$line" ]; then |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 596 | yaml_line="- \"${line}\"" |
| 597 | sed -i -e "/{BOOT_ARGUMENTS}/i \ \ \ \ $yaml_line" "$yaml_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 598 | fi |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 599 | done < "$lava_model_params" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 600 | sed -i -e '/{BOOT_ARGUMENTS}/d' "$yaml_file" |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 601 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 602 | # create job.yaml |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 603 | cp "$yaml_file" "$yaml_job_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 604 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 605 | # archive both yamls |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 606 | archive_file "$yaml_file" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 607 | archive_file "$yaml_job_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 608 | } |
| 609 | |
| 610 | docker_registry_append() { |
| 611 | # if docker_registry is empty, just use local docker registry |
| 612 | [ -z "$docker_registry" ] && return |
| 613 | |
| 614 | local last=-1 |
| 615 | local last_char="${docker_registry:last}" |
| 616 | |
| 617 | if [ "$last_char" != '/' ]; then |
| 618 | docker_registry="${docker_registry}/"; |
| 619 | fi |
| 620 | echo "$docker_registry" |
| 621 | } |
| 622 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 623 | set +u |