forked from bottlerocket-os/bottlerocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0038-gpt-report-all-revalidation-errors.patch
40 lines (33 loc) · 1.35 KB
/
0038-gpt-report-all-revalidation-errors.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 48243011b5cffdbfb49c2b3d377754459a0a46a3 Mon Sep 17 00:00:00 2001
From: Michael Marineau <michael.marineau@coreos.com>
Date: Wed, 21 Sep 2016 16:02:53 -0700
Subject: [PATCH] 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.
---
grub-core/lib/gpt.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/grub-core/lib/gpt.c b/grub-core/lib/gpt.c
index b93cede..f6f8533 100644
--- a/grub-core/lib/gpt.c
+++ b/grub-core/lib/gpt.c
@@ -676,13 +676,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);
--
2.21.3