summaryrefslogtreecommitdiff
path: root/cgpt/cgpt_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgpt/cgpt_common.c')
-rw-r--r--cgpt/cgpt_common.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c
index 1a6bd3cb..f6108c1e 100644
--- a/cgpt/cgpt_common.c
+++ b/cgpt/cgpt_common.c
@@ -763,6 +763,20 @@ GptEntry *GetEntry(GptData *gpt, int secondary, uint32_t entry_index) {
return (GptEntry*)(&entries[stride * entry_index]);
}
+void SetRequired(struct drive *drive, int secondary, uint32_t entry_index,
+ int required) {
+ require(required >= 0 && required <= CGPT_ATTRIBUTE_MAX_REQUIRED);
+ GptEntry *entry;
+ entry = GetEntry(&drive->gpt, secondary, entry_index);
+ SetEntryRequired(entry, required);
+}
+
+int GetRequired(struct drive *drive, int secondary, uint32_t entry_index) {
+ GptEntry *entry;
+ entry = GetEntry(&drive->gpt, secondary, entry_index);
+ return GetEntryRequired(entry);
+}
+
void SetLegacyBoot(struct drive *drive, int secondary, uint32_t entry_index,
int legacy_boot) {
require(legacy_boot >= 0 && legacy_boot <= CGPT_ATTRIBUTE_MAX_LEGACY_BOOT);