[syslinux] [PATCH] utils/isohybrid.c: 003 Correct end block address of first GPT partition

Thomas Schmitt scdbackup at gmx.net
Sun Jun 22 12:27:26 PDT 2014


The GPT partition 1 covers the whole ISO filesystem size. GPT specs
demand that the partition end block number shall be the last valid
block in the partition. isohybrid.c rather wrote the number of the
first block after the partition end.

This change reduces the number by 1.

--- isohybrid.c.002_apm_block_count	2014-06-22 20:05:13.000000000 +0200
+++ isohybrid.c.003_gpt_part_1_last_lba	2014-06-22 20:05:03.000000000 +0200
@@ -797,7 +797,7 @@ initialise_gpt(uint8_t *gpt, uint32_t cu
     memcpy(part->partGUID, iso_uuid, sizeof(uuid_t));
     memcpy(part->partTypeGUID, basic_partition, sizeof(uuid_t));
     part->firstLBA = lendian_64(0);
-    part->lastLBA = lendian_64(psize);
+    part->lastLBA = lendian_64(psize - 1);
     memcpy(part->name, part_name_iso, 28);
 
     gpt += sizeof(struct gpt_part_header);


More information about the Syslinux mailing list