fix(fvp): Revert "feat(fvp): improve ROMlib's jump table index file management"

This reverts commit 6b693e4fcf5b6e7202701613b42d4f3289b8b600.

This patch makes the following test configs fail:
* spm-l2-boot-tests/fvp-default,fvp-spm-tbb,fvp-default:fvp-spm+romlib
* spm-l2-boot-tests/fvp-default,fvp-spm-tbb-dualroot,fvp-default:fvp-spm+romlib
* tf-l2-boot-tests-misc/fvp-tbb-mbedtls-romlib:fvp-linux-dtb.1t-romlib-fip.uboot-aemv8a-debug

with the following error message:

  Assembler messages:
  Error: can't open /work/workspace/workspace/tf-worker_ws_10/trusted_firmware/build/fvp/debug/libwrapper/fdt_getprop.s for reading: No such file or directory

I suspect the patched index file is removed too soon, compared to when fvp_romlib_cleanup() was
called previously. This needs more investigation. Reverting the patch to fix the CI in the short
term. Will push a new version soon.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I31bc56edb980e626e2aede2c4dce7d90b76e2e89
diff --git a/fvp_utils.sh b/fvp_utils.sh
index 9fc4e68..5365d3d 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -243,6 +243,8 @@
 	popd
 }
 
+fvp_romlib_jmptbl_backup="$(mktempdir)/jmptbl.i"
+
 fvp_romlib_runtime() {
 	local tmpdir="$(mktempdir)"
 
@@ -251,32 +253,24 @@
 	mv "${tf_build_root:?}/${plat:?}/${mode:?}/bl1.bin" "$tmpdir/bl1.bin"
 
 	# Patch index file
-	(
-		fvp_romlib_jmptbl="${tf_root:?}/plat/arm/board/fvp/jmptbl.i"
-		fvp_romlib_jmptbl_backup="$(mktempdir)/jmptbl.i"
+	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
 
-		function __restore() {
-			mv "$fvp_romlib_jmptbl_backup" "$fvp_romlib_jmptbl";
-		}
-
-		# Make sure the original index file is restored.
-		# This will be done either when the current sub-shell exits or
-		# when one of the sub-shell's commands fails.
-		trap __restore EXIT HUP QUIT INT TERM
-
-		cp "$fvp_romlib_jmptbl" "$fvp_romlib_jmptbl_backup"
-		sed -i '/fdt/ s/.$/&\ patch/' "$fvp_romlib_jmptbl"
-
-		# Rebuild with patched file
-		echo "Building patched romlib:"
-		build_tf
-	)
+	# Rebuild with patched file
+	echo "Building patched romlib:"
+	build_tf
 
 	# Retrieve original BL1 and romlib binaries
 	mv "$tmpdir/romlib.bin" "${tf_build_root:?}/${plat:?}/${mode:?}/romlib/romlib.bin"
 	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"
+}
+
+
 fvp_gen_bin_url() {
     local bin_mode="${bin_mode:?}"
     local bin="${1:?}"