feat(fvp): improve ROMlib's jump table index file management
fvp_romlib_runtime() does the following steps:
1. Save the original jump table index file used to build the ROMlib.
2. Patch it.
3. Rebuild the ROMlib (with the patched jump table index file).
Then the run config is expected to call fvp_romlib_cleanup() in the
post_tf_archive() hook to restore the original jump table index file.
If any command fails in between step 2 and fvp_romlib_cleanup(), or if
the run config does not call fvp_romlib_cleanup() as expected, then
the jump table index file is left as is. This is particulary
problematic when running the CI scripts on a developer's local
machine because it directly modifies their local repository.
This patch solves this issue by:
- moving steps 1-2-3 to a sub-shell.
- attaching fvp_romlib_cleanup() as a trap handler for this sub-shell.
This way, as soon as the sub-shell exits - either normally or abruptly
due to an error, the index file is restored as expected. As a result,
run configurations no longer need to do this explicitly.
Change-Id: I8fd8be008108f1e624a0b2d646af358df1b3fdc6
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
3 files changed