aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorThomas Schmitt <scdbackup@gmx.net>2014-06-22 22:24:18 +0200
committerH. Peter Anvin <hpa@zytor.com>2014-06-23 19:48:55 -0700
commitee9c8a36dc63c54794f5836d5c908d7e4c84fa04 (patch)
tree0394733bfe8791d3bf9dfdee4974dddd5f945492 /utils
parent8059839edcfe819ca9cd135c67a905eb53943204 (diff)
downloadsyslinux-ee9c8a36dc63c54794f5836d5c908d7e4c84fa04.tar.gz
syslinux-ee9c8a36dc63c54794f5836d5c908d7e4c84fa04.tar.xz
syslinux-ee9c8a36dc63c54794f5836d5c908d7e4c84fa04.zip
utils/isohybrid.c: Correct blocking factor in APM partition block counts
The block counts in the APM partitions assumed 512 bytes per block, whereas the start block numbers assume 2048 as announced in the APM header. This change divides the affected block counts by 4 to correct the assumption. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/isohybrid.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/isohybrid.c b/utils/isohybrid.c
index c5b42814..7d0864ec 100644
--- a/utils/isohybrid.c
+++ b/utils/isohybrid.c
@@ -842,7 +842,7 @@ initialise_apm(uint8_t *gpt, uint32_t start)
part->signature = bendian_short(0x504d);
part->map_count = bendian_int(apm_parts);
part->start_block = bendian_int(1);
- part->block_count = bendian_int(0x10);
+ part->block_count = bendian_int(4);
strcpy(part->name, "Apple");
strcpy(part->type, "Apple_partition_map");
part->data_start = bendian_int(0);
@@ -854,11 +854,11 @@ initialise_apm(uint8_t *gpt, uint32_t start)
part->signature = bendian_short(0x504d);
part->map_count = bendian_int(3);
part->start_block = bendian_int(efi_lba);
- part->block_count = bendian_int(efi_count);
+ part->block_count = bendian_int(efi_count / 4);
strcpy(part->name, "EFI");
strcpy(part->type, "Apple_HFS");
part->data_start = bendian_int(0);
- part->data_count = bendian_int(efi_count);
+ part->data_count = bendian_int(efi_count / 4);
part->status = bendian_int(0x33);
part = (struct apple_part_header *)(gpt + 4096);
@@ -868,11 +868,11 @@ initialise_apm(uint8_t *gpt, uint32_t start)
part->signature = bendian_short(0x504d);
part->map_count = bendian_int(3);
part->start_block = bendian_int(mac_lba);
- part->block_count = bendian_int(mac_count);
+ part->block_count = bendian_int(mac_count / 4);
strcpy(part->name, "EFI");
strcpy(part->type, "Apple_HFS");
part->data_start = bendian_int(0);
- part->data_count = bendian_int(mac_count);
+ part->data_count = bendian_int(mac_count / 4);
part->status = bendian_int(0x33);
} else {
part->signature = bendian_short(0x504d);