aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorThomas Schmitt <scdbackup@gmx.net>2014-06-22 22:24:20 +0200
committerH. Peter Anvin <hpa@zytor.com>2014-06-23 19:48:57 -0700
commit46abb1f5a685191e0ca11dba5b8ba5e3811b6dae (patch)
tree738b10f95c557b92053be4f2bb4fd19183b6ff94 /utils
parenta9343ca8943ae2089d46f74ce521946fb6f9f56d (diff)
downloadsyslinux-46abb1f5a685191e0ca11dba5b8ba5e3811b6dae.tar.gz
syslinux-46abb1f5a685191e0ca11dba5b8ba5e3811b6dae.tar.xz
syslinux-46abb1f5a685191e0ca11dba5b8ba5e3811b6dae.zip
utils/isohybrid.c: Write GPT backup to the very end of the image
The GPT backup header block should start 512 bytes before the end of the image file (resp. end of the disk device). This block and the backup GPT array were wrongly written 512 bytes too early. This change brings the backup GPT at its correct position. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/isohybrid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/isohybrid.c b/utils/isohybrid.c
index ff6b9302..1c8f0b69 100644
--- a/utils/isohybrid.c
+++ b/utils/isohybrid.c
@@ -1084,7 +1084,7 @@ main(int argc, char *argv[])
* Primary GPT starts at sector 1, secondary GPT starts at 1 sector
* before the end of the image
*/
- initialise_gpt(buf, 1, (isostat.st_size + padding - 1024) / 512, 1);
+ initialise_gpt(buf, 1, (isostat.st_size + padding - 512) / 512, 1);
if (fseek(fp, 512, SEEK_SET))
err(1, "%s: seek error - 6", argv[0]);
@@ -1122,7 +1122,7 @@ main(int argc, char *argv[])
buf += orig_gpt_size - sizeof(struct gpt_header);
- initialise_gpt(buf, (isostat.st_size + padding - 1024) / 512, 1, 0);
+ initialise_gpt(buf, (isostat.st_size + padding - 512) / 512, 1, 0);
/* Shift back far enough to write the 128 GPT entries */
buf -= 128 * sizeof(struct gpt_part_header);
@@ -1132,7 +1132,7 @@ main(int argc, char *argv[])
* end of the image
*/
- if (fseeko(fp, (isostat.st_size + padding) - orig_gpt_size - 512,
+ if (fseeko(fp, (isostat.st_size + padding) - orig_gpt_size,
SEEK_SET))
err(1, "%s: seek error - 8", argv[0]);