diff --git a/xorriso/iso_img.c b/xorriso/iso_img.c index 3955f180..271c666c 100644 --- a/xorriso/iso_img.c +++ b/xorriso/iso_img.c @@ -1698,6 +1698,10 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, int was_force_bootable= 0, have_mbr_force_bootable= 0; uint64_t gpt_bheader_block= 0, start_block, num_blocks; uint64_t img_blocks= 0, iso_part_blocks; + char *cpt; + unsigned char bin_data[8]; + uint64_t gpt_part_flags; + int was_gpt_iso_bootable= 0, was_gpt_iso_not_ro= 0, bin_count; struct mbr_par { uint8_t ptype; @@ -2261,7 +2265,43 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, } else if(strcmp(name, "GPT partition flags:") == 0) { - /* >>> check whether 0x1000000000000001 . Else: complain */; + /* >>> check whether 0x100000000000000[15] . Else: complain */; + + cpt= strstr(contentpt, "0x"); + if(cpt != NULL) { + ret= Hex_to_bin(cpt + 2, 8, &bin_count, bin_data, 0); + if(ret > 0) { + /* convert big-endian bin_data to local endianness */ + gpt_part_flags= 0; + for(gpt_idx= 0; gpt_idx < bin_count; gpt_idx++) + gpt_part_flags|= (((uint64_t) bin_data[gpt_idx]) << + (8 * (bin_count - 1 - gpt_idx))); + + if((gpt_part_flags & 4) && !was_gpt_iso_bootable) { + was_gpt_iso_bootable= 1; + if(buf[0]) { + Xorriso_record_cmd_linE + } + if(mkisofs) + sprintf(buf, "--gpt-iso-bootable"); + else + sprintf(buf, "-boot_image any gpt_iso_bootable=on"); + } + + if(num_count > 0 && num[0] == 1 && + (!(gpt_part_flags & (((uint64_t) 1) << 60))) && + !was_gpt_iso_not_ro) { + was_gpt_iso_not_ro= 1; + if(buf[0]) { + Xorriso_record_cmd_linE + } + if(mkisofs) + sprintf(buf, "--gpt-iso-not-ro"); + else + sprintf(buf, "-boot_image any gpt_iso_not_ro=on"); + } + } + } } else if(strcmp(name, "GPT partition path :") == 0) { idx= num[0] - 1; diff --git a/xorriso/opts_a_c.c b/xorriso/opts_a_c.c index 9ade80f6..56075387 100644 --- a/xorriso/opts_a_c.c +++ b/xorriso/opts_a_c.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2019 Thomas Schmitt, + Copyright 2007-2021 Thomas Schmitt, Provided under GPL version 2 or later. @@ -1357,8 +1357,35 @@ interval_text_long:; {ret= 0; goto ex;} } - } else + } else if(strncmp(treatpt, "gpt_iso_bootable=", 17) == 0) { + if(strcmp(treatpt + 17, "off") == 0) { + xorriso->system_area_options&= ~(1 << 16); + } else if(strcmp(treatpt + 17, "on") == 0) { + xorriso->system_area_options|= (1 << 16); + } else { + sprintf(xorriso->info_text, + "-boot_image %s gpt_iso_bootable=: unknown mode : %s", + formpt, treatpt + 17); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); + {ret= 0; goto ex;} + } + + } else if(strncmp(treatpt, "gpt_iso_not_ro=", 15) == 0) { + if(strcmp(treatpt + 15, "off") == 0) { + xorriso->system_area_options&= ~(1 << 17); + } else if(strcmp(treatpt + 15, "on") == 0) { + xorriso->system_area_options|= (1 << 17); + } else { + sprintf(xorriso->info_text, + "-boot_image %s gpt_iso_not_ro=: unknown mode : %s", + formpt, treatpt + 15); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); + {ret= 0; goto ex;} + } + + } else { was_ok= 0; + } if(!was_ok) { sprintf(xorriso->info_text, "Unrecognized options with -boot_image: %s %s", diff --git a/xorriso/opts_d_h.c b/xorriso/opts_d_h.c index 5937593d..322574de 100644 --- a/xorriso/opts_d_h.c +++ b/xorriso/opts_d_h.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2020 Thomas Schmitt, + Copyright 2007-2021 Thomas Schmitt, Provided under GPL version 2 or later. @@ -1928,7 +1928,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag) " |\"system_area=\"|\"partition_table=on|off\"", " |\"partition_entry=\"|\"appended_part_as=\"", " |\"part_like_isohybrid=\"|\"iso_mbr_part_type=\"", -" |\"gpt_disk_guid=\"", +" |\"gpt_disk_guid=\"|\"gpt_iso_bootable\"|\"gpt_iso_not_ro=\"", " |\"chrp_boot_part=on|off=\"|\"prep_boot_part=\"", " |\"efi_boot_part=\"|\"efi_boot_part=--efi-boot-image\"", " |\"mips_path=\"|\"mipsel_path=\"|\"mips_discard\"", diff --git a/xorriso/text_io.c b/xorriso/text_io.c index 8163b731..605e95b5 100644 --- a/xorriso/text_io.c +++ b/xorriso/text_io.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2020 Thomas Schmitt, + Copyright 2007-2021 Thomas Schmitt, Provided under GPL version 2 or later. @@ -3063,6 +3063,18 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); + is_default= ((xorriso->system_area_options & (1 << 16)) == 0); + sprintf(line, "-boot_image any gpt_iso_bootable=%s\n", + (xorriso->system_area_options & (1 << 16)) ? "on" : "off"); + if(!(is_default && no_defaults)) + Xorriso_status_result(xorriso,filter,fp,flag&2); + + is_default= ((xorriso->system_area_options & (1 << 17)) == 0); + sprintf(line, "-boot_image any gpt_iso_not_ro=%s\n", + (xorriso->system_area_options & (1 << 17)) ? "on" : "off"); + if(!(is_default && no_defaults)) + Xorriso_status_result(xorriso,filter,fp,flag&2); + is_default= (xorriso->appended_as_gpt == 0 && xorriso->appended_as_apm == 0); if(is_default) { sprintf(line, "-boot_image any appended_part_as=mbr\n"); diff --git a/xorriso/xorriso.1 b/xorriso/xorriso.1 index 6edcc862..95dfa1ef 100644 --- a/xorriso/xorriso.1 +++ b/xorriso/xorriso.1 @@ -9,7 +9,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH XORRISO 1 "Version 1.5.5, Jan 30, 2021" +.TH XORRISO 1 "Version 1.5.5, May 25, 2021" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -3802,6 +3802,18 @@ If no bootable MBR is indicated and a partition gets created by \-append_partition, then mbr_force_bootable="on" causes a bootflag like it would do with a bootable MBR. .br +\fBgpt_iso_bootable=\fRon causes bit 2 of the GPT partition flags to be +set for the ISO 9660 partition if such a GPT partition emerges. This bit is +specified as "Legacy BIOS bootable" but its true significance is unclear. +Some GPT\-aware BIOS might want to see it in some partition. Mode "off" +revokes this setting. +.br +\fBgpt_iso_not_ro=\fRon causes bit 60 of the GPT partition flags to be not +set for the ISO 9660 partition if such a GPT partition emerges. This bit is +specified as "Read\-only" and thus appropriate. But it is unusual in GPT disk +partitions. Mode "off" revokes this setting and causes the read\-only bit to be +set. +.br \fBmips_path=\fRiso_rr_path declares a data file in the image to be a MIPS Big Endian boot file and causes production of a MIPS Big Endian Volume Header. This is mutually exclusive with production of other boot blocks diff --git a/xorriso/xorriso.info b/xorriso/xorriso.info index d8e7df2f..5f93febb 100644 --- a/xorriso/xorriso.info +++ b/xorriso/xorriso.info @@ -3214,6 +3214,16 @@ Examples: If no bootable MBR is indicated and a partition gets created by -append_partition, then mbr_force_bootable="on" causes a bootflag like it would do with a bootable MBR. + *gpt_iso_bootable=*on causes bit 2 of the GPT partition flags to be + set for the ISO 9660 partition if such a GPT partition emerges. + This bit is specified as "Legacy BIOS bootable" but its true + significance is unclear. Some GPT-aware BIOS might want to see it + in some partition. Mode "off" revokes this setting. + *gpt_iso_not_ro=*on causes bit 60 of the GPT partition flags to be + not set for the ISO 9660 partition if such a GPT partition emerges. + This bit is specified as "Read-only" and thus appropriate. But it + is unusual in GPT disk partitions. Mode "off" revokes this setting + and causes the read-only bit to be set. *mips_path=*iso_rr_path declares a data file in the image to be a MIPS Big Endian boot file and causes production of a MIPS Big Endian Volume Header. This is mutually exclusive with production @@ -5536,7 +5546,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -alter_date sets timestamps in ISO image: Manip. (line 139) * -alter_date_r sets timestamps in ISO image: Manip. (line 174) * -append_partition adds arbitrary file after image end: Bootable. - (line 423) + (line 433) * -application_id sets application id: SetWrite. (line 197) * -application_use sets application use field: SetWrite. (line 272) * -as emulates mkisofs or cdrecord: Emulation. (line 13) @@ -5787,10 +5797,10 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * ACL, show in ISO image, -getfacl: Navigate. (line 60) * ACL, show in ISO image, -getfacl_r: Navigate. (line 66) * ACL, _definition: Extras. (line 50) -* APM block size: Bootable. (line 414) +* APM block size: Bootable. (line 424) * APM, _definition: Extras. (line 42) * Appendable media, _definition: Media. (line 38) -* Appended Filesystem Image, -append_partition: Bootable. (line 423) +* Appended Filesystem Image, -append_partition: Bootable. (line 433) * Appended partition, in APM: Bootable. (line 291) * Appended partition, in MBR or GPT: Bootable. (line 284) * Automatic execution order, of arguments, -x: ArgSort. (line 16) @@ -5818,7 +5828,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Cylinder alignment, _definition: Bootable. (line 340) * Cylinder size, _definition: Bootable. (line 325) * Damaged track and session, close, -close_damaged: Writing. (line 205) -* DEC Alpha SRM boot sector, production: Bootable. (line 400) +* DEC Alpha SRM boot sector, production: Bootable. (line 410) * Delete, from ISO image, -rm: Manip. (line 20) * Delete, from ISO image, -rm_r: Manip. (line 26) * Delete, ISO directory, -rmdir: Manip. (line 29) @@ -5874,6 +5884,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Filter, _definition: Filter. (line 6) * Frontend program, start at pipes, -launch_frontend: Frontend. (line 141) +* GPT Legacy BIOS bootable flag, set for ISO: Bootable. (line 362) +* GPT read-only flag, do not set for ISO: Bootable. (line 367) * GPT, control GUID, -boot_image gpt_disk_guid=: Bootable. (line 225) * GPT, _definition: Extras. (line 39) * Group, global in ISO image, -gid: SetWrite. (line 293) @@ -5881,10 +5893,10 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Group, in ISO image, -chgrp_r: Manip. (line 53) * Growing, _definition: Methods. (line 20) * Hard links, control handling, -hardlinks: Loading. (line 128) -* HFS+ allocation block size: Bootable. (line 411) -* HFS+ serial number: Bootable. (line 408) +* HFS+ allocation block size: Bootable. (line 421) +* HFS+ serial number: Bootable. (line 418) * hidden, set in ISO image, -hide: Manip. (line 177) -* HP-PA boot sector, production: Bootable. (line 383) +* HP-PA boot sector, production: Bootable. (line 393) * Image reading, cache size, -data_cache_size: Loading. (line 362) * Image, demand volume ID, -assert_volid: Loading. (line 105) * Image, discard pending changes, -rollback: Writing. (line 9) @@ -5949,7 +5961,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Media, format, -format: Writing. (line 87) * Media, list formats, -list_formats: Writing. (line 128) * Media, list write speeds, -list_speeds: Writing. (line 139) -* MIPS boot file, activation: Bootable. (line 362) +* MIPS boot file, activation: Bootable. (line 372) * mkisofs, Emulation: Emulation. (line 17) * Modifying, _definition: Methods. (line 28) * Multi-session media, _definition: Media. (line 7) @@ -6047,8 +6059,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Session, select as input, -load: Loading. (line 54) * Session, _definition: Model. (line 6) * Sorting order, for -x, -list_arg_sorting: ArgSort. (line 26) -* SUN Disk Label, production: Bootable. (line 373) -* SUN SPARC boot images, activation: Bootable. (line 454) +* SUN Disk Label, production: Bootable. (line 383) +* SUN SPARC boot images, activation: Bootable. (line 464) * Symbolic link, create, -lns: Insert. (line 181) * System area, _definition: Bootable. (line 200) * Table-of-content, search sessions, -rom_toc_scan: Loading. (line 308) @@ -6117,40 +6129,40 @@ Node: Filter107719 Node: Writing112341 Node: SetWrite124596 Node: Bootable153596 -Node: Jigdo180804 -Node: Charset185807 -Node: Exception189136 -Node: DialogCtl195265 -Node: Inquiry197867 -Node: Navigate206749 -Node: Verify215456 -Node: Restore226605 -Node: Emulation238304 -Node: Scripting248760 -Node: Frontend256543 -Node: Examples266169 -Node: ExDevices267347 -Node: ExCreate268008 -Node: ExDialog269308 -Node: ExGrowing270579 -Node: ExModifying271388 -Node: ExBootable271898 -Node: ExCharset272453 -Node: ExPseudo273349 -Node: ExCdrecord274276 -Node: ExMkisofs274596 -Node: ExGrowisofs276493 -Node: ExException277646 -Node: ExTime278104 -Node: ExIncBackup278562 -Node: ExRestore282588 -Node: ExRecovery283534 -Node: Files284106 -Node: Environ285440 -Node: Seealso286188 -Node: Bugreport286905 -Node: Legal287496 -Node: CommandIdx288508 -Node: ConceptIdx306333 +Node: Jigdo181477 +Node: Charset186480 +Node: Exception189809 +Node: DialogCtl195938 +Node: Inquiry198540 +Node: Navigate207422 +Node: Verify216129 +Node: Restore227278 +Node: Emulation238977 +Node: Scripting249433 +Node: Frontend257216 +Node: Examples266842 +Node: ExDevices268020 +Node: ExCreate268681 +Node: ExDialog269981 +Node: ExGrowing271252 +Node: ExModifying272061 +Node: ExBootable272571 +Node: ExCharset273126 +Node: ExPseudo274022 +Node: ExCdrecord274949 +Node: ExMkisofs275269 +Node: ExGrowisofs277166 +Node: ExException278319 +Node: ExTime278777 +Node: ExIncBackup279235 +Node: ExRestore283261 +Node: ExRecovery284207 +Node: Files284779 +Node: Environ286113 +Node: Seealso286861 +Node: Bugreport287578 +Node: Legal288169 +Node: CommandIdx289181 +Node: ConceptIdx307006  End Tag Table diff --git a/xorriso/xorriso.texi b/xorriso/xorriso.texi index b2d9e80f..ad378c7c 100644 --- a/xorriso/xorriso.texi +++ b/xorriso/xorriso.texi @@ -50,7 +50,7 @@ @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) -@c man .TH XORRISO 1 "Version 1.5.5, Jan 30, 2021" +@c man .TH XORRISO 1 "Version 1.5.5, May 25, 2021" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @@ -4368,6 +4368,20 @@ If no bootable MBR is indicated and a partition gets created by -append_partition, then mbr_force_bootable="on" causes a bootflag like it would do with a bootable MBR. @* +@cindex GPT Legacy BIOS bootable flag, set for ISO +@strong{gpt_iso_bootable=}on causes bit 2 of the GPT partition flags to be +set for the ISO 9660 partition if such a GPT partition emerges. This bit is +specified as "Legacy BIOS bootable" but its true significance is unclear. +Some GPT-aware BIOS might want to see it in some partition. Mode "off" +revokes this setting. +@* +@cindex GPT read-only flag, do not set for ISO +@strong{gpt_iso_not_ro=}on causes bit 60 of the GPT partition flags to be not +set for the ISO 9660 partition if such a GPT partition emerges. This bit is +specified as "Read-only" and thus appropriate. But it is unusual in GPT disk +partitions. Mode "off" revokes this setting and causes the read-only bit to be +set. +@* @cindex MIPS boot file, activation @strong{mips_path=}iso_rr_path declares a data file in the image to be a MIPS Big Endian boot file and causes production of a MIPS Big Endian Volume diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 0df206ae..33343f87 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2021.05.25.191333" +#define Xorriso_timestamP "2021.05.25.191826"