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}" |
Olivier Deprez | dd9ed33 | 2021-07-02 12:07:17 +0200 | [diff] [blame] | 26 | sp4_addr="${sp4_addr:-0x7600000}" |
Manish Pandey | 1e7be85 | 2020-11-09 16:04:48 +0000 | [diff] [blame] | 27 | # SPM out directories |
| 28 | export spm_secure_out_dir="${spm_secure_out_dir:-secure_aem_v8a_fvp_clang}" |
| 29 | 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] | 30 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 31 | ns_bl1u_addr="${ns_bl1u_addr:-0x0beb8000}" |
| 32 | fwu_fip_addr="${fwu_fip_addr:-0x08400000}" |
| 33 | backup_fip_addr="${backup_fip_addr:-0x09000000}" |
| 34 | romlib_addr="${romlib_addr:-0x03ff2000}" |
| 35 | |
| 36 | uboot32_fip_url="$linaro_release/fvp32-latest-busybox-uboot/fip.bin" |
| 37 | |
Alexei Fedorov | e405cc3 | 2020-09-30 18:13:55 +0100 | [diff] [blame] | 38 | 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] | 39 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 40 | # Default FVP model variables |
Leonardo Sandoval | e146066 | 2021-05-27 16:05:38 -0500 | [diff] [blame] | 41 | default_model_dtb="dtb.bin" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 42 | |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 43 | # FVP containers and model paths |
laurenw-arm | 35faeaa | 2021-05-03 14:28:17 -0500 | [diff] [blame] | 44 | fvp_arm_std_library_11_12="fvp:fvp_arm_std_library_${model_version_11_12}_${model_build_11_12};/opt/model/FVP_ARM_Std_Library/models/${model_flavour_11_12}" |
Maksims Svecovs | 284a50d | 2021-11-02 11:09:47 +0000 | [diff] [blame] | 45 | fvp_arm_std_library="fvp:fvp_arm_std_library_${model_version}_${model_build};/opt/model/FVP_ARM_Std_Library/FVP_Base" |
laurenw-arm | f414aba | 2021-04-26 15:58:56 -0500 | [diff] [blame] | 46 | fvp_base_revc_2xaemva="fvp:fvp_base_revc-2xaemva_${model_version}_${model_build};/opt/model/Base_RevC_AEMvA_pkg/models/${model_flavour}" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 47 | foundation_platform="fvp:foundation_platform_${model_version}_${model_build};/opt/model/Foundation_Platformpkg/models/${model_flavour}" |
johpow01 | 936638d | 2021-11-08 18:22:24 -0600 | [diff] [blame] | 48 | fvp_base_aemv8r="fvp:fvp_base_aemv8r_${model_version}_${model_build};/opt/model/AEMv8R_base_pkg/models/${model_flavour}" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 49 | |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 50 | # FVP associate array, run_config are keys and fvp container parameters are the values |
| 51 | # Container parameters syntax: <model name>;<model dir>;<model bin> |
| 52 | # FIXMEs: fix those ;;; values with real values |
| 53 | |
| 54 | declare -A fvp_models |
| 55 | fvp_models=( |
| 56 | [base-aemv8a-quad]=";;;" |
| 57 | [base-aemv8a-revb]=";;;" |
| 58 | [base-aemv8a-latest-revb]=";;;" |
| 59 | [base-aemva]=";;;" |
Manish V Badarkhe | e478383 | 2021-02-22 14:36:56 +0000 | [diff] [blame] | 60 | [base-aemv8a-gic600ae]=";;;" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 61 | [foundationv8]="${foundation_platform};Foundation_Platform" |
laurenw-arm | f414aba | 2021-04-26 15:58:56 -0500 | [diff] [blame] | 62 | [base-aemv8a]="${fvp_base_revc_2xaemva};FVP_Base_RevC-2xAEMvA" |
johpow01 | 936638d | 2021-11-08 18:22:24 -0600 | [diff] [blame] | 63 | [baser-aemv8r]=";;;" |
laurenw-arm | 35faeaa | 2021-05-03 14:28:17 -0500 | [diff] [blame] | 64 | [cortex-a32x4]="${fvp_arm_std_library_11_12};FVP_Base_Cortex-A32x4" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 65 | [cortex-a35x4]="${fvp_arm_std_library};FVP_Base_Cortex-A35x4" |
| 66 | [cortex-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A53x4" |
Leonardo Sandoval | 95f896b | 2021-02-22 10:16:29 -0600 | [diff] [blame] | 67 | [cortex-a55x4-a75x4]="${fvp_arm_std_library};FVP_Base_Cortex-A55x4+Cortex-A75x4" |
| 68 | [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] | 69 | [cortex-a57x1-a53x1]="${fvp_arm_std_library};FVP_Base_Cortex-A57x1-A53x1" |
| 70 | [cortex-a57x2-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x2-A53x4" |
| 71 | [cortex-a57x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x4" |
| 72 | [cortex-a57x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x4-A53x4" |
| 73 | [cortex-a65aex8]="${fvp_arm_std_library};FVP_Base_Cortex-A65AEx8" |
| 74 | [cortex-a65x4]="${fvp_arm_std_library};FVP_Base_Cortex-A65x4" |
| 75 | [cortex-a72x4]="${fvp_arm_std_library};FVP_Base_Cortex-A72x4" |
| 76 | [cortex-a72x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A72x4-A53x4" |
| 77 | [cortex-a73x4]="${fvp_arm_std_library};FVP_Base_Cortex-A73x4" |
| 78 | [cortex-a73x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A73x4-A53x4" |
| 79 | [cortex-a75x4]="${fvp_arm_std_library};FVP_Base_Cortex-A75x4" |
| 80 | [cortex-a76aex4]="${fvp_arm_std_library};FVP_Base_Cortex-A76AEx4" |
| 81 | [cortex-a76aex2]="${fvp_arm_std_library};FVP_Base_Cortex-A76AEx2" |
| 82 | [cortex-a76x4]="${fvp_arm_std_library};FVP_Base_Cortex-A76x4" |
| 83 | [cortex-a77x4]="${fvp_arm_std_library};FVP_Base_Cortex-A77x4" |
| 84 | [cortex-a78x4]="${fvp_arm_std_library};FVP_Base_Cortex-A78x4" |
| 85 | [neoverse_e1x1]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x1" |
| 86 | [neoverse_e1x2]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x2" |
| 87 | [neoverse_e1x4]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x4" |
Leonardo Sandoval | 54f1ade | 2021-06-26 19:20:48 -0500 | [diff] [blame] | 88 | [neoverse_n1]="${fvp_arm_std_library};FVP_Base_Neoverse-N1x4" |
Maksims Svecovs | d10c1b9 | 2021-10-06 10:25:40 +0100 | [diff] [blame] | 89 | [neoverse_n2]="${fvp_arm_std_library_11_12};FVP_Base_Neoverse-N1x4" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 90 | [neoverse-v1x4]=";;;" |
Manish V Badarkhe | cbed15e | 2021-07-02 09:34:53 +0100 | [diff] [blame] | 91 | [cortexa710x4]=";;;" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 92 | [css-rdv1]=";;;" |
| 93 | [css-rde1edge]=";;;" |
| 94 | [css-rdn1edge]=";;;" |
| 95 | [css-rdn1edgex2]=";;;" |
| 96 | [css-sgi575]=";;;" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 97 | [tc0]=";;;" |
Usama Arif | cba711d | 2021-08-04 15:53:42 +0100 | [diff] [blame] | 98 | [tc1]=";;;" |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 99 | ) |
| 100 | |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 101 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 102 | # FVP Kernel URLs |
| 103 | declare -A fvp_kernels |
| 104 | fvp_kernels=( |
| 105 | [fvp-aarch32-zimage]="$linaro_release/fvp32-latest-busybox-uboot/Image" |
| 106 | [fvp-busybox-uboot]="$linaro_release/fvp-latest-busybox-uboot/Image" |
| 107 | [fvp-oe-uboot32]="$linaro_release/fvp32-latest-oe-uboot/Image" |
| 108 | [fvp-oe-uboot]="$linaro_release/fvp-latest-oe-uboot/Image" |
| 109 | [fvp-quad-busybox-uboot]="$tfa_downloads/quad_cluster/Image" |
| 110 | ) |
| 111 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 112 | # FVP initrd URLs |
| 113 | declare -A fvp_initrd_urls |
| 114 | fvp_initrd_urls=( |
| 115 | [aarch32-ramdisk]="$linaro_release/fvp32-latest-busybox-uboot/ramdisk.img" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 116 | [dummy-ramdisk]="$linaro_release/fvp-latest-oe-uboot/ramdisk.img" |
| 117 | [dummy-ramdisk32]="$linaro_release/fvp32-latest-oe-uboot/ramdisk.img" |
| 118 | [default]="$linaro_release/fvp-latest-busybox-uboot/ramdisk.img" |
| 119 | ) |
| 120 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 121 | get_optee_bin() { |
Sandrine Bailleux | 25ff294 | 2021-02-25 14:00:10 +0100 | [diff] [blame] | 122 | url="$tfa_downloads/optee/tee.bin" \ |
| 123 | saveas="bl32.bin" fetch_file |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 124 | archive_file "bl32.bin" |
| 125 | } |
| 126 | |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 127 | # For Measured Boot tests using a TA based on OPTEE, it is necessary to use a |
| 128 | # specific build rather than the default one generated by Jenkins. |
| 129 | get_ftpm_optee_bin() { |
Javier Almansa Sobrino | de64772 | 2020-10-08 19:17:44 +0100 | [diff] [blame] | 130 | url="$tfa_downloads/ftpm/optee/tee-header_v2.bin" \ |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 131 | saveas="bl32.bin" fetch_file |
| 132 | archive_file "bl32.bin" |
| 133 | |
Javier Almansa Sobrino | de64772 | 2020-10-08 19:17:44 +0100 | [diff] [blame] | 134 | url="$tfa_downloads/ftpm/optee/tee-pager_v2.bin" \ |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 135 | saveas="bl32_extra1.bin" fetch_file |
| 136 | archive_file "bl32_extra1.bin" |
| 137 | |
Leonardo Sandoval | da5f78d | 2021-03-18 11:09:30 -0600 | [diff] [blame] | 138 | # tee-pageable_v2.bin is just a empty file, named as bl32_extra2.bin, |
| 139 | # so just create the file |
| 140 | touch "bl32_extra2.bin" |
Javier Almansa Sobrino | 98de503 | 2020-09-17 12:47:05 +0100 | [diff] [blame] | 141 | archive_file "bl32_extra2.bin" |
| 142 | } |
| 143 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 144 | get_uboot32_bin() { |
| 145 | local tmpdir="$(mktempdir)" |
| 146 | |
| 147 | pushd "$tmpdir" |
| 148 | extract_fip "$uboot32_fip_url" |
| 149 | mv "nt-fw.bin" "uboot.bin" |
| 150 | archive_file "uboot.bin" |
| 151 | popd |
| 152 | } |
| 153 | |
| 154 | get_uboot_bin() { |
| 155 | local uboot_url="$linaro_release/fvp-latest-busybox-uboot/bl33-uboot.bin" |
| 156 | |
| 157 | url="$uboot_url" saveas="uboot.bin" fetch_file |
| 158 | archive_file "uboot.bin" |
| 159 | } |
| 160 | |
| 161 | get_uefi_bin() { |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 162 | uefi_downloads="${uefi_downloads:-http://files.oss.arm.com/downloads/uefi}" |
| 163 | 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] | 164 | |
| 165 | url=$uefi_ci_bin_url saveas="uefi.bin" fetch_file |
| 166 | archive_file "uefi.bin" |
| 167 | } |
| 168 | |
| 169 | get_kernel() { |
| 170 | local kernel_type="${kernel_type:?}" |
| 171 | local url="${fvp_kernels[$kernel_type]}" |
| 172 | |
| 173 | url="${url:?}" saveas="kernel.bin" fetch_file |
| 174 | archive_file "kernel.bin" |
| 175 | } |
| 176 | |
| 177 | get_initrd() { |
| 178 | local initrd_type="${initrd_type:?}" |
| 179 | local url="${fvp_initrd_urls[$initrd_type]}" |
| 180 | |
| 181 | url="${url:?}" saveas="initrd.bin" fetch_file |
| 182 | archive_file "initrd.bin" |
| 183 | } |
| 184 | |
| 185 | get_dtb() { |
| 186 | local dtb_type="${dtb_type:?}" |
| 187 | local dtb_url |
| 188 | local dtb_saveas="$workspace/dtb.bin" |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 189 | local cc="$(get_tf_opt CROSS_COMPILE)" |
| 190 | local pp_flags="-P -nostdinc -undef -x assembler-with-cpp" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 191 | |
| 192 | case "$dtb_type" in |
| 193 | "fvp-base-quad-cluster-gicv3-psci") |
| 194 | # Get the quad-cluster FDT from pdsw area |
| 195 | dtb_url="$tfa_downloads/quad_cluster/fvp-base-quad-cluster-gicv3-psci.dtb" |
| 196 | url="$dtb_url" saveas="$dtb_saveas" fetch_file |
| 197 | ;; |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 198 | *) |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 199 | # Preprocess DTS file |
| 200 | ${cc}gcc -E ${pp_flags} -I"$tf_root/fdts" -I"$tf_root/include" \ |
| 201 | -o "$workspace/${dtb_type}.pre.dts" \ |
| 202 | "$tf_root/fdts/${dtb_type}.dts" |
| 203 | # Generate DTB file from DTS |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 204 | dtc -I dts -O dtb \ |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 205 | "$workspace/${dtb_type}.pre.dts" -o "$dtb_saveas" |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 206 | esac |
| 207 | |
| 208 | archive_file "$dtb_saveas" |
| 209 | } |
| 210 | |
| 211 | get_rootfs() { |
| 212 | local tmpdir |
| 213 | local fs_base="$(echo $(basename $rootfs_url) | sed 's/\.gz$//')" |
| 214 | local cached="$project_filer/ci-files/$fs_base" |
| 215 | |
| 216 | if upon "$jenkins_run" && [ -f "$cached" ]; then |
| 217 | # Job workspace is limited in size, and the root file system is |
| 218 | # quite large. This means, parallel runs of root file system |
| 219 | # tests could fail. So, for Jenkins runs, copy and use the root |
| 220 | # file system image from the $CI_SCRATCH location |
| 221 | local private="$CI_SCRATCH/$JOB_NAME-$BUILD_NUMBER" |
| 222 | mkdir -p "$private" |
| 223 | rm -f "$private/rootfs.bin" |
| 224 | url="$cached" saveas="$private/rootfs.bin" fetch_file |
| 225 | ln -s "$private/rootfs.bin" "$archive/rootfs.bin" |
| 226 | return |
| 227 | fi |
| 228 | |
| 229 | tmpdir="$(mktempdir)" |
| 230 | pushd "$tmpdir" |
| 231 | url="$rootfs_url" saveas="rootfs.bin" fetch_file |
| 232 | |
| 233 | # Possibly, the filesystem image we just downloaded is compressed. |
| 234 | # Decompress it if required. |
| 235 | if file "rootfs.bin" | grep -iq 'gzip compressed data'; then |
| 236 | echo "Decompressing root file system image rootfs.bin ..." |
| 237 | gunzip --stdout "rootfs.bin" > uncompressed_fs.bin |
| 238 | mv uncompressed_fs.bin "rootfs.bin" |
| 239 | fi |
| 240 | |
| 241 | archive_file "rootfs.bin" |
| 242 | popd |
| 243 | } |
| 244 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 245 | fvp_romlib_jmptbl_backup="$(mktempdir)/jmptbl.i" |
| 246 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 247 | fvp_romlib_runtime() { |
| 248 | local tmpdir="$(mktempdir)" |
| 249 | |
| 250 | # Save BL1 and romlib binaries from original build |
| 251 | mv "${tf_build_root:?}/${plat:?}/${mode:?}/romlib/romlib.bin" "$tmpdir/romlib.bin" |
| 252 | mv "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" "$tmpdir/bl1.bin" |
| 253 | |
| 254 | # Patch index file |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 255 | cp "${tf_root:?}/plat/arm/board/fvp/jmptbl.i" "$fvp_romlib_jmptbl_backup" |
| 256 | 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] | 257 | |
| 258 | # Rebuild with patched file |
| 259 | echo "Building patched romlib:" |
| 260 | build_tf |
| 261 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 262 | # Retrieve original BL1 and romlib binaries |
| 263 | mv "$tmpdir/romlib.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/romlib/romlib.bin" |
| 264 | mv "$tmpdir/bl1.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" |
| 265 | } |
| 266 | |
Zelalem | 219df41 | 2020-05-17 19:21:20 -0500 | [diff] [blame] | 267 | fvp_romlib_cleanup() { |
| 268 | # Restore original index |
| 269 | mv "$fvp_romlib_jmptbl_backup" "${tf_root:?}/plat/arm/board/fvp/jmptbl.i" |
| 270 | } |
| 271 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 272 | |
| 273 | fvp_gen_bin_url() { |
| 274 | local bin_mode="${bin_mode:?}" |
| 275 | local bin="${1:?}" |
| 276 | |
| 277 | if upon "$jenkins_run"; then |
| 278 | echo "$jenkins_url/job/$JOB_NAME/$BUILD_NUMBER/artifact/artefacts/$bin_mode/$bin" |
| 279 | else |
| 280 | echo "file://$workspace/artefacts/$bin_mode/$bin" |
| 281 | fi |
| 282 | } |
| 283 | |
| 284 | gen_fvp_yaml_template() { |
| 285 | local yaml_template_file="$workspace/fvp_template.yaml" |
| 286 | |
| 287 | # must parameters for yaml generation |
| 288 | local payload_type="${payload_type:?}" |
| 289 | |
| 290 | "$ci_root/script/gen_fvp_${payload_type}_yaml.sh" > "$yaml_template_file" |
| 291 | |
| 292 | archive_file "$yaml_template_file" |
| 293 | } |
| 294 | |
| 295 | gen_fvp_yaml() { |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 296 | local model="${model:?}" |
| 297 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 298 | local yaml_template_file="$workspace/fvp_template.yaml" |
| 299 | local yaml_file="$workspace/fvp.yaml" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 300 | local yaml_job_file="$workspace/job.yaml" |
| 301 | local lava_model_params="$workspace/lava_model_params" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 302 | |
Leonardo Sandoval | fda4f29 | 2020-10-06 15:59:26 -0500 | [diff] [blame] | 303 | # this function expects a template, quit if it is not present |
| 304 | if [ ! -f "$yaml_template_file" ]; then |
| 305 | return |
| 306 | fi |
| 307 | |
Leonardo Sandoval | 00ced1f | 2020-12-07 12:55:08 -0600 | [diff] [blame] | 308 | local model_params="${fvp_models[$model]}" |
| 309 | local model_name="$(echo "${model_params}" | awk -F ';' '{print $1}')" |
| 310 | local model_dir="$(echo "${model_params}" | awk -F ';' '{print $2}')" |
| 311 | local model_bin="$(echo "${model_params}" | awk -F ';' '{print $3}')" |
| 312 | |
| 313 | # model params are required for correct yaml creation, quit if empty |
| 314 | if [ -z "${model_name}" ]; then |
| 315 | echo "FVP model param 'model_name' variable empty, yaml not produced" |
| 316 | return |
| 317 | elif [ -z "${model_dir}" ]; then |
| 318 | echo "FVP model param 'model_dir' variable empty, yaml not produced" |
| 319 | return |
| 320 | elif [ -z "${model_bin}" ]; then |
| 321 | echo "FVP model param 'model_bin' variable empty, yaml not produced" |
| 322 | return |
| 323 | fi |
| 324 | |
| 325 | 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] | 326 | |
| 327 | # optional parameters, defaults to globals |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 328 | local model_dtb="${model_dtb:-$default_model_dtb}" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 329 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 330 | # possible artefacts |
| 331 | backup_fip="$(fvp_gen_bin_url backup_fip.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 332 | bl1="$(fvp_gen_bin_url bl1.bin)" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 333 | bl2="$(fvp_gen_bin_url bl2.bin)" |
| 334 | bl31="$(fvp_gen_bin_url bl31.bin)" |
| 335 | bl32="$(fvp_gen_bin_url bl32.bin)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 336 | busybox="$(fvp_gen_bin_url busybox.bin.gz)" |
| 337 | cactus_primary="$(fvp_gen_bin_url cactus-primary.pkg)" |
| 338 | cactus_secondary="$(fvp_gen_bin_url cactus-secondary.pkg)" |
| 339 | cactus_tertiary="$(fvp_gen_bin_url cactus-tertiary.pkg)" |
Leonardo Sandoval | d98f833 | 2021-04-13 16:46:38 -0500 | [diff] [blame] | 340 | coverage_trace_plugin="${coverage_trace_plugin}" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 341 | dtb="$(fvp_gen_bin_url ${model_dtb})" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 342 | el3_payload="$(fvp_gen_bin_url el3_payload.bin)" |
| 343 | fip="$(fvp_gen_bin_url fip.bin)" |
Leonardo Sandoval | cc52beb | 2021-05-05 19:05:31 -0500 | [diff] [blame] | 344 | fip_gpt="$(fvp_gen_bin_url fip_gpt.bin)" |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 345 | fvp_spmc_manifest_dtb="$(fvp_gen_bin_url fvp_spmc_manifest.dtb)" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 346 | fwu_fip="$(fvp_gen_bin_url fwu_fip.bin)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 347 | generic_trace="${tfa_downloads}/FastModelsPortfolio_${model_version}/plugins/${model_flavour}/GenericTrace.so" |
| 348 | hafnium="$(fvp_gen_bin_url hafnium.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 349 | image="$(fvp_gen_bin_url kernel.bin)" |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 350 | ivy="$(fvp_gen_bin_url ivy.pkg)" |
| 351 | manifest_dtb="$(fvp_gen_bin_url manifest.dtb)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 352 | mcp_rom="$(fvp_gen_bin_url mcp_rom.bin)" |
| 353 | mcp_rom_hyphen="$(fvp_gen_bin_url mcp-rom.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 354 | ns_bl1u="$(fvp_gen_bin_url ns_bl1u.bin)" |
| 355 | ns_bl2u="$(fvp_gen_bin_url ns_bl2u.bin)" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 356 | ramdisk="$(fvp_gen_bin_url initrd.bin)" |
| 357 | romlib="$(fvp_gen_bin_url romlib.bin)" |
| 358 | rootfs="$(fvp_gen_bin_url rootfs.bin.gz)" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 359 | secure_hafnium="$(fvp_gen_bin_url secure_hafnium.bin)" |
| 360 | scp_ram="$(fvp_gen_bin_url scp_ram.bin)" |
| 361 | scp_ram_hyphen="$(fvp_gen_bin_url scp-ram.bin)" |
| 362 | scp_rom="$(fvp_gen_bin_url scp_rom.bin)" |
| 363 | scp_rom_hyphen="$(fvp_gen_bin_url scp-rom.bin)" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 364 | spm="$(fvp_gen_bin_url spm.bin)" |
| 365 | tftf="$(fvp_gen_bin_url tftf.bin)" |
| 366 | tmp="$(fvp_gen_bin_url tmp.bin)" |
| 367 | uboot="$(fvp_gen_bin_url uboot.bin)" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 368 | |
| 369 | docker_registry="${docker_registry:-}" |
| 370 | docker_registry="$(docker_registry_append)" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 371 | docker_name="${docker_registry}$model_name" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 372 | prompt1='/ #' |
| 373 | prompt2='root@genericarmv8:~#' |
| 374 | version_string="\"Fast Models"' [^\\n]+'"\"" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 375 | |
Leonardo Sandoval | 5d87b70 | 2021-05-10 11:53:13 -0500 | [diff] [blame] | 376 | test_config="${TEST_CONFIG}" |
| 377 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 378 | # arrays that relates variables and template macros |
| 379 | # NOTE: any addition on these arrays, requires an addition in the |
| 380 | # fvp templates |
Leonardo Sandoval | 5d87b70 | 2021-05-10 11:53:13 -0500 | [diff] [blame] | 381 | declare -A metadata_macros |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 382 | declare -A yaml_macros |
| 383 | declare -A artefacts_macros |
Leonardo Sandoval | 5d87b70 | 2021-05-10 11:53:13 -0500 | [diff] [blame] | 384 | metadata_macros=( |
| 385 | [test_config]="{TEST_CONFIG}" |
| 386 | ) |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 387 | yaml_macros=( |
| 388 | [armlmd_license_file]="{ARMLMD_LICENSE_FILE}" |
| 389 | [docker_name]="{BOOT_DOCKER_NAME}" |
| 390 | [model]="{MODEL}" |
| 391 | [model_bin]="{BOOT_IMAGE_BIN}" |
| 392 | [model_dir]="{BOOT_IMAGE_DIR}" |
| 393 | [prompt1]="{PROMPT1}" |
| 394 | [prompt2]="{PROMPT2}" |
| 395 | [version_string]="{BOOT_VERSION_STRING}" |
| 396 | ) |
| 397 | artefacts_macros=( |
| 398 | [backup_fip]="{BACKUP_FIP}" |
| 399 | [bl1]="{BL1}" |
| 400 | [bl2]="{BL2}" |
| 401 | [bl31]="{BL31}" |
| 402 | [bl32]="{BL32}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 403 | [cactus_primary]="{CACTUS_PRIMARY}" |
| 404 | [cactus_secondary]="{CACTUS_SECONDARY}" |
| 405 | [cactus_tertiary]="{CACTUS_TERTIARY}" |
Leonardo Sandoval | d98f833 | 2021-04-13 16:46:38 -0500 | [diff] [blame] | 406 | [coverage_trace_plugin]="{COVERAGE_TRACE_PLUGIN}" |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 407 | [fvp_spmc_manifest_dtb]="{FVP_SPMC_MANIFEST_DTB}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 408 | [busybox]="{BUSYBOX}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 409 | [dtb]="{DTB}" |
| 410 | [el3_payload]="{EL3_PAYLOAD}" |
Leonardo Sandoval | cc52beb | 2021-05-05 19:05:31 -0500 | [diff] [blame] | 411 | [fip_gpt]="{FIP_GPT}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 412 | [fwu_fip]="{FWU_FIP}" |
| 413 | [fip]="{FIP}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 414 | [generic_trace]="{GENERIC_TRACE}" |
| 415 | [hafnium]="{HAFNIUM}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 416 | [image]="{IMAGE}" |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 417 | [ivy]="{IVY}" |
| 418 | [manifest_dtb]="{MANIFEST_DTB}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 419 | [mcp_rom]="{MCP_ROM}" |
| 420 | [mcp_rom_hyphen]="{MCP_ROM_HYPHEN}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 421 | [ns_bl1u]="{NS_BL1U}" |
| 422 | [ns_bl2u]="{NS_BL2U}" |
| 423 | [ramdisk]="{RAMDISK}" |
| 424 | [romlib]="{ROMLIB}" |
| 425 | [rootfs]="{ROOTFS}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 426 | [secure_hafnium]="{SECURE_HAFNIUM}" |
| 427 | [scp_ram]="{SCP_RAM}" |
| 428 | [scp_ram_hyphen]="{SCP_RAM_HYPHEN}" |
| 429 | [scp_rom]="{SCP_ROM}" |
| 430 | [scp_rom_hyphen]="{SCP_ROM_HYPHEN}" |
| 431 | [spm]="{SPM}" |
| 432 | [tftf]="{TFTF}" |
| 433 | [tmp]="{TMP}" |
| 434 | [uboot]="{UBOOT}" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 435 | ) |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 436 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 437 | # templates cover all possible artefacts, but model parameters may |
| 438 | # not required all, i.e. romlib.bin, so delete those irrelevant from |
| 439 | # the template |
| 440 | for m in "${!artefacts_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 441 | # there are artefacts where deletion is handled in special case, so treat them accordingly |
| 442 | case "$m" in |
| 443 | busybox) |
| 444 | # besides the macro removal, remove the compression field |
| 445 | if ! grep -q "${m}.bin" "$archive/model_params"; then |
| 446 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 447 | sed -i "/url: ${artefacts_macros[$m]}\$/,/compression: gz\$/d" "${yaml_template_file}" |
| 448 | fi |
| 449 | ;; |
| 450 | cactus_primary) |
| 451 | # cactus packages have a hyphen, not an underscore |
| 452 | if ! grep -E -q "cactus-primary.pkg" "$archive/model_params"; then |
| 453 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 454 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 455 | fi |
| 456 | ;; |
| 457 | cactus_secondary) |
| 458 | # cactus packages have a hyphen, not an underscore |
| 459 | if ! grep -E -q "cactus-secondary.pkg" "$archive/model_params"; then |
| 460 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 461 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 462 | fi |
| 463 | ;; |
| 464 | cactus_tertiary) |
| 465 | # cactus packages have a hyphen, not an underscore |
| 466 | if ! grep -E -q "cactus-tertiary.pkg" "$archive/model_params"; then |
| 467 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 468 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 469 | fi |
| 470 | ;; |
Leonardo Sandoval | d98f833 | 2021-04-13 16:46:38 -0500 | [diff] [blame] | 471 | coverage_trace_plugin) |
| 472 | if ! grep -q "coverage_trace.so" "$archive/model_params"; then |
| 473 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 474 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 475 | fi |
| 476 | ;; |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 477 | fvp_spmc_manifest_dtb) |
| 478 | # handles fvp_spmc_manifest.dtb as DTB file |
| 479 | if ! grep -q "=fvp_spmc_manifest.dtb" "$archive/model_params"; then |
| 480 | sed -i "/ $m:\$/d" "${yaml_template_file}" |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 481 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 482 | fi |
| 483 | ;; |
| 484 | generic_trace) |
| 485 | # the image (Linux Kernel) is named as kernel.bin |
| 486 | if ! grep -q "GenericTrace.so" "$archive/model_params"; then |
| 487 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 488 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 489 | fi |
| 490 | ;; |
| 491 | image) |
| 492 | # the image (Linux Kernel) is named as kernel.bin |
| 493 | if ! grep -q "kernel.bin" "$archive/model_params"; then |
| 494 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 495 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 496 | fi |
| 497 | ;; |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 498 | ivy) |
| 499 | # the ivy package |
| 500 | if ! grep -q "ivy.pkg" "$archive/model_params"; then |
| 501 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 502 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 503 | fi |
| 504 | ;; |
| 505 | manifest_dtb) |
| 506 | # handles manifest.dtb as DTB file |
| 507 | if ! grep -q "=manifest.dtb" "$archive/model_params"; then |
| 508 | sed -i "/ $m:\$/d" "${yaml_template_file}" |
| 509 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 510 | fi |
| 511 | ;; |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 512 | mcp_rom_hyphen) |
| 513 | # mcp rom is either present as mcp-rom or mcp_rom, handle the former case |
| 514 | if ! grep -q "mcp-rom.bin" "$archive/model_params"; then |
| 515 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 516 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 517 | fi |
| 518 | ;; |
| 519 | ramdisk) |
| 520 | # ramdisk is named initrd and is present with to extensions: bin or img |
| 521 | if ! grep -E -q "initrd.bin|initrd.img" "$archive/model_params"; then |
| 522 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 523 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 524 | fi |
| 525 | ;; |
| 526 | rootfs) |
| 527 | # besides the macro removal, remove the compression field |
| 528 | if ! grep -q "rootfs.bin" "$archive/model_params"; then |
| 529 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 530 | sed -i "/url: ${artefacts_macros[$m]}\$/,/compression: gz\$/d" "${yaml_template_file}" |
| 531 | fi |
| 532 | ;; |
| 533 | scp_ram_hyphen) |
| 534 | # scp ram is either present as scp-ram or scp_ram, handle the former case |
| 535 | if ! grep -q "scp-ram.bin" "$archive/model_params"; then |
| 536 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 537 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 538 | fi |
| 539 | ;; |
| 540 | scp_rom_hyphen) |
| 541 | # scp rom is either present as scp-rom or scp_rom, handle the former case |
| 542 | if ! grep -q "scp-rom.bin" "$archive/model_params"; then |
| 543 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 544 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 545 | fi |
| 546 | ;; |
| 547 | *) |
| 548 | if ! grep -q "${m}.bin" "$archive/model_params"; then |
| 549 | sed -i "/$m:\$/d" "${yaml_template_file}" |
| 550 | sed -i "/url: ${artefacts_macros[$m]}\$/d" "${yaml_template_file}" |
| 551 | fi |
| 552 | ;; |
| 553 | esac |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 554 | done |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 555 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 556 | # copied files are the working files |
| 557 | cp "${yaml_template_file}" "${yaml_file}" |
| 558 | cp "$archive/model_params" "$lava_model_params" |
| 559 | |
Leonardo Sandoval | 5d87b70 | 2021-05-10 11:53:13 -0500 | [diff] [blame] | 560 | # replace metadata macros with real values |
| 561 | for m in "${!metadata_macros[@]}"; do |
| 562 | sed -i -e "s|${metadata_macros[$m]}|${!m}|" "$yaml_file" |
| 563 | done |
| 564 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 565 | # replace yaml macros with real values |
| 566 | for m in "${!yaml_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 567 | sed -i -e "s|${yaml_macros[$m]}|${!m}|" "$yaml_file" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 568 | done |
| 569 | |
| 570 | # replace artefact macros with real values |
| 571 | for m in "${!artefacts_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 572 | sed -i -e "s|${artefacts_macros[$m]}|${!m}|" "$yaml_file" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 573 | done |
| 574 | |
| 575 | # 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] | 576 | # replace them. As in the macro removal above, handle special cases for several |
| 577 | # artefacts |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 578 | for m in "${!artefacts_macros[@]}"; do |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 579 | case "$m" in |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 580 | cactus_primary) |
| 581 | sed -i -e "s|=cactus-primary.pkg|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 582 | ;; |
| 583 | cactus_secondary) |
| 584 | sed -i -e "s|=cactus-secondary.pkg|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 585 | ;; |
| 586 | cactus_tertiary) |
| 587 | sed -i -e "s|=cactus-tertiary.pkg|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 588 | ;; |
Leonardo Sandoval | d98f833 | 2021-04-13 16:46:38 -0500 | [diff] [blame] | 589 | coverage_trace_plugin) |
| 590 | sed -i -e "s|--plugin .*coverage_trace.so|--plugin ${artefacts_macros[$m]}|" "$lava_model_params" |
| 591 | sed -i -e "s|--plugin=.*coverage_trace.so|--plugin=${artefacts_macros[$m]}|" "$lava_model_params" |
| 592 | ;; |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 593 | fvp_spmc_manifest_dtb) |
| 594 | sed -i -e "s|=fvp_spmc_manifest.dtb|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 595 | ;; |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 596 | generic_trace) |
| 597 | sed -i -e "s|--plugin .*GenericTrace.so|--plugin ${artefacts_macros[$m]}|" "$lava_model_params" |
| 598 | sed -i -e "s|--plugin=.*GenericTrace.so|--plugin=${artefacts_macros[$m]}|" "$lava_model_params" |
| 599 | ;; |
| 600 | image) |
| 601 | sed -i -e "s|=kernel.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 602 | ;; |
Leonardo Sandoval | b1fb634 | 2021-11-18 15:34:25 -0600 | [diff] [blame] | 603 | ivy) |
| 604 | sed -i -e "s|=ivy.pkg|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 605 | ;; |
| 606 | manifest_dtb) |
| 607 | sed -i -e "s|=manifest.dtb|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 608 | ;; |
Leonardo Sandoval | df9c92f | 2021-03-12 11:31:09 -0600 | [diff] [blame] | 609 | mcp_rom_hyphen) |
| 610 | sed -i -e "s|=mcp-rom.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 611 | ;; |
| 612 | ramdisk) |
| 613 | sed -i -e "s|=initrd.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 614 | sed -i -e "s|=initrd.img|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 615 | ;; |
| 616 | scp_ram_hyphen) |
| 617 | sed -i -e "s|=scp-ram.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 618 | ;; |
| 619 | scp_rom_hyphen) |
| 620 | sed -i -e "s|=scp-rom.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 621 | ;; |
| 622 | tmp | hafnium | secure_hafnium) |
| 623 | sed -i -e "s|=.*/${m}.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 624 | ;; |
| 625 | *) |
| 626 | sed -i -e "s|=${m}.bin|=${artefacts_macros[$m]}|" "$lava_model_params" |
| 627 | ;; |
| 628 | esac |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 629 | done |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 630 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 631 | # include the model parameters |
| 632 | while read -r line; do |
| 633 | if [ -n "$line" ]; then |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 634 | yaml_line="- \"${line}\"" |
| 635 | sed -i -e "/{BOOT_ARGUMENTS}/i \ \ \ \ $yaml_line" "$yaml_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 636 | fi |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 637 | done < "$lava_model_params" |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 638 | sed -i -e '/{BOOT_ARGUMENTS}/d' "$yaml_file" |
Leonardo Sandoval | be690bd | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 639 | |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 640 | # Append expect commands into the job definition through test-interactive commands |
| 641 | gen_fvp_yaml_expect >> "$yaml_file" |
| 642 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 643 | # create job.yaml |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 644 | cp "$yaml_file" "$yaml_job_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 645 | |
Leonardo Sandoval | 850a486 | 2021-02-16 13:56:18 -0600 | [diff] [blame] | 646 | # archive both yamls |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 647 | archive_file "$yaml_file" |
Leonardo Sandoval | 5d90dff | 2020-10-12 17:59:39 -0500 | [diff] [blame] | 648 | archive_file "$yaml_job_file" |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 649 | } |
| 650 | |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 651 | gen_fvp_yaml_expect() { |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 652 | |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 653 | run_root="$archive/run" |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 654 | |
| 655 | # Loop through all uarts expect files |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 656 | for expect_file in $(find $run_root -name expect); do |
| 657 | |
| 658 | # TODO: currently, only handle UART 0 |
| 659 | case $expect_file in |
| 660 | *uart0* ) |
| 661 | uart_number=uart0 |
| 662 | ;; |
| 663 | *) |
| 664 | continue |
| 665 | ;; |
| 666 | esac |
| 667 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 668 | # Array containing "interactive" or "monitor" expect strings and populated during run config execution. |
| 669 | # Interactive expect scripts are converted into LAVA Interactive Test Actions (see |
| 670 | # https://tf.validation.linaro.org/static/docs/v2/interactive.html#writing-tests-interactive) and |
| 671 | # monitor expect scripts are converted into LAVA Monitor Test Actions (see |
| 672 | # https://validation.linaro.org/static/docs/v2/actions-test.html#monitor) |
| 673 | # |
| 674 | # Interactive Expect strings have the format 'i;<prompt>;<succeses>;<failures>;<commands>' |
| 675 | # where multiple successes or failures or commands are separated by @ |
| 676 | # |
| 677 | # Monitor Expect strings have the format 'm;<start>;<end>;<patterns>' |
| 678 | # where multiple patterns are separated by @ |
| 679 | # |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 680 | expect_string=() |
| 681 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 682 | # Get the real name of the expect file |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 683 | expect_file=$(cat $expect_file) |
| 684 | |
| 685 | # Source the run_config enviroment variables |
| 686 | env=$run_root/$uart_number/env |
| 687 | if [ -e $env ]; then |
| 688 | source $env |
| 689 | fi |
| 690 | |
| 691 | # Get all expect strings |
| 692 | expect_file=$ci_root/lava-expect/${expect_file} |
| 693 | source $expect_file |
| 694 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 695 | |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 696 | if [ ${#expect_string[@]} -gt 0 ]; then |
| 697 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 698 | # expect loop |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 699 | for key in "${!expect_string[@]}"; do |
| 700 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 701 | # single raw expect string |
| 702 | es="${expect_string[${key}]}" |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 703 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 704 | # action type: either m or i |
| 705 | action="$(echo "${es}" | awk -F ';' '{print $1}')" |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 706 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 707 | if [ "${action}" = "m" ]; then |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 708 | |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 709 | start="$(echo "${es}" | awk -F ';' '{print $2}')" |
| 710 | end="$(echo "${es}" | awk -F ';' '{print $3}')" |
| 711 | patterns="$(echo "${es}" | awk -F ';' '{print $4}')" |
| 712 | |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 713 | cat << EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 714 | - test: |
| 715 | monitors: |
| 716 | - name: tests |
| 717 | start: '${start}' |
| 718 | end: '${end}' |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 719 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 720 | # Patterns are separated by '@' |
| 721 | OLD_IFS=$IFS; IFS=$'@' |
| 722 | for p in ${patterns}; do |
| 723 | cat << EOF |
| 724 | pattern: '$p' |
| 725 | EOF |
| 726 | done |
| 727 | IFS=$OLD_IFS |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 728 | cat << EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 729 | fixupdict: |
| 730 | PASS: pass |
| 731 | FAIL: fail |
| 732 | EOF |
| 733 | fi # end of monitor action |
| 734 | |
| 735 | if [ "${action}" = "i" ]; then |
| 736 | |
| 737 | prompts="$(echo "${es}" | awk -F ';' '{print $2}')" |
| 738 | successes="$(echo "${es}" | awk -F ';' '{print $3}')" |
| 739 | failures="$(echo "${es}" | awk -F ';' '{print $4}')" |
| 740 | commands="$(echo "${es}" | awk -F ';' '{print $5}')" |
| 741 | |
| 742 | cat << EOF |
| 743 | - test: |
| 744 | interactive: |
| 745 | EOF |
| 746 | OLD_IFS=$IFS; IFS=$'@' |
| 747 | |
| 748 | if [[ -n "${prompts}" && -n "${successes}" && -n "${failures}" ]]; then |
| 749 | cat << EOF |
| 750 | - name: interactive_${uart_number}_${key} |
| 751 | prompts: ['${prompts}'] |
| 752 | script: |
| 753 | EOF |
| 754 | if [ -z "${commands}" ]; then |
| 755 | cat <<EOF |
| 756 | - name: interactive_command_${uart_number}_${key} |
| 757 | command: |
| 758 | EOF |
| 759 | else |
| 760 | for c in ${commands}; do |
| 761 | cat <<EOF |
| 762 | - name: interactive_command_${uart_number}_${key} |
Paul Sokolovsky | df44524 | 2021-12-15 16:57:51 +0300 | [diff] [blame^] | 763 | command: "$c" |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 764 | EOF |
| 765 | done |
| 766 | fi |
| 767 | cat << EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 768 | successes: |
| 769 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 770 | for s in ${successes}; do |
| 771 | cat <<EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 772 | - message: '$s' |
| 773 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 774 | done |
| 775 | cat << EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 776 | failures: |
| 777 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 778 | for f in ${failures}; do |
| 779 | cat <<EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 780 | - message: '$f' |
| 781 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 782 | done |
| 783 | elif [[ -n "${prompts}" && -n "${successes}" ]]; then |
| 784 | cat << EOF |
| 785 | - name: interactive_${uart_number}_${key} |
| 786 | prompts: ['${prompts}'] |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 787 | script: |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 788 | EOF |
| 789 | |
| 790 | if [ -z "${commands}" ]; then |
| 791 | cat <<EOF |
| 792 | - name: interactive_command_${uart_number}_${key} |
| 793 | command: |
| 794 | EOF |
| 795 | else |
| 796 | for c in ${commands}; do |
| 797 | cat <<EOF |
| 798 | - name: interactive_command_${uart_number}_${key} |
Paul Sokolovsky | df44524 | 2021-12-15 16:57:51 +0300 | [diff] [blame^] | 799 | command: "$c" |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 800 | EOF |
| 801 | done |
| 802 | fi |
| 803 | cat << EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 804 | successes: |
| 805 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 806 | for s in ${successes}; do |
| 807 | cat <<EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 808 | - message: '$s' |
| 809 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 810 | done |
| 811 | |
| 812 | elif [[ -n "${prompts}" && -n "${failures}" ]]; then |
| 813 | cat << EOF |
| 814 | - name: interactive_${uart_number}_${key} |
| 815 | prompts: ['${prompts}'] |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 816 | script: |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 817 | EOF |
| 818 | if [ -z "${commands}" ]; then |
| 819 | cat <<EOF |
| 820 | - name: interactive_command_${uart_number}_${key} |
| 821 | command: |
| 822 | EOF |
| 823 | else |
| 824 | for c in ${commands}; do |
| 825 | cat <<EOF |
| 826 | - name: interactive_command_${uart_number}_${key} |
Paul Sokolovsky | df44524 | 2021-12-15 16:57:51 +0300 | [diff] [blame^] | 827 | command: "$c" |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 828 | EOF |
| 829 | done |
| 830 | fi |
| 831 | cat << EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 832 | failures: |
| 833 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 834 | for f in ${failures}; do |
| 835 | cat <<EOF |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 836 | - message: '$f' |
| 837 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 838 | done |
| 839 | else |
| 840 | cat << EOF |
| 841 | - name: interactive_${uart_number}_${key} |
| 842 | prompts: ['${prompts}'] |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 843 | script: |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 844 | EOF |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 845 | if [ -z "${commands}" ]; then |
| 846 | cat <<EOF |
| 847 | - name: interactive_command_${uart_number}_${key} |
| 848 | command: |
| 849 | EOF |
| 850 | else |
| 851 | for c in ${commands}; do |
| 852 | cat <<EOF |
| 853 | - name: interactive_command_${uart_number}_${key} |
Paul Sokolovsky | df44524 | 2021-12-15 16:57:51 +0300 | [diff] [blame^] | 854 | command: "$c" |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 855 | EOF |
| 856 | done |
| 857 | fi |
| 858 | fi |
| 859 | |
| 860 | IFS=$OLD_IFS |
| 861 | fi # end of interactive action |
| 862 | |
| 863 | done # end of expect loop |
| 864 | |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 865 | fi |
Leonardo Sandoval | 5cfc11f | 2021-09-08 16:08:13 -0500 | [diff] [blame] | 866 | done # end of uart loop |
Leonardo Sandoval | cd06bf4 | 2021-04-08 11:53:39 -0500 | [diff] [blame] | 867 | } |
| 868 | |
Leonardo Sandoval | d76d1e2 | 2020-10-06 16:02:52 -0500 | [diff] [blame] | 869 | docker_registry_append() { |
| 870 | # if docker_registry is empty, just use local docker registry |
| 871 | [ -z "$docker_registry" ] && return |
| 872 | |
| 873 | local last=-1 |
| 874 | local last_char="${docker_registry:last}" |
| 875 | |
| 876 | if [ "$last_char" != '/' ]; then |
| 877 | docker_registry="${docker_registry}/"; |
| 878 | fi |
| 879 | echo "$docker_registry" |
| 880 | } |
| 881 | |
Manish V Badarkhe | ea3e094 | 2021-03-05 11:51:48 +0000 | [diff] [blame] | 882 | # generate GPT image and archive it |
| 883 | gen_gpt_bin() { |
| 884 | raw_image="fip_gpt.bin" |
| 885 | img_uuid="FB90808A-BA9A-4D42-B9A2-A7A937144AEE" |
| 886 | img_bank_uuid=`uuidgen` |
| 887 | disk_uuid=`uuidgen` |
| 888 | bin="${1:?}" |
| 889 | |
| 890 | # maximum FIP size 2MB |
| 891 | fip_max_size=2097152 |
| 892 | start_sector=34 |
| 893 | sector_size=512 |
| 894 | num_sectors=$(($fip_max_size/$sector_size)) |
| 895 | bin_size=$(stat -c %s $bin) |
| 896 | |
| 897 | if [[ $fip_max_size -lt $bin_size ]] |
| 898 | then |
| 899 | echo "FIP binary ($bin_size bytes) larger than max partition 1" |
| 900 | "size ($fip_max_size byte)" |
| 901 | return |
| 902 | fi |
| 903 | |
| 904 | # create raw 5MB image |
| 905 | dd if=/dev/zero of=$raw_image bs=5M count=1 |
| 906 | |
| 907 | # create GPT image |
| 908 | sgdisk -a 1 -U $disk_uuid -n 1:$start_sector:+$num_sectors \ |
| 909 | -c 1:FIP_A -t 1:$img_uuid $raw_image -u $img_bank_uuid |
| 910 | |
| 911 | echo "write binary $bin at sector $start_sector" |
| 912 | dd if=$bin of=$raw_image bs=$sector_size seek=$start_sector \ |
| 913 | count=$num_sectors conv=notrunc |
| 914 | |
| 915 | archive_file "fip_gpt.bin" |
| 916 | } |
| 917 | |
Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame] | 918 | set +u |