fix(romlib): make romlib file modification idempotent

The romlib run configs perform a find+replace on a file in TF-A.
However, that is written such that it is not idempotent - running the
configuration multiple times will stack changes on top of each other,
resulting in a file different to the one intended.

So convert this to a patch and use the regular apply_tf_patch
functionality. This has the benefit of not using the main tfa checkout
for parallel builds.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ic310c8b42d9f5a4cf8a1cf1c86198ea796202d94
diff --git a/fvp_utils.sh b/fvp_utils.sh
index 1bca9dd..7f72c6d 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -202,8 +202,6 @@
 	popd
 }
 
-fvp_romlib_jmptbl_backup="$(mktempdir)/jmptbl.i"
-
 fvp_romlib_runtime() {
 	local tmpdir="$(mktempdir)"
 
@@ -212,8 +210,7 @@
 	mv "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" "$tmpdir/bl1.bin"
 
 	# Patch index file
-	cp "${tf_root:?}/plat/arm/board/fvp/jmptbl.i" "$fvp_romlib_jmptbl_backup"
-	sed -i '/fdt/ s/.$/&\ patch/' ${tf_root:?}/plat/arm/board/fvp/jmptbl.i
+	apply_tf_patch "fvp_romlib_runtime/jmptbl_i_patch.patch"
 
 	# Rebuild with patched file
 	echo "Building patched romlib:"
@@ -224,12 +221,6 @@
 	mv "$tmpdir/bl1.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin"
 }
 
-fvp_romlib_cleanup() {
-	# Restore original index
-	mv "$fvp_romlib_jmptbl_backup" "${tf_root:?}/plat/arm/board/fvp/jmptbl.i"
-}
-
-
 # Generates the final YAML-based LAVA job definition from a template file.
 #
 # The job definition template is expanded with visibility of all variables that