gpt: report all revalidation errors

Before returning an error that the primary or backup GPT is invalid push
the existing error onto the stack so the user will be told what is bad.
This commit is contained in:
Michael Marineau 2016-09-21 16:02:53 -07:00
parent 5342b880f4
commit 7cd866bd2d

View file

@ -669,13 +669,19 @@ grub_gpt_update_checksums (grub_gpt_t gpt)
grub_gpt_header_lecrc32 (&gpt->backup.crc32, &gpt->backup);
if (grub_gpt_check_primary (gpt))
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT primary header");
{
grub_error_push ();
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT primary header");
}
gpt->status |= (GRUB_GPT_PRIMARY_HEADER_VALID |
GRUB_GPT_PRIMARY_ENTRIES_VALID);
if (grub_gpt_check_backup (gpt))
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT backup header");
{
grub_error_push ();
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT backup header");
}
gpt->status |= (GRUB_GPT_BACKUP_HEADER_VALID |
GRUB_GPT_BACKUP_ENTRIES_VALID);