Bug fix: -boot_image grub grub2_mbr= did not work (but -as mkisofs --grub2-mbr did work)

This commit is contained in:
Thomas Schmitt 2014-04-04 14:21:19 +00:00
parent 1a9c7ed015
commit 8ff3ed7b6b
6 changed files with 76 additions and 73 deletions

View File

@ -968,6 +968,7 @@ treatment_patch:;
ret= Xorriso_set_system_area_path(xorriso, treatpt + 12, 0); ret= Xorriso_set_system_area_path(xorriso, treatpt + 12, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
xorriso->system_area_options&= ~0x4000;
} else if(strncmp(treatpt, "partition_table=", 16)==0) { } else if(strncmp(treatpt, "partition_table=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0) { if(strcmp(treatpt + 16, "off") == 0) {
@ -1175,24 +1176,15 @@ treatment_patch:;
#endif /* ! Xorriso_with_isohybriD */ #endif /* ! Xorriso_with_isohybriD */
} else if(strncmp(treatpt, "grub2_mbr=", 9) == 0 && } else if(strncmp(treatpt, "grub2_mbr=", 10) == 0) {
strcmp(formpt, "grub")==0) { ret= Xorriso_set_system_area_path(xorriso, treatpt + 10, 0);
if(ret <= 0)
if(strcmp(treatpt + 9, "off") == 0) goto ex;
if(treatpt [10] == 0)
xorriso->system_area_options&= ~0x4000; xorriso->system_area_options&= ~0x4000;
else if(strcmp(treatpt + 9, "on") == 0) else
xorriso->system_area_options= xorriso->system_area_options=
(xorriso->system_area_options & ~2) | 0x4000; (xorriso->system_area_options & ~2) | 0x4000;
else {
sprintf(xorriso->info_text,
"Unrecognized keyword with -boot_image %s %s",
form, treatment);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
sprintf(xorriso->info_text,
"Allowed with grub2_mbr= are: off , on");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
{ret= 0; goto ex;}
}
} else } else
was_ok= 0; was_ok= 0;

View File

@ -2434,6 +2434,9 @@ int Xorriso_boot_status_sysarea(struct XorrisO *xorriso, char *filter,
spec= "grub2_mbr="; spec= "grub2_mbr=";
} else if(xorriso->system_area_options & 2) { } else if(xorriso->system_area_options & 2) {
form= "isolinux"; form= "isolinux";
} if(xorriso->system_area_options & (1 << 14)) {
form= "grub";
spec= "grub2_mbr=";
} }
sprintf(line, "-boot_image %s %s", form, spec); sprintf(line, "-boot_image %s %s", form, spec);
Text_shellsafe(xorriso->system_area_disk_path, line, 1); Text_shellsafe(xorriso->system_area_disk_path, line, 1);

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.3.7, Mar 04, 2014" .TH XORRISO 1 "Version 1.3.7, Apr 04, 2014"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -3042,6 +3042,9 @@ patching for modern GRUB MBRs. The content start address of the first boot
image is converted to a count of 512 byte blocks, and an offset of 4 is added. image is converted to a count of 512 byte blocks, and an offset of 4 is added.
The result is written as 64 bit little\-endian number to byte address 0x1b0. The result is written as 64 bit little\-endian number to byte address 0x1b0.
.br .br
This feature can be revoked either by grub2_mbr= with empty disk path,
or by submitting a disk_path via system_area=.
.br
\fBpartition_table=on\fR causes a simple partition table to be written \fBpartition_table=on\fR causes a simple partition table to be written
into bytes 446 to 511 of the System Area. into bytes 446 to 511 of the System Area.
.br .br
@ -3068,11 +3071,11 @@ Special "system_area=/dev/zero" causes 32k of NUL\-bytes.
Use this to discard an MBR which was loaded with the ISO image. Use this to discard an MBR which was loaded with the ISO image.
.br .br
\fBchrp_boot_part=on\fR causes a single partition in MBR which covers \fBchrp_boot_part=on\fR causes a single partition in MBR which covers
the whole ISO image and has type 0x41. This is not compatible with any the whole ISO image and has type 0x96. This is not compatible with any
other feature that produces MBR partition entries. It makes GPT unrecognizable. other feature that produces MBR partition entries. It makes GPT unrecognizable.
.br .br
\fBprep_boot_part=\fR inserts the content of a data file into the image and \fBprep_boot_part=\fR inserts the content of a data file into the image and
marks it by an MBR partition of type 0x96. The parts of the ISO image before marks it by an MBR partition of type 0x41. The parts of the ISO image before
and after this partition will be covered by further MBR partitions. and after this partition will be covered by further MBR partitions.
The data file is supposed to contain ELF executable code. The data file is supposed to contain ELF executable code.
.br .br

View File

@ -2670,6 +2670,8 @@ filesystem and announced by an MBR partition table entry.
first boot image is converted to a count of 512 byte blocks, and first boot image is converted to a count of 512 byte blocks, and
an offset of 4 is added. The result is written as 64 bit an offset of 4 is added. The result is written as 64 bit
little-endian number to byte address 0x1b0. little-endian number to byte address 0x1b0.
This feature can be revoked either by grub2_mbr= with empty disk
path, or by submitting a disk_path via system_area=.
*partition_table=on* causes a simple partition table to be written *partition_table=on* causes a simple partition table to be written
into bytes 446 to 511 of the System Area. into bytes 446 to 511 of the System Area.
With type "isolinux" it shows a partition that begins at byte 0 With type "isolinux" it shows a partition that begins at byte 0
@ -2691,11 +2693,11 @@ filesystem and announced by an MBR partition table entry.
Special "system_area=/dev/zero" causes 32k of NUL-bytes. Use this Special "system_area=/dev/zero" causes 32k of NUL-bytes. Use this
to discard an MBR which was loaded with the ISO image. to discard an MBR which was loaded with the ISO image.
*chrp_boot_part=on* causes a single partition in MBR which covers *chrp_boot_part=on* causes a single partition in MBR which covers
the whole ISO image and has type 0x41. This is not compatible with the whole ISO image and has type 0x96. This is not compatible with
any other feature that produces MBR partition entries. It makes any other feature that produces MBR partition entries. It makes
GPT unrecognizable. GPT unrecognizable.
*prep_boot_part=* inserts the content of a data file into the *prep_boot_part=* inserts the content of a data file into the
image and marks it by an MBR partition of type 0x96. The parts of image and marks it by an MBR partition of type 0x41. The parts of
the ISO image before and after this partition will be covered by the ISO image before and after this partition will be covered by
further MBR partitions. The data file is supposed to contain ELF further MBR partitions. The data file is supposed to contain ELF
executable code. executable code.
@ -4903,7 +4905,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -alter_date sets timestamps in ISO image: Manip. (line 154) * -alter_date sets timestamps in ISO image: Manip. (line 154)
* -alter_date_r sets timestamps in ISO image: Manip. (line 187) * -alter_date_r sets timestamps in ISO image: Manip. (line 187)
* -append_partition adds arbitrary file after image end: Bootable. * -append_partition adds arbitrary file after image end: Bootable.
(line 248) (line 250)
* -application_id sets application id: SetWrite. (line 196) * -application_id sets application id: SetWrite. (line 196)
* -application_use sets application use field: SetWrite. (line 262) * -application_use sets application use field: SetWrite. (line 262)
* -as emulates mkisofs or cdrecord: Emulation. (line 13) * -as emulates mkisofs or cdrecord: Emulation. (line 13)
@ -5138,10 +5140,10 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* ACL, set in ISO image, -setfacl_r: Manip. (line 105) * ACL, set in ISO image, -setfacl_r: Manip. (line 105)
* ACL, show in ISO image, -getfacl: Navigate. (line 70) * ACL, show in ISO image, -getfacl: Navigate. (line 70)
* ACL, show in ISO image, -getfacl_r: Navigate. (line 77) * ACL, show in ISO image, -getfacl_r: Navigate. (line 77)
* APM block size: Bootable. (line 239) * APM block size: Bootable. (line 241)
* APM, _definition: Extras. (line 41) * APM, _definition: Extras. (line 41)
* Appendable media, _definition: Media. (line 38) * Appendable media, _definition: Media. (line 38)
* Appended Filesystem Image, -append_partition: Bootable. (line 248) * Appended Filesystem Image, -append_partition: Bootable. (line 250)
* Automatic execution order, of arguments, -x: ArgSort. (line 16) * Automatic execution order, of arguments, -x: ArgSort. (line 16)
* Backslash Interpretation, _definition: Processing. (line 52) * Backslash Interpretation, _definition: Processing. (line 52)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 217) * Backup, enable fast incremental, -disk_dev_ino: Loading. (line 217)
@ -5158,13 +5160,13 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Character Set, for output, -out_charset: SetWrite. (line 276) * Character Set, for output, -out_charset: SetWrite. (line 276)
* Character set, learn from image, -auto_charset: Loading. (line 122) * Character set, learn from image, -auto_charset: Loading. (line 122)
* Character Set, of terminal, -local_charset: Charset. (line 58) * Character Set, of terminal, -local_charset: Charset. (line 58)
* CHRP partition, _definition: Bootable. (line 158) * CHRP partition, _definition: Bootable. (line 160)
* Closed media, _definition: Media. (line 43) * Closed media, _definition: Media. (line 43)
* Comment, #: Scripting. (line 173) * Comment, #: Scripting. (line 173)
* Control, signal handling, -signal_handling: Exception. (line 69) * Control, signal handling, -signal_handling: Exception. (line 69)
* Create, new ISO image, _definition: Methods. (line 6) * Create, new ISO image, _definition: Methods. (line 6)
* Cylinder alignment, _definition: Bootable. (line 198) * Cylinder alignment, _definition: Bootable. (line 200)
* Cylinder size, _definition: Bootable. (line 187) * Cylinder size, _definition: Bootable. (line 189)
* Damaged track and session, close, -close_damaged: Writing. (line 170) * Damaged track and session, close, -close_damaged: Writing. (line 170)
* Delete, from ISO image, -rm: Manip. (line 21) * Delete, from ISO image, -rm: Manip. (line 21)
* Delete, from ISO image, -rm_r: Manip. (line 28) * Delete, from ISO image, -rm_r: Manip. (line 28)
@ -5196,7 +5198,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Drive, write and eject, -commit_eject: Writing. (line 56) * Drive, write and eject, -commit_eject: Writing. (line 56)
* EA, _definition: Extras. (line 65) * EA, _definition: Extras. (line 65)
* ECMA-119, _definition: Model. (line 6) * ECMA-119, _definition: Model. (line 6)
* EFI system partition, _definition: Bootable. (line 167) * EFI system partition, _definition: Bootable. (line 169)
* El Torito, _definition: Extras. (line 19) * El Torito, _definition: Extras. (line 19)
* Emulation, -as: Emulation. (line 13) * Emulation, -as: Emulation. (line 13)
* Emulation, .mkisofsrc, -read_mkisofsrc: Emulation. (line 151) * Emulation, .mkisofsrc, -read_mkisofsrc: Emulation. (line 151)
@ -5222,8 +5224,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Group, in ISO image, -chgrp_r: Manip. (line 62) * Group, in ISO image, -chgrp_r: Manip. (line 62)
* Growing, _definition: Methods. (line 19) * Growing, _definition: Methods. (line 19)
* Hard links, control handling, -hardlinks: Loading. (line 134) * Hard links, control handling, -hardlinks: Loading. (line 134)
* HFS+ allocation block size: Bootable. (line 236) * HFS+ allocation block size: Bootable. (line 238)
* HFS+ serial number: Bootable. (line 233) * HFS+ serial number: Bootable. (line 235)
* hidden, set in ISO image, -hide: Manip. (line 191) * hidden, set in ISO image, -hide: Manip. (line 191)
* Image reading, cache size, -data_cache_size: Loading. (line 296) * Image reading, cache size, -data_cache_size: Loading. (line 296)
* Image, _definition: Model. (line 9) * Image, _definition: Model. (line 9)
@ -5280,7 +5282,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Media, format, -format: Writing. (line 91) * Media, format, -format: Writing. (line 91)
* Media, list formats, -list_formats: Writing. (line 134) * Media, list formats, -list_formats: Writing. (line 134)
* Media, list write speeds, -list_speeds: Writing. (line 146) * Media, list write speeds, -list_speeds: Writing. (line 146)
* MIPS boot file, activation: Bootable. (line 209) * MIPS boot file, activation: Bootable. (line 211)
* mkisofs, Emulation: Emulation. (line 16) * mkisofs, Emulation: Emulation. (line 16)
* Modifying, _definition: Methods. (line 27) * Modifying, _definition: Methods. (line 27)
* Multi-session media, _definition: Media. (line 7) * Multi-session media, _definition: Media. (line 7)
@ -5307,15 +5309,15 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Ownership, global in ISO image, -uid: SetWrite. (line 282) * Ownership, global in ISO image, -uid: SetWrite. (line 282)
* Ownership, in ISO image, -chown: Manip. (line 49) * Ownership, in ISO image, -chown: Manip. (line 49)
* Ownership, in ISO image, -chown_r: Manip. (line 54) * Ownership, in ISO image, -chown_r: Manip. (line 54)
* Partition offset, _definition: Bootable. (line 177) * Partition offset, _definition: Bootable. (line 179)
* Partition table, _definition: Bootable. (line 138) * Partition table, _definition: Bootable. (line 140)
* Pathspec, _definition: SetInsert. (line 120) * Pathspec, _definition: SetInsert. (line 120)
* Pattern expansion, _definition: Processing. (line 24) * Pattern expansion, _definition: Processing. (line 24)
* Pattern expansion, for disk paths, -disk_pattern: Insert. (line 36) * Pattern expansion, for disk paths, -disk_pattern: Insert. (line 36)
* Pattern expansion, for ISO paths, -iso_rr_pattern: Manip. (line 10) * Pattern expansion, for ISO paths, -iso_rr_pattern: Manip. (line 10)
* Permissions, in ISO image, -chmod: Manip. (line 65) * Permissions, in ISO image, -chmod: Manip. (line 65)
* Permissions, in ISO image, -chmod_r: Manip. (line 77) * Permissions, in ISO image, -chmod_r: Manip. (line 77)
* PReP partition, _definition: Bootable. (line 162) * PReP partition, _definition: Bootable. (line 164)
* Problems, reporting: Bugreport. (line 6) * Problems, reporting: Bugreport. (line 6)
* Process, consolidate text output, -pkt_output: Frontend. (line 7) * Process, consolidate text output, -pkt_output: Frontend. (line 7)
* Process, control abort on error, -abort_on: Exception. (line 27) * Process, control abort on error, -abort_on: Exception. (line 27)
@ -5374,8 +5376,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Session, mount parameters, -mount_opts: Inquiry. (line 68) * Session, mount parameters, -mount_opts: Inquiry. (line 68)
* Session, select as input, -load: Loading. (line 35) * Session, select as input, -load: Loading. (line 35)
* Sorting order, for -x, -list_arg_sorting: ArgSort. (line 27) * Sorting order, for -x, -list_arg_sorting: ArgSort. (line 27)
* SUN Disk Label, production: Bootable. (line 220) * SUN Disk Label, production: Bootable. (line 222)
* SUN SPARC boot images, activation: Bootable. (line 269) * SUN SPARC boot images, activation: Bootable. (line 271)
* Symbolic link, create, -lns: Insert. (line 176) * Symbolic link, create, -lns: Insert. (line 176)
* System area, _definition: Bootable. (line 126) * System area, _definition: Bootable. (line 126)
* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 238) * Table-of-content, search sessions, -rom_toc_scan: Loading. (line 238)
@ -5443,39 +5445,39 @@ Node: Filter93164
Node: Writing97720 Node: Writing97720
Node: SetWrite107851 Node: SetWrite107851
Node: Bootable128436 Node: Bootable128436
Node: Jigdo144774 Node: Jigdo144902
Node: Charset149021 Node: Charset149149
Node: Exception152336 Node: Exception152464
Node: DialogCtl158456 Node: DialogCtl158584
Node: Inquiry161054 Node: Inquiry161182
Node: Navigate167371 Node: Navigate167499
Node: Verify175669 Node: Verify175797
Node: Restore184933 Node: Restore185061
Node: Emulation192020 Node: Emulation192148
Node: Scripting202322 Node: Scripting202450
Node: Frontend210093 Node: Frontend210221
Node: Examples219700 Node: Examples219828
Node: ExDevices220878 Node: ExDevices221006
Node: ExCreate221544 Node: ExCreate221672
Node: ExDialog222829 Node: ExDialog222957
Node: ExGrowing224094 Node: ExGrowing224222
Node: ExModifying224899 Node: ExModifying225027
Node: ExBootable225403 Node: ExBootable225531
Node: ExCharset225955 Node: ExCharset226083
Node: ExPseudo226847 Node: ExPseudo226975
Node: ExCdrecord227745 Node: ExCdrecord227873
Node: ExMkisofs228062 Node: ExMkisofs228190
Node: ExGrowisofs229402 Node: ExGrowisofs229530
Node: ExException230537 Node: ExException230665
Node: ExTime230991 Node: ExTime231119
Node: ExIncBackup231450 Node: ExIncBackup231578
Node: ExRestore235430 Node: ExRestore235558
Node: ExRecovery236363 Node: ExRecovery236491
Node: Files236933 Node: Files237061
Node: Seealso238232 Node: Seealso238360
Node: Bugreport238955 Node: Bugreport239083
Node: Legal239536 Node: Legal239664
Node: CommandIdx240547 Node: CommandIdx240675
Node: ConceptIdx257209 Node: ConceptIdx257337
 
End Tag Table End Tag Table

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps @c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @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 .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Version 1.3.7, Mar 04, 2014" @c man .TH XORRISO 1 "Version 1.3.7, Apr 04, 2014"
@c man .\" Please adjust this date whenever revising the manpage. @c man .\" Please adjust this date whenever revising the manpage.
@c man .\" @c man .\"
@c man .\" Some roff macros, for reference: @c man .\" Some roff macros, for reference:
@ -3565,6 +3565,9 @@ patching for modern GRUB MBRs. The content start address of the first boot
image is converted to a count of 512 byte blocks, and an offset of 4 is added. image is converted to a count of 512 byte blocks, and an offset of 4 is added.
The result is written as 64 bit little-endian number to byte address 0x1b0. The result is written as 64 bit little-endian number to byte address 0x1b0.
@* @*
This feature can be revoked either by grub2_mbr= with empty disk path,
or by submitting a disk_path via system_area=.
@*
@cindex Partition table, _definition @cindex Partition table, _definition
@strong{partition_table=on} causes a simple partition table to be written @strong{partition_table=on} causes a simple partition table to be written
into bytes 446 to 511 of the System Area. into bytes 446 to 511 of the System Area.
@ -3593,12 +3596,12 @@ Use this to discard an MBR which was loaded with the ISO image.
@* @*
@cindex CHRP partition, _definition @cindex CHRP partition, _definition
@strong{chrp_boot_part=on} causes a single partition in MBR which covers @strong{chrp_boot_part=on} causes a single partition in MBR which covers
the whole ISO image and has type 0x41. This is not compatible with any the whole ISO image and has type 0x96. This is not compatible with any
other feature that produces MBR partition entries. It makes GPT unrecognizable. other feature that produces MBR partition entries. It makes GPT unrecognizable.
@* @*
@cindex PReP partition, _definition @cindex PReP partition, _definition
@strong{prep_boot_part=} inserts the content of a data file into the image and @strong{prep_boot_part=} inserts the content of a data file into the image and
marks it by an MBR partition of type 0x96. The parts of the ISO image before marks it by an MBR partition of type 0x41. The parts of the ISO image before
and after this partition will be covered by further MBR partitions. and after this partition will be covered by further MBR partitions.
The data file is supposed to contain ELF executable code. The data file is supposed to contain ELF executable code.
@* @*

View File

@ -1 +1 @@
#define Xorriso_timestamP "2014.04.03.194751" #define Xorriso_timestamP "2014.04.04.142016"