feat(fwu): corrupted primary and secondary GPT headers
Adding testcase for primary and secondary GPT headers
corrupted. The boot should fail.
Signed-off-by: Xialin Liu <xialin.liu@arm.com>
Change-Id: I7d6f1bda09553cd786f69d6fbb38f3a766c624d5
diff --git a/fvp_utils.sh b/fvp_utils.sh
index c7fe4ac..d1b8296 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -678,8 +678,16 @@
seek=0
count=1
;;
+ "secondary-header")
+ # Secondary GPT header is present in LBA-1 last block before the
+ # end of the GPT image.
+ # Secondary GPT header is located after the backup FWU metadata,
+ # which is 1 sector in size.
+ seek=$(( $(gdisk -l "$bin" | grep " Bkup-FWU-Metadata$" | awk '{print $2}') + 1 ))
+ count=1
+ ;;
*)
- echo "Invalid $corrupt_data. Use 'header', 'partition-entries', 'fwu-metadata' or 'mbr'."
+ echo "Invalid $corrupt_data. Use 'header', 'partition-entries', 'fwu-metadata' or 'mbr', 'fwu-metadata' or 'secondary-header'."
return 1
;;
esac