Bug fix: -report_system_area cmd misperceived -part_like_isohybrid with -isohybrid-gpt-basdat

This commit is contained in:
Thomas Schmitt 2022-04-22 13:32:25 +02:00
parent e651cb5040
commit 7d79692c55
2 changed files with 25 additions and 16 deletions

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net> Copyright 2007-2022 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
@ -1579,7 +1579,8 @@ static int Xorriso_register_eltorito_gpt(struct XorrisO *xorriso,
et_img->do_gpt_hfsplus= 1; et_img->do_gpt_hfsplus= 1;
return(1); return(1);
} else if(*first_efi && et_img->platform_id == 0xef) { } else if(*first_efi && et_img->platform_id == 0xef) {
*efi_boot_part= 1; if(*efi_boot_part <= 0)
*efi_boot_part= 1;
return(1); return(1);
} }
if(et_img->platform_id == 0xef) if(et_img->platform_id == 0xef)
@ -1674,7 +1675,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
int appended_as_gpt= 0, have_prep= 0, did_sysarea= 0, cared_for_apm= 0; int appended_as_gpt= 0, have_prep= 0, did_sysarea= 0, cared_for_apm= 0;
int cared_for_sparc= 0, have_hfsplus= 0; int cared_for_sparc= 0, have_hfsplus= 0;
int have_sysarea= 0, ptable_killer, imported_iso, have_alpha_ldr_path= 0; int have_sysarea= 0, ptable_killer, imported_iso, have_alpha_ldr_path= 0;
int have_protective_msdos= 0, part_like_isohybrid= 0; int have_protective_msdos= 0, part_like_isohybrid= 0, fresh_efi_boot_part;
#ifdef Not_any_more_because_padding_is_now_after_partitions #ifdef Not_any_more_because_padding_is_now_after_partitions
int appended_partition= 0; int appended_partition= 0;
@ -2327,6 +2328,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
else else
part_type= 0xcd; part_type= 0xcd;
fresh_efi_boot_part= 0;
if(high_block * 4 < num[1] && num[2] > 0 && !gpts[idx].is_gap) { if(high_block * 4 < num[1] && num[2] > 0 && !gpts[idx].is_gap) {
for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) { for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) {
if(mbrpts[mbr_idx].start_block == num[1]) { if(mbrpts[mbr_idx].start_block == num[1]) {
@ -2360,6 +2362,21 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
} }
} else if(gpts[idx].ptype == 3 && gpts[idx].has_path == 0 &&
img_blocks >= num[1] + num[2] && !efi_boot_part) {
if(mkisofs)
sprintf(buf, "-efi-boot-part ");
else
sprintf(buf, "-boot_image any efi_boot_part=");
Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) num[1],
(uint64_t) (num[1] + num[2] - 1.0), "d",
imported_iso);
efi_boot_part= 2;
fresh_efi_boot_part= 1;
Xorriso_record_cmd_linE
}
if(!fresh_efi_boot_part) {
/* Check for isohybri-ish MBR and GPT mix */ /* Check for isohybri-ish MBR and GPT mix */
if((mbr_count == 1 || (mbr_count == 2 && have_mbr_force_bootable)) && if((mbr_count == 1 || (mbr_count == 2 && have_mbr_force_bootable)) &&
mbrpts[0].ptype == 0xee && have_protective_msdos) { mbrpts[0].ptype == 0xee && have_protective_msdos) {
@ -2386,19 +2403,11 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
Xorriso_register_eltorito_gpt(xorriso, et_imgs + et_idx, Xorriso_register_eltorito_gpt(xorriso, et_imgs + et_idx,
gpts[idx].ptype, &efi_boot_part, gpts[idx].ptype, &efi_boot_part,
&fe_dummy, 1); &fe_dummy, 1);
if(efi_boot_part == 1) {
/* -isohybrid-gpt- substitutes for -efi-boot-part --efi-boot-image */
efi_boot_part= 2;
}
} }
} else if(gpts[idx].ptype == 3 && gpts[idx].has_path == 0 &&
img_blocks >= num[1] + num[2] && !efi_boot_part) {
if(mkisofs)
sprintf(buf, "-efi-boot-part ");
else
sprintf(buf, "-boot_image any efi_boot_part=");
Xorriso_add_intvl_adr(xorriso, buf, (uint64_t) num[1],
(uint64_t) (num[1] + num[2] - 1.0), "d",
imported_iso);
efi_boot_part= 2;
Xorriso_record_cmd_linE
} }
if(gpts[idx].ptype == 2 && if(gpts[idx].ptype == 2 &&

View File

@ -1 +1 @@
#define Xorriso_timestamP "2021.11.24.115053" #define Xorriso_timestamP "2022.04.22.113132"