Browse Source

New -boot_image action "replay"

master
Thomas Schmitt 7 years ago
parent
commit
c5275761f4
  1. 29
      xorriso/iso_img.c
  2. 5
      xorriso/opts_a_c.c
  3. 16
      xorriso/opts_d_h.c
  4. 18
      xorriso/xorriso.1
  5. 122
      xorriso/xorriso.info
  6. 22
      xorriso/xorriso.texi
  7. 2
      xorriso/xorriso_timestamp.h

29
xorriso/iso_img.c

@ -2420,7 +2420,7 @@ ex:
/* @param flag bit0= currently not significant:
report is about El Torito rather than System Area
bit1= report -as mkisofsoptions
bit1= report -as mkisofs options
bit15= dispose cmds
*/
static int Xorriso_report_to_cmd(struct XorrisO *xorriso,
@ -2484,12 +2484,12 @@ static void Xorriso_report_lines(struct XorrisO *xorriso,
/* @param flag bit0= report El Torito rather than System Area
>>> bit1= with form "cmd" do not report but rather execute
bit1= with form "cmd" do not report but rather execute
*/
int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag)
{
int ret, line_count, cmd_count= 0, et_line_count= 0, sa_line_count= 0;
int do_cmd= 0, as_mkisofs= 0;
int do_cmd= 0, as_mkisofs= 0, i;
char **lines = NULL, **et_lines= NULL, **sa_lines= NULL, **cmds= NULL;
IsoImage *image;
@ -2578,9 +2578,26 @@ int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag)
}
}
if(flag & 2) {
/* >>> execute commands */;
if(cmd_count > 0) {
ret= Xorriso_execute_option(xorriso,
"-boot_image any discard -boot_image any system_area=/dev/zero",
1 | 16);
if(ret <= 0)
goto ex;
for(i= 0; i < cmd_count; i++) {
ret= Xorriso_execute_option(xorriso, cmds[i], 1 | 16);
if(ret <= 0)
goto ex;
}
sprintf(xorriso->info_text,
"Replayed %d boot related commands", cmd_count);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
} else {
Xorriso_msgs_submit(xorriso, 0,
"No proposals available for boot related commands",
0, "NOTE", 0);
ret= 2; goto ex;
}
} else if(do_cmd) {
Xorriso_report_lines(xorriso, cmds, cmd_count);
} else {

5
xorriso/opts_a_c.c

@ -714,6 +714,11 @@ treatment_patch:;
else
xorriso->patch_system_area= 0;
} else if(strcmp(treatpt, "replay")==0) {
ret= Xorriso_report_system_area(xorriso, "cmd", 2);
if(ret <= 0)
goto ex;
} else if(strcmp(treatpt, "discard")==0) {
xorriso->keep_boot_image= 0;
xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~0x3ff) | 0;

16
xorriso/opts_d_h.c

@ -1756,7 +1756,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" to which deep subtrees will get relocated if -compliance",
" is set to \"deep_paths_off\".",
" -boot_image \"any\"|\"isolinux\"|\"grub\"",
" |\"discard\"|\"keep\"|\"patch\"|\"dir=\"|\"bin_path=\"",
" |\"discard\"|\"keep\"|\"patch\"|\"replay\"",
" |\"dir=\"|\"bin_path=\"",
" |\"cat_path=\"|\"cat_hidden=on|iso_rr|joliet|off\"",
" |\"load_size=\"|\"boot_info_table=\"",
" |\"grub2_boot_info=\"|\"grub2_mbr=\"|\"partition_offset=\"",
@ -1773,7 +1774,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" |\"hppa_discard\"|\"alpha_boot=\"|\"alpha_discard\"",
" |\"hfsplus_serial=\"|\"hfsplus_block_size=\"",
" |\"apm_block_size=\"|\"show_status\"",
" Whether to discard or keep an exiting El Torito boot image.",
" Whether to discard or keep an exiting El Torito boot image,",
" or to freshly set up boot equipment. \"replay\" performs",
" the commands proposed by -report_system_area \"cmd\".",
" ISOLINUX can be made bootable by dir=/ or dir=/isolinux",
" or dir=/boot/isolinux. Others, like GRUB, by bin_path=...",
" and cat_path=...",
@ -1824,15 +1827,20 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Print foreseeable available space on output medium",
" -pvd_info Print various id strings of the loaded ISO image.",
"",
" -report_el_torito \"plain\"|\"help\"",
" -report_el_torito \"plain\"|\"help\"|\"cmd\"|\"as_mkisofs\"",
" \"plain\" prints information about the El Torito boot catalog",
" and boot images of the loaded ISO image.",
" \"help\" prints an explanation of the output format.",
" \"cmd\" and \"as_mkisofs\" propose commands to reproduce",
" the boot equipment reported by -report_el_torito \"plain\"",
" and -report_system_area \"plain\"",
" -report_system_area \"plain\"|\"help\"|\"gpt_crc_of:\"disk_path",
" |\"cmd\"|\"as_mkisofs\"",
" \"plain\" prints information about recognized data",
" in the System Area of the loaded ISO image: MBR, GPT, ...",
" \"help\" prints an explanation of the output format.",
" in the System Area of the loaded ISO image: MBR, GPT, ...",
" \"gpt_crc_of:\" prints GPT CRC of file disk_path.",
" For \"cmd\" and \"as_mkisofs\" see -report_el_torito.",
"",
"Commands with variable length path list [...] need the list delimiter text",
"as end mark if they are followed by another command. By default this",

18
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.4.1, Aug 29, 2015"
.TH XORRISO 1 "Version 1.4.1, Sep 05, 2015"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -3043,7 +3043,8 @@ Examples:
.TP
\fB\-boot_image\fR "any"|"isolinux"|"grub"
.br
"discard"|"keep"|"patch"|"show_status"|bootspec|"next"
"discard"|"keep"|"patch"|"replay"|"show_status"|
bootspec|"next"
.br
Define the equipment of the emerging filesystem with boot entry points.
.br
@ -3090,11 +3091,18 @@ then they stay unpatched. This check is not infallible. So if
you do know that the images need no patching, use "any" "keep".
"grub" "patch" will not patch EFI images (platform_id=0xef).
.br
Most safe is the default: \-boot_image "any" "discard".
\fBreplay\fR is a more modern version of "patch", which not only cares
for existing El Torito boot equipment but also for the recognizable
boot provisions in the System Area. It discards any existing \-boot_image
setting and executes the commands proposed by command \-report_el_torito "cmd".
.br
Advised for GRUB : \-boot_image "grub" "patch"
Drop unknown El Torito: \-boot_image "any" "discard"
.br
For ISOLINUX : \-boot_image "isolinux" "patch"
Maintain recognizable stuff: \-boot_image "any" "replay"
.br
El Torito only for GRUB: \-boot_image "grub" "patch"
.br
El Torito only for ISOLINUX: \-boot_image "isolinux" "patch"
.br
\fBshow_status\fR will print what is known about the loaded boot images
and their designated fate.

122
xorriso/xorriso.info

@ -2571,7 +2571,7 @@ Examples:
-boot_image "any"|"isolinux"|"grub"
"discard"|"keep"|"patch"|"show_status"|bootspec|"next"
"discard"|"keep"|"patch"|"replay"|"show_status"| bootspec|"next"
Define the equipment of the emerging filesystem with boot entry
points.
@ -2609,9 +2609,15 @@ Examples:
not, then they stay unpatched. This check is not infallible. So
if you do know that the images need no patching, use "any" "keep".
"grub" "patch" will not patch EFI images (platform_id=0xef).
Most safe is the default: -boot_image "any" "discard".
Advised for GRUB : -boot_image "grub" "patch"
For ISOLINUX : -boot_image "isolinux" "patch"
*replay* is a more modern version of "patch", which not only cares
for existing El Torito boot equipment but also for the recognizable
boot provisions in the System Area. It discards any existing
-boot_image setting and executes the commands proposed by command
-report_el_torito "cmd".
Drop unknown El Torito: -boot_image "any" "discard"
Maintain recognizable stuff: -boot_image "any" "replay"
El Torito only for GRUB: -boot_image "grub" "patch"
El Torito only for ISOLINUX: -boot_image "isolinux" "patch"
*show_status* will print what is known about the loaded boot images
and their designated fate.
@ -4976,7 +4982,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -alter_date sets timestamps in ISO image: Manip. (line 136)
* -alter_date_r sets timestamps in ISO image: Manip. (line 168)
* -append_partition adds arbitrary file after image end: Bootable.
(line 345)
(line 351)
* -application_id sets application id: SetWrite. (line 191)
* -application_use sets application use field: SetWrite. (line 250)
* -as emulates mkisofs or cdrecord: Emulation. (line 13)
@ -5214,11 +5220,11 @@ 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 336)
* APM block size: Bootable. (line 342)
* APM, _definition: Extras. (line 42)
* Appendable media, _definition: Media. (line 38)
* Appended Filesystem Image, -append_partition: Bootable. (line 345)
* Appended partition, in MBR or GPT: Bootable. (line 224)
* Appended Filesystem Image, -append_partition: Bootable. (line 351)
* Appended partition, in MBR or GPT: Bootable. (line 230)
* Automatic execution order, of arguments, -x: ArgSort. (line 16)
* Backslash Interpretation, _definition: Processing. (line 53)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 217)
@ -5235,15 +5241,15 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Character set, learn from image, -auto_charset: Loading. (line 114)
* Character Set, of terminal, -local_charset: Charset. (line 57)
* Character Set, _definition: Charset. (line 6)
* CHRP partition, _definition: Bootable. (line 229)
* CHRP partition, _definition: Bootable. (line 235)
* Closed media, _definition: Media. (line 44)
* Comment, #: Scripting. (line 156)
* Control, signal handling, -signal_handling: Exception. (line 66)
* Create, new ISO image, _definition: Methods. (line 7)
* Cylinder alignment, _definition: Bootable. (line 273)
* Cylinder size, _definition: Bootable. (line 258)
* Cylinder alignment, _definition: Bootable. (line 279)
* Cylinder size, _definition: Bootable. (line 264)
* Damaged track and session, close, -close_damaged: Writing. (line 164)
* DEC Alpha SRM boot sector, production: Bootable. (line 322)
* DEC Alpha SRM boot sector, production: Bootable. (line 328)
* Delete, from ISO image, -rm: Manip. (line 20)
* Delete, from ISO image, -rm_r: Manip. (line 26)
* Delete, ISO directory, -rmdir: Manip. (line 29)
@ -5274,7 +5280,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Drive, _definition: Drives. (line 6)
* EA, _definition: Extras. (line 66)
* ECMA-119, _definition: Model. (line 6)
* EFI system partition, _definition: Bootable. (line 238)
* EFI system partition, _definition: Bootable. (line 244)
* El Torito, _definition: Extras. (line 19)
* Emulation, -as: Emulation. (line 13)
* Emulation, .mkisofsrc, -read_mkisofsrc: Emulation. (line 155)
@ -5302,10 +5308,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 125)
* HFS+ allocation block size: Bootable. (line 333)
* HFS+ serial number: Bootable. (line 330)
* HFS+ allocation block size: Bootable. (line 339)
* HFS+ serial number: Bootable. (line 336)
* hidden, set in ISO image, -hide: Manip. (line 171)
* HP-PA boot sector, production: Bootable. (line 305)
* HP-PA boot sector, production: Bootable. (line 311)
* Image reading, cache size, -data_cache_size: Loading. (line 291)
* Image, demand volume ID, -assert_volid: Loading. (line 102)
* Image, discard pending changes, -rollback: Writing. (line 9)
@ -5357,14 +5363,14 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* LBA, _definition: Drives. (line 17)
* List delimiter, _definition: Processing. (line 9)
* Local Character Set, _definition: Charset. (line 11)
* MBR, set, -boot_image system_area=: Bootable. (line 175)
* MBR, set, -boot_image system_area=: Bootable. (line 181)
* MBR, _definition: Extras. (line 27)
* MD5, control handling, -md5: Loading. (line 173)
* Media, erase, -blank: Writing. (line 57)
* Media, format, -format: Writing. (line 87)
* Media, list formats, -list_formats: Writing. (line 129)
* Media, list write speeds, -list_speeds: Writing. (line 140)
* MIPS boot file, activation: Bootable. (line 284)
* MIPS boot file, activation: Bootable. (line 290)
* mkisofs, Emulation: Emulation. (line 17)
* Modifying, _definition: Methods. (line 28)
* Multi-session media, _definition: Media. (line 7)
@ -5391,15 +5397,15 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Ownership, global in ISO image, -uid: SetWrite. (line 268)
* Ownership, in ISO image, -chown: Manip. (line 43)
* Ownership, in ISO image, -chown_r: Manip. (line 47)
* Partition offset, _definition: Bootable. (line 248)
* Partition table, _definition: Bootable. (line 205)
* Partition offset, _definition: Bootable. (line 254)
* Partition table, _definition: Bootable. (line 211)
* Pathspec, _definition: SetInsert. (line 117)
* Pattern expansion, for disk paths, -disk_pattern: Insert. (line 34)
* Pattern expansion, for ISO paths, -iso_rr_pattern: Manip. (line 10)
* Pattern expansion, _definition: Processing. (line 25)
* Permissions, in ISO image, -chmod: Manip. (line 55)
* Permissions, in ISO image, -chmod_r: Manip. (line 66)
* PReP partition, _definition: Bootable. (line 233)
* PReP partition, _definition: Bootable. (line 239)
* Problems, reporting: Bugreport. (line 6)
* Process, consolidate text output, -pkt_output: Frontend. (line 7)
* Process, control abort on error, -abort_on: Exception. (line 27)
@ -5459,10 +5465,10 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Session, select as input, -load: Loading. (line 33)
* Session, _definition: Model. (line 6)
* Sorting order, for -x, -list_arg_sorting: ArgSort. (line 26)
* SUN Disk Label, production: Bootable. (line 295)
* SUN SPARC boot images, activation: Bootable. (line 368)
* SUN Disk Label, production: Bootable. (line 301)
* SUN SPARC boot images, activation: Bootable. (line 374)
* Symbolic link, create, -lns: Insert. (line 160)
* System area, _definition: Bootable. (line 175)
* System area, _definition: Bootable. (line 181)
* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 237)
* Table-of-content, show, -toc: Inquiry. (line 27)
* Timestamps, set in ISO image, -alter_date: Manip. (line 136)
@ -5529,39 +5535,39 @@ Node: Filter95461
Node: Writing100084
Node: SetWrite110239
Node: Bootable133184
Node: Jigdo155118
Node: Charset159377
Node: Exception162704
Node: DialogCtl168833
Node: Inquiry171435
Node: Navigate179880
Node: Verify188175
Node: Restore198037
Node: Emulation206658
Node: Scripting217068
Node: Frontend224849
Node: Examples234484
Node: ExDevices235662
Node: ExCreate236323
Node: ExDialog237623
Node: ExGrowing238894
Node: ExModifying239703
Node: ExBootable240213
Node: ExCharset240768
Node: ExPseudo241664
Node: ExCdrecord242587
Node: ExMkisofs242907
Node: ExGrowisofs244264
Node: ExException245418
Node: ExTime245876
Node: ExIncBackup246334
Node: ExRestore250360
Node: ExRecovery251306
Node: Files251878
Node: Seealso253195
Node: Bugreport253910
Node: Legal254501
Node: CommandIdx255513
Node: ConceptIdx272409
Node: Jigdo155519
Node: Charset159778
Node: Exception163105
Node: DialogCtl169234
Node: Inquiry171836
Node: Navigate180281
Node: Verify188576
Node: Restore198438
Node: Emulation207059
Node: Scripting217469
Node: Frontend225250
Node: Examples234885
Node: ExDevices236063
Node: ExCreate236724
Node: ExDialog238024
Node: ExGrowing239295
Node: ExModifying240104
Node: ExBootable240614
Node: ExCharset241169
Node: ExPseudo242065
Node: ExCdrecord242988
Node: ExMkisofs243308
Node: ExGrowisofs244665
Node: ExException245819
Node: ExTime246277
Node: ExIncBackup246735
Node: ExRestore250761
Node: ExRecovery251707
Node: Files252279
Node: Seealso253596
Node: Bugreport254311
Node: Legal254902
Node: CommandIdx255914
Node: ConceptIdx272810

End Tag Table

22
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.4.1, Aug 29, 2015"
@c man .TH XORRISO 1 "Version 1.4.1, Sep 05, 2015"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -3568,7 +3568,8 @@ Examples:
@cindex Write, bootability, -boot_image
@cindex Bootability, control, -boot_image
@*
"discard"|"keep"|"patch"|"show_status"|bootspec|"next"
"discard"|"keep"|"patch"|"replay"|"show_status"|
bootspec|"next"
@*
@sp 1
Define the equipment of the emerging filesystem with boot entry points.
@ -3618,11 +3619,22 @@ then they stay unpatched. This check is not infallible. So if
you do know that the images need no patching, use "any" "keep".
"grub" "patch" will not patch EFI images (platform_id=0xef).
@*
Most safe is the default: -boot_image "any" "discard".
@strong{replay} is a more modern version of "patch", which not only cares
for existing El Torito boot equipment but also for the recognizable
boot provisions in the System Area. It discards any existing -boot_image
setting and executes the commands proposed by command -report_el_torito "cmd".
@*
Advised for GRUB : -boot_image "grub" "patch"
This action will only succeed if the file objects mentioned in the
output of command -report_el_torito "cmd" are still available. Do not
remove boot image files after -indev.
@*
For ISOLINUX : -boot_image "isolinux" "patch"
Drop unknown El Torito: -boot_image "any" "discard"
@*
Maintain recognizable stuff: -boot_image "any" "replay"
@*
El Torito only for GRUB: -boot_image "grub" "patch"
@*
El Torito only for ISOLINUX: -boot_image "isolinux" "patch"
@*
@strong{show_status} will print what is known about the loaded boot images
and their designated fate.

2
xorriso/xorriso_timestamp.h

@ -1 +1 @@
#define Xorriso_timestamP "2015.08.30.184740"
#define Xorriso_timestamP "2015.09.06.194259"

Loading…
Cancel
Save