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

Thomas Schmitt scdbackup at gmx.net
Sun Jun 22 13:24:19 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.
---
 utils/isohybrid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/isohybrid.c b/utils/isohybrid.c
index 7d0864e..ff6b930 100644
--- a/utils/isohybrid.c
+++ b/utils/isohybrid.c
@@ -797,7 +797,7 @@ initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary)
     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);
-- 
1.8.4.2



More information about the Syslinux mailing list