Matthew Garrett
2012-Mar-27 14:58 UTC
[syslinux] [PATCH] isohybrid: Avoid re-using the UUID on multiple filesystems
The code currently uses the same GPT UUID for both filesystem partitions. This confuses OS X rather badly. Add a new UUID for the HFS+ partition. --- utils/isohybrid.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/isohybrid.c b/utils/isohybrid.c index ac04bfd..dec5f0b 100644 --- a/utils/isohybrid.c +++ b/utils/isohybrid.c @@ -45,7 +45,7 @@ extern int opterr, optind; struct stat isostat; unsigned int padding = 0; -uuid_t disk_uuid, part_uuid, iso_uuid; +uuid_t disk_uuid, part_uuid, mac_uuid, iso_uuid; uint8_t mode = 0; enum { VERBOSE = 1 , EFI = 2 , MAC = 4}; @@ -784,8 +784,10 @@ initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary) if (primary) { uuid_generate(part_uuid); uuid_generate(iso_uuid); + uuid_generate(mac_uuid); reverse_uuid(part_uuid); reverse_uuid(iso_uuid); + reverse_uuid(mac_uuid); } memcpy(part->partGUID, iso_uuid, sizeof(uuid_t)); @@ -810,7 +812,7 @@ initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary) part++; - memcpy(part->partGUID, part_uuid, sizeof(uuid_t)); + memcpy(part->partGUID, mac_uuid, sizeof(uuid_t)); memcpy(part->partTypeGUID, hfs_partition, sizeof(uuid_t)); part->firstLBA = lendian_64(mac_lba * 4); part->lastLBA = lendian_64(part->firstLBA + mac_count - 1); -- 1.7.7.6