Reporting some relaxation commands with -report_el_torito modes "cmd" and "mkisofs" if CHRP is detected. Performing them with -boot_image any "replay".

This commit is contained in:
Thomas Schmitt 2022-10-07 11:55:10 +02:00
parent e594ba293a
commit 82dc9b6b42
6 changed files with 136 additions and 39 deletions

View File

@ -240,6 +240,8 @@ ex:;
}
/* @param flag bit0= no info message "Loading ISO image tree"
*/
int Xorriso_make_read_options(struct XorrisO *xorriso,
struct burn_drive *drive,
struct isoburn_read_opts **ropts,
@ -311,7 +313,7 @@ int Xorriso_make_read_options(struct XorrisO *xorriso,
state= isoburn_disc_get_status(drive);
if(state != BURN_DISC_BLANK) {
ret= isoburn_disc_get_msc1(drive, &load_lba);
if(ret > 0) {
if(ret > 0 && !(flag & 1)) {
sprintf(xorriso->info_text,
"Loading ISO image tree from LBA %d", load_lba);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
@ -3865,6 +3867,8 @@ int Xorriso_feature_to_cmd(struct XorrisO *xorriso, char *name, char *value,
}
/* @param flag bit0= do not print xorriso->result_line, but accumulate it
*/
int Xorriso_assess_written_features(struct XorrisO *xorriso, char *mode,
int flag)
{
@ -3876,11 +3880,16 @@ int Xorriso_assess_written_features(struct XorrisO *xorriso, char *mode,
IsoReadImageFeatures *features= NULL;
struct isoburn_imgen_opts *imgen_opts= NULL;
char *ftext= NULL, *cpt, *npt, *ept, *prev_line= NULL, *cmd_line= NULL;
char *result_acc= NULL;
static char *tree_loaded_names[3]= {"ISO9660", "Joliet", "ISO9660:1999"};
int tree_loaded_names_max= 2;
Xorriso_alloc_meM(prev_line, char, max_line_size);
Xorriso_alloc_meM(cmd_line, char, max_line_size);
if(flag & 1) {
Xorriso_alloc_meM(result_acc, char, 10 * SfileadrL);
result_acc[0]= 0;
}
prev_line[0]= 0;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"when assessing written features", 0);
@ -3892,7 +3901,7 @@ int Xorriso_assess_written_features(struct XorrisO *xorriso, char *mode,
"The disc in the input drive offers no readable content", 0, "NOTE", 0);
ret= 2; goto ex;
}
ret= Xorriso_make_read_options(xorriso, drive, &ropts, 0);
ret= Xorriso_make_read_options(xorriso, drive, &ropts, 1);
if(ret <= 0)
goto ex;
ret = isoburn_assess_written_features(drive, ropts, &features, &imgen_opts,
@ -3962,7 +3971,12 @@ int Xorriso_assess_written_features(struct XorrisO *xorriso, char *mode,
replay_count++;
} else {
strcat(xorriso->result_line, "\n");
Xorriso_result(xorriso, 0);
if(flag & 1) {
if(strlen(result_acc) + strlen(xorriso->result_line) < 10 * SfileadrL)
strcat(result_acc, xorriso->result_line);
} else {
Xorriso_result(xorriso, 0);
}
}
}
@ -3972,6 +3986,8 @@ int Xorriso_assess_written_features(struct XorrisO *xorriso, char *mode,
replay_count);
Xorriso_info(xorriso, 0);
}
if(flag & 1)
strcpy(xorriso->result_line, result_acc);
ret= 1;
ex:;
Xorriso_process_msg_queues(xorriso,0);
@ -3982,6 +3998,7 @@ ex:;
if(imgen_opts != NULL)
isoburn_igopt_destroy(&imgen_opts, 0);
Xorriso_free_meM(ftext);
Xorriso_free_meM(result_acc);
Xorriso_free_meM(cmd_line);
Xorriso_free_meM(prev_line);
return(ret);

View File

@ -1703,7 +1703,8 @@ 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;
char *cpt, *npt, *ftext;
int ftext_l, l;
unsigned char bin_data[8];
uint64_t gpt_part_flags;
int was_gpt_iso_bootable= 0, was_gpt_iso_not_ro= 0, bin_count;
@ -2086,6 +2087,61 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
sprintf(buf, "-chrp-boot-part ");
else
sprintf(buf, "-boot_image any chrp_boot_part=on ");
Xorriso_record_cmd_linE
buf[0]= 0;
ret= Xorriso_assess_written_features(xorriso,
mkisofs ? "as_mkisofs" : "cmd", 1);
if(ret > 0) {
ftext= xorriso->result_line;
ftext_l= strlen(ftext);
for(cpt= ftext ; cpt - ftext < ftext_l ; cpt+= l + 1) {
npt= strchr(cpt, '\n');
if(npt == NULL)
l= strlen(cpt);
else
l= npt - cpt;
cpt[l]= 0;
/* Only forward relaxations of ISO 9660 defaults, plus no RR */
if(mkisofs) {
if(strcmp(cpt, "-iso-level 2") != 0 &&
strcmp(cpt, "-iso-level 3") != 0 &&
strcmp(cpt, "--norock") != 0 &&
strncmp(cpt, "-untranslated_name_len", 22) != 0 &&
strcmp(cpt, "-N") != 0 &&
strcmp(cpt, "-D") != 0 &&
strcmp(cpt, "-U") != 0 &&
strcmp(cpt, "-max-iso9660-filenames") != 0 &&
strcmp(cpt, "-d") != 0 &&
strcmp(cpt, "-allow-lowercase") != 0)
continue;
} else {
/* (Do not forward iso_9660_level because 3 is default and the
user possibly had reasons to lower it) */
if(strcmp(cpt, "-rockridge off") != 0 &&
strncmp(cpt, "-compliance untranslated_name_len=", 34) != 0 &&
strcmp(cpt, "-compliance omit_version_off:only_iso_version")
!= 0 &&
strcmp(cpt, "-compliance omit_version:only_iso_version_off")
!= 0 &&
strcmp(cpt, "-compliance deep_paths") != 0 &&
strcmp(cpt, "-compliance long_paths") != 0 &&
strcmp(cpt, "-compliance full_ascii") != 0 &&
strcmp(cpt, "-compliance long_names") != 0 &&
strncmp(cpt, "-compliance no_force_dots:", 26) != 0 &&
strcmp(cpt, "-compliance lowercase") != 0)
continue;
if(strcmp(cpt, "-compliance untranslated_name_len=0") == 0)
continue;
}
if(strncmp(cpt, "-compliance untranslated_name_len=", 34) == 0) {
/* Better allow the maximum if it is reported as non-0 */
strcpy(buf, "-compliance untranslated_name_len=96");
} else {
strcpy(buf, cpt);
}
Xorriso_record_cmd_linE
}
}
}
} else if(strcmp(name, "System area summary:") == 0) {

View File

@ -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, Sep 18, 2022"
.TH XORRISO 1 "Version 1.5.5, Oct 06, 2022"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -4586,6 +4586,14 @@ Mode \fBas_mkisofs\fR tries to print the \fBxorriso \-as mkisofs\fR
options, which are necessary to produce the found equipment.
The intended use case is to use the mounted filesystem as input tree
together with the printed options.
.br
If CHRP equipment is detected, then modes \fBcmd\fR and \fBas_mkisofs\fR
issue some of the relaxation commands or options which get detected by
command \fB\-assess_indev_features\fR. This happens because CHRP firmware
reads file paths from file /ppc/bootinfo.txt and tries to find them
case\-insensitively in the ECMA\-119 tree without using Rock Ridge. If such a
path has actually forbidden properties, like the name "powerpc\-ieee1275", then
the relaxations are needed to bring it unmangled into the ECMA\-119 tree.
.TP
\fB\-report_system_area\fR mode
With mode \fBplain\fR print a report about the information found in

View File

@ -3857,6 +3857,14 @@ File: xorriso.info, Node: Inquiry, Next: Navigate, Prev: DialogCtl, Up: Comm
which are necessary to produce the found equipment. The intended
use case is to use the mounted filesystem as input tree together
with the printed options.
If CHRP equipment is detected, then modes *cmd* and *as_mkisofs*
issue some of the relaxation commands or options which get detected
by command *-assess_indev_features*. This happens because CHRP
firmware reads file paths from file /ppc/bootinfo.txt and tries to
find them case-insensitively in the ECMA-119 tree without using
Rock Ridge. If such a path has actually forbidden properties, like
the name "powerpc-ieee1275", then the relaxations are needed to
bring it unmangled into the ECMA-119 tree.
-report_system_area mode
With mode *plain* print a report about the information found in the
System Area of the loaded ISO image. The report consists of zero
@ -5808,7 +5816,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -reassure enables confirmation question: DialogCtl. (line 29)
* -report_about controls verbosity: Exception. (line 53)
* -report_el_torito shows Boot Catalog: Inquiry. (line 150)
* -report_system_area shows MBR, GPT, and alike: Inquiry. (line 172)
* -report_system_area shows MBR, GPT, and alike: Inquiry. (line 180)
* -return_with controls exit value: Exception. (line 38)
* -rm deletes files from ISO image: Manip. (line 20)
* -rmdir deletes ISO directory: Manip. (line 29)
@ -6004,7 +6012,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Image, set volume timestamp, -volume_date: SetWrite. (line 211)
* Image, show Boot Catalog: Inquiry. (line 150)
* Image, show id strings, -pvd_info: Inquiry. (line 142)
* Image, show MBR, GPT, and alike, -pvd_info: Inquiry. (line 172)
* Image, show MBR, GPT, and alike, -pvd_info: Inquiry. (line 180)
* Image, _definition: Model. (line 9)
* Input Character Set, _definition: Charset. (line 25)
* Insert, enable overwriting, -overwrite: SetInsert. (line 139)
@ -6223,35 +6231,35 @@ Node: Charset189084
Node: Exception192413
Node: DialogCtl198542
Node: Inquiry201144
Node: Navigate211859
Node: Verify220566
Node: Restore231715
Node: Emulation243923
Node: Scripting254379
Node: Frontend262162
Node: Examples271788
Node: ExDevices272966
Node: ExCreate273627
Node: ExDialog274927
Node: ExGrowing276198
Node: ExModifying277007
Node: ExBootable277517
Node: ExCharset278072
Node: ExPseudo278968
Node: ExCdrecord279895
Node: ExMkisofs280215
Node: ExGrowisofs282112
Node: ExException283265
Node: ExTime283723
Node: ExIncBackup284181
Node: ExRestore288207
Node: ExRecovery289153
Node: Files289725
Node: Environ291059
Node: Seealso291807
Node: Bugreport292524
Node: Legal293115
Node: CommandIdx294127
Node: ConceptIdx312025
Node: Navigate212402
Node: Verify221109
Node: Restore232258
Node: Emulation244466
Node: Scripting254922
Node: Frontend262705
Node: Examples272331
Node: ExDevices273509
Node: ExCreate274170
Node: ExDialog275470
Node: ExGrowing276741
Node: ExModifying277550
Node: ExBootable278060
Node: ExCharset278615
Node: ExPseudo279511
Node: ExCdrecord280438
Node: ExMkisofs280758
Node: ExGrowisofs282655
Node: ExException283808
Node: ExTime284266
Node: ExIncBackup284724
Node: ExRestore288750
Node: ExRecovery289696
Node: Files290268
Node: Environ291602
Node: Seealso292350
Node: Bugreport293067
Node: Legal293658
Node: CommandIdx294670
Node: ConceptIdx312568

End Tag Table

View File

@ -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, Sep 18, 2022"
@c man .TH XORRISO 1 "Version 1.5.5, Oct 06, 2022"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -5244,6 +5244,14 @@ Mode @strong{as_mkisofs} tries to print the @strong{xorriso -as mkisofs}
options, which are necessary to produce the found equipment.
The intended use case is to use the mounted filesystem as input tree
together with the printed options.
@*
If CHRP equipment is detected, then modes @strong{cmd} and @strong{as_mkisofs}
issue some of the relaxation commands or options which get detected by
command @strong{-assess_indev_features}. This happens because CHRP firmware
reads file paths from file /ppc/bootinfo.txt and tries to find them
case-insensitively in the ECMA-119 tree without using Rock Ridge. If such a
path has actually forbidden properties, like the name "powerpc-ieee1275", then
the relaxations are needed to bring it unmangled into the ECMA-119 tree.
@c man .TP
@item -report_system_area mode
@kindex -report_system_area shows MBR, GPT, and alike

View File

@ -1 +1 @@
#define Xorriso_timestamP "2022.09.20.082738"
#define Xorriso_timestamP "2022.10.07.095444"