From b77917fb63ba879d3902dce42db2905dc2dd5388 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 7 Oct 2012 11:53:36 +0200 Subject: [PATCH] Bug fix: Non-zero partition offset zeroized the MBR copies of GPT partition table entries which were enabled by el_torito_set_isolinux_options() --- libisofs/libisofs.h | 6 +++++- libisofs/system_area.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 5865771..b7aac0a 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -3488,7 +3488,11 @@ int el_torito_seems_boot_info_table(ElToritoBootImage *bootimg, int flag); * iso_write_opts_set_hfsplus(). * @since 1.2.4 * Primary GPT and backup GPT get written if at least one - * ElToritoBootImage shall be mentioned + * ElToritoBootImage shall be mentioned. + * The first three mentioned GPT partitions get mirrored in the + * the partition table of the isohybrid MBR. They get type 0xfe. + * Often it is one of these MBR partitions which actually gets + * used by EFI. * @since 1.2.4 * bit8= Mention in isohybrid Apple partition map * APM get written if at least one ElToritoBootImage shall be diff --git a/libisofs/system_area.c b/libisofs/system_area.c index 26ccf94..12644c2 100644 --- a/libisofs/system_area.c +++ b/libisofs/system_area.c @@ -1578,7 +1578,7 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf) img_blocks = t->curblock; /* value might be altered */ ret = iso_offset_partition_start(img_blocks, t->partition_offset, t->partition_secs_per_head, - t->partition_heads_per_cyl, buf, 1); + t->partition_heads_per_cyl, buf, 0); if (ret != ISO_SUCCESS) /* error should never happen */ return ISO_ASSERT_FAILURE; }