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

syslinux-bot for Thomas Schmitt scdbackup at gmx.net
Mon Jun 23 20:09:06 PDT 2014


Commit-ID:  a9343ca8943ae2089d46f74ce521946fb6f9f56d
Gitweb:     http://www.syslinux.org/commit/a9343ca8943ae2089d46f74ce521946fb6f9f56d
Author:     Thomas Schmitt <scdbackup at gmx.net>
AuthorDate: Sun, 22 Jun 2014 22:24:19 +0200
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 23 Jun 2014 19:48:56 -0700

utils/isohybrid.c: Correct end block address of first GPT partition

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.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>

---
 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);


More information about the Syslinux-commits mailing list