fix: swap LAVA YAML template generation for broken jobs

This change introduces two new hooks:

- `generate_lava_job_template` is expected to generate the initial LAVA
  job YAML file (`job.yaml`), which may include fields which are not
  yet known
- `generate_lava_job` is used to fill in anything in the LAVA job that
  was not known when the job YAML file was generated

Previously, these were incorporated into other hooks almost
arbitrarily, and in some jobs this meant that they were invoked in the
wrong order. These new hooks allow us to be explicit about the order
that these operations occur.

Change-Id: I07f96b91a7ddb04b599ccca674797d4714296c21
Signed-off-by: Chris Kay <chris.kay@arm.com>
diff --git a/run_config/fvp-aemv8r.linux b/run_config/fvp-aemv8r.linux
index 8e597f0..086d60c 100755
--- a/run_config/fvp-aemv8r.linux
+++ b/run_config/fvp-aemv8r.linux
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright (c) 2021 Arm Limited. All rights reserved.
+# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -21,24 +21,20 @@
 	build_fip BL33="$archive/uboot.bin"
 }
 
-fetch_tf_resource() {
-	# Expect script for yocto linux boot
-	uart="0" file="fvp-r-yocto.exp" track_expect
-
-	# Generate FVP model YAML template
+generate_lava_job_template() {
 	payload_type="linux" gen_fvp_yaml_template
 }
 
-post_fetch_tf_resource() {
-        local model="baser-aemv8r"
+generate_lava_job() {
+	local model="baser-aemv8r"
 
-        # Generate the model command parameters
+	uart="0" file="fvp-r-yocto.exp" track_expect
+
 	model="$model" \
-	fip_addr=0x40000000 \
-	dtb_addr=0x03000000 \
-	kernel_addr=0x00800000 \
-	gen_model_params
+		dtb_addr="0x03000000" \
+		fip_addr="0x40000000" \
+		kernel_addr="0x00800000" \
+		gen_model_params
 
-	# Generate the FVP yaml file
 	model="$model" gen_fvp_yaml
 }