diff --git a/grub-core/commands/gptprio.c b/grub-core/commands/gptprio.c index 4a24fa62d..8908d8bed 100644 --- a/grub-core/commands/gptprio.c +++ b/grub-core/commands/gptprio.c @@ -75,7 +75,7 @@ grub_gptprio_successful (struct grub_gpt_partentry *entry) static grub_err_t grub_find_next (const char *disk_name, - const grub_gpt_part_type_t *part_type, + const grub_gpt_part_guid_t *part_type, char **part_name, char **part_guid) { struct grub_gpt_partentry *part, *part_found = NULL; @@ -162,7 +162,7 @@ grub_cmd_next (grub_extcmd_context_t ctxt, int argc, char **args) char *p, *root = NULL, *part_name = NULL, *part_guid = NULL; /* TODO: Add a uuid parser and a command line flag for providing type. */ - grub_gpt_part_type_t part_type = GRUB_GPT_PARTITION_TYPE_USR_X86_64; + grub_gpt_part_guid_t part_type = GRUB_GPT_PARTITION_TYPE_USR_X86_64; if (!state[NEXT_SET_DEVICE].set || !state[NEXT_SET_UUID].set) { diff --git a/grub-core/disk/ldm.c b/grub-core/disk/ldm.c index 0f978ad05..2a22d2d6c 100644 --- a/grub-core/disk/ldm.c +++ b/grub-core/disk/ldm.c @@ -135,7 +135,7 @@ msdos_has_ldm_partition (grub_disk_t dsk) return has_ldm; } -static const grub_gpt_part_type_t ldm_type = GRUB_GPT_PARTITION_TYPE_LDM; +static const grub_gpt_part_guid_t ldm_type = GRUB_GPT_PARTITION_TYPE_LDM; /* Helper for gpt_ldm_sector. */ static int diff --git a/grub-core/lib/gpt.c b/grub-core/lib/gpt.c index 95538d5a3..80bca2e4e 100644 --- a/grub-core/lib/gpt.c +++ b/grub-core/lib/gpt.c @@ -39,7 +39,7 @@ grub_gpt_read_entries (grub_disk_t disk, grub_gpt_t gpt, grub_size_t *ret_entries_size); char * -grub_gpt_guid_to_str (grub_gpt_guid_t *guid) +grub_gpt_guid_to_str (grub_gpt_part_guid_t *guid) { return grub_xasprintf ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", grub_le_to_cpu32 (guid->data1), @@ -308,7 +308,7 @@ grub_gpt_headers_equal (grub_gpt_t gpt) return 0; return grub_memcmp(&gpt->primary.guid, &gpt->backup.guid, - sizeof(grub_gpt_guid_t)) == 0; + sizeof(grub_gpt_part_guid_t)) == 0; } static grub_err_t diff --git a/grub-core/partmap/gpt.c b/grub-core/partmap/gpt.c index 83bcba779..103f6796f 100644 --- a/grub-core/partmap/gpt.c +++ b/grub-core/partmap/gpt.c @@ -33,10 +33,10 @@ static grub_uint8_t grub_gpt_magic[8] = 0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54 }; -static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; +static const grub_gpt_part_guid_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; #ifdef GRUB_UTIL -static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; +static const grub_gpt_part_guid_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; #endif /* 512 << 7 = 65536 byte sectors. */ diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h index 6afaee5a1..cdb6dfe8f 100644 --- a/include/grub/gpt_partition.h +++ b/include/grub/gpt_partition.h @@ -23,18 +23,17 @@ #include #include -struct grub_gpt_guid +struct grub_gpt_part_guid { grub_uint32_t data1; grub_uint16_t data2; grub_uint16_t data3; grub_uint8_t data4[8]; } GRUB_PACKED; -typedef struct grub_gpt_guid grub_gpt_guid_t; -typedef struct grub_gpt_guid grub_gpt_part_type_t; +typedef struct grub_gpt_part_guid grub_gpt_part_guid_t; /* Format the raw little-endian GUID as a newly allocated string. */ -char * grub_gpt_guid_to_str (grub_gpt_guid_t *guid); +char * grub_gpt_guid_to_str (grub_gpt_part_guid_t *guid); #define GRUB_GPT_GUID_INIT(a, b, c, d1, d2, d3, d4, d5, d6, d7, d8) \ @@ -82,7 +81,7 @@ struct grub_gpt_header grub_uint64_t alternate_lba; grub_uint64_t start; grub_uint64_t end; - grub_gpt_guid_t guid; + grub_gpt_part_guid_t guid; grub_uint64_t partitions; grub_uint32_t maxpart; grub_uint32_t partentry_size; @@ -91,8 +90,8 @@ struct grub_gpt_header struct grub_gpt_partentry { - grub_gpt_guid_t type; - grub_gpt_guid_t guid; + grub_gpt_part_guid_t type; + grub_gpt_part_guid_t guid; grub_uint64_t start; grub_uint64_t end; grub_uint64_t attrib; diff --git a/util/grub-install.c b/util/grub-install.c index 690f180c5..78d0138cb 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -714,7 +714,7 @@ is_prep_partition (grub_device_t dev) if (grub_disk_read (dev->disk, p->offset, p->index, sizeof (gptdata), &gptdata) == 0) { - const grub_gpt_part_type_t template = { + const grub_gpt_part_guid_t template = { grub_cpu_to_le32_compile_time (0x9e1a2d38), grub_cpu_to_le16_compile_time (0xc612), grub_cpu_to_le16_compile_time (0x4316),