forked from bottlerocket-os/bottlerocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0039-gpt-rename-and-update-documentation-for-grub_gpt_upd.patch
71 lines (58 loc) · 2.48 KB
/
0039-gpt-rename-and-update-documentation-for-grub_gpt_upd.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From ed3b92445adb3f2b73d22f5c0ca65447944b023f Mon Sep 17 00:00:00 2001
From: Michael Marineau <michael.marineau@coreos.com>
Date: Thu, 22 Sep 2016 10:00:27 -0700
Subject: [PATCH] gpt: rename and update documentation for grub_gpt_update
The function now does more than just recompute checksums so give it a
more general name to reflect that.
---
grub-core/commands/gptprio.c | 2 +-
grub-core/lib/gpt.c | 4 ++--
include/grub/gpt_partition.h | 7 ++++---
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/grub-core/commands/gptprio.c b/grub-core/commands/gptprio.c
index b799faa..8908d8b 100644
--- a/grub-core/commands/gptprio.c
+++ b/grub-core/commands/gptprio.c
@@ -127,7 +127,7 @@ grub_find_next (const char *disk_name,
grub_gptprio_set_tries_left (part_found, tries_left - 1);
- if (grub_gpt_update_checksums (gpt))
+ if (grub_gpt_update (gpt))
goto done;
if (grub_gpt_write (dev->disk, gpt))
diff --git a/grub-core/lib/gpt.c b/grub-core/lib/gpt.c
index f6f8533..4304048 100644
--- a/grub-core/lib/gpt.c
+++ b/grub-core/lib/gpt.c
@@ -643,7 +643,7 @@ grub_gpt_repair (grub_disk_t disk, grub_gpt_t gpt)
else
return grub_error (GRUB_ERR_BUG, "No valid GPT");
- if (grub_gpt_update_checksums (gpt))
+ if (grub_gpt_update (gpt))
return grub_errno;
grub_dprintf ("gpt", "repairing GPT for %s successful\n", disk->name);
@@ -652,7 +652,7 @@ grub_gpt_repair (grub_disk_t disk, grub_gpt_t gpt)
}
grub_err_t
-grub_gpt_update_checksums (grub_gpt_t gpt)
+grub_gpt_update (grub_gpt_t gpt)
{
grub_uint32_t crc;
diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h
index d94b93a..797692c 100644
--- a/include/grub/gpt_partition.h
+++ b/include/grub/gpt_partition.h
@@ -232,11 +232,12 @@ grub_gpt_t grub_gpt_read (grub_disk_t disk);
struct grub_gpt_partentry * grub_gpt_get_partentry (grub_gpt_t gpt,
grub_uint32_t n);
-/* Sync up primary and backup headers, recompute checksums. */
+/* Sync and update primary and backup headers if either are invalid. */
grub_err_t grub_gpt_repair (grub_disk_t disk, grub_gpt_t gpt);
-/* Recompute checksums, must be called after modifying GPT data. */
-grub_err_t grub_gpt_update_checksums (grub_gpt_t gpt);
+/* Recompute checksums and revalidate everything, must be called after
+ * modifying any GPT data. */
+grub_err_t grub_gpt_update (grub_gpt_t gpt);
/* Write headers and entry tables back to disk. */
grub_err_t grub_gpt_write (grub_disk_t disk, grub_gpt_t gpt);
--
2.21.3