diff --git a/xorriso/iso_img.c b/xorriso/iso_img.c index 9687e6e2..8ba192b6 100644 --- a/xorriso/iso_img.c +++ b/xorriso/iso_img.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2020 Thomas Schmitt, + Copyright 2007-2022 Thomas Schmitt, 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; return(1); } else if(*first_efi && et_img->platform_id == 0xef) { - *efi_boot_part= 1; + if(*efi_boot_part <= 0) + *efi_boot_part= 1; return(1); } 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 cared_for_sparc= 0, have_hfsplus= 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 int appended_partition= 0; @@ -2327,6 +2328,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, else part_type= 0xcd; + fresh_efi_boot_part= 0; if(high_block * 4 < num[1] && num[2] > 0 && !gpts[idx].is_gap) { for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) { 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 */ if((mbr_count == 1 || (mbr_count == 2 && have_mbr_force_bootable)) && 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, gpts[idx].ptype, &efi_boot_part, &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 && diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 86dd3f60..f0b2df76 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2021.11.24.115053" +#define Xorriso_timestamP "2022.04.22.113132"