feat: add functions for retrieving prebuilts

Add generic functions for retrieving prebuilt binaries. At the moment,
the platforms implement some flavour of these in their *_utils.sh files.
None of these implementations do anything particularly special, for this
reason, should be made generic so future platforms can re-use as much as
possible.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Change-Id: I16abf60e124fa9ef6e8f0016e7b8a6537f238e5e
diff --git a/utils.sh b/utils.sh
index 2542277..008f945 100644
--- a/utils.sh
+++ b/utils.sh
@@ -264,13 +264,29 @@
 	fi
 }
 
-get_kernel() {
-	local kernel_type="${kernel_type:?}"
-	local url="${plat_kernel_list[$kernel_type]}"
+get_boot_image() {
+	local image=${image:?}
+	local type=${type:?}
 
-	url="${url:?}" filename="kernel.bin" fetch_and_archive
+	declare -n image_list=${image_list-${image}_list}
+
+	local url="${image_list[${type}]}"
+
+	url="${url:?}" filename="${image}.bin" fetch_and_archive
 }
 
+get_boot_image_from_fip() {(
+	local url="${url:?}"
+	local image="${image:?}"
+	local output_name="${output_name-bl32.bin}"
+
+	cd "$(mktempdir)"
+
+	extract_fip "$url"
+	mv "$image" "$output_name"
+	archive_file "$output_name"
+)}
+
 # Get the path to the run environment variables file.
 #
 # Run environment variables are the test-specific environment variables