Polished and documented MIPS booting option

This commit is contained in:
Thomas Schmitt 2010-10-13 17:07:05 +00:00
parent 2b7130ecdd
commit c1381c7baf
8 changed files with 176 additions and 104 deletions

View File

@ -1455,9 +1455,6 @@ problem_handler_2:;
xorriso->patch_isolinux_image= 1;
} else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 ||
#ifndef Xorriso_mips_boot_file_pathS
strcmp(argv[i], "-mips-boot") == 0 ||
#endif
strcmp(argv[i], "--efi-boot") == 0 ||
strcmp(argv[i], "-e") == 0) {
i++;
@ -1472,17 +1469,6 @@ problem_handler_2:;
xorriso->boot_efi_default= 1;
emul_boot= xorriso->boot_image_emul= 0;
#ifndef Xorriso_mips_boot_file_pathS
} else if(strcmp(argv[i - 1], "-mips-boot") == 0) {
boot_path= xorriso->boot_image_bin_path;
option_b= 0;
/* >>> Preliminary : this should be adjustable per boot image */
xorriso->system_area_options= 1 << 2; /* system area type 1 */
#endif /* ! Xorriso_mips_boot_file_pathS */
} else {
boot_path= xorriso->boot_image_bin_path;
if(strcmp(argv[i - 1], "-e") == 0)
@ -1566,8 +1552,6 @@ problem_handler_2:;
if(ret <= 0)
goto problem_handler_boot;
#ifdef Xorriso_mips_boot_file_pathS
} else if(strcmp(argv[i], "-mips-boot")==0) {
if(i+1>=argc)
goto not_enough_args;
@ -1581,8 +1565,6 @@ problem_handler_2:;
if(ret <= 0)
goto problem_handler_boot;
#endif /* Xorriso_mips_boot_file_pathS */
}
continue; /* regular bottom of loop */
problem_handler_boot:;

View File

@ -455,6 +455,28 @@ int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path,
}
int Xorriso_boot_status_mips(struct XorrisO *xorriso, IsoImage *image,
char *filter, FILE *fp, int flag)
{
int i, num_boots;
char *paths[15], *line;
line= xorriso->result_line;
num_boots= iso_image_get_mips_boot_files(image, paths, 0);
Xorriso_process_msg_queues(xorriso, 0);
if(num_boots <= 0)
return(num_boots);
for(i= 0; i < num_boots; i++) {
strcpy(line,"-boot_image any mips_path=");
Text_shellsafe(paths[i], line, 1);
strcat(line, "\n");
Xorriso_status_result(xorriso, filter, fp, flag & 2);
}
return(num_boots);
}
/*
bit0= do only report non-default settings
bit1= do only report to fp
@ -477,7 +499,21 @@ int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp,
line= xorriso->result_line;
no_defaults= flag & 1;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print boot info", 2 | 16);
if(ret<=0)
goto no_image;
image= isoburn_get_attached_image(drive);
Xorriso_process_msg_queues(xorriso,0);
if(image == NULL)
goto no_image;
ret= Xorriso_boot_status_mips(xorriso, image, filter, fp, 0);
if(ret < 0) /* == 0 is normal */
{ret= 0; goto ex;}
if(xorriso->boot_count == 0 && xorriso->boot_image_bin_path[0] == 0) {
no_image:;
if(xorriso->patch_isolinux_image & 1) {
sprintf(line, "-boot_image %s patch\n",
xorriso->patch_isolinux_image & 2 ? "grub" : form);
@ -494,14 +530,6 @@ int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp,
ret= 1; goto ex;
}
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print boot info", 16);
if(ret<=0)
{ret= 0; goto ex;}
image= isoburn_get_attached_image(drive);
Xorriso_process_msg_queues(xorriso,0);
if(image == NULL)
{ret= 0; goto ex;}
if(xorriso->boot_image_bin_path[0] || xorriso->boot_count > 0)
bin_path_in_use= 1;
@ -972,6 +1000,8 @@ ex:;
}
/* @param flag bit0= give up all boot file paths
*/
int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag)
{
int ret;
@ -980,6 +1010,10 @@ int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag)
ret= Xorriso_get_volume(xorriso, &image, 0);
if(ret <= 0)
return ret;
if(flag & 1) {
iso_image_give_up_mips_boot(image, 0);
return(1);
}
ret = iso_image_add_mips_boot_file(image, path, 0);
Xorriso_process_msg_queues(xorriso,0);
if (ret < 0) {
@ -992,3 +1026,37 @@ int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag)
}
int Xorriso_coordinate_system_area(struct XorrisO *xorriso, int sa_type,
int options, char *cmd, int flag)
{
int old_type, old_options;
static char *type_names[2] = {"MBR", "MIPS Big Endian Volume Header"};
old_type= (xorriso->system_area_options & 0xfc) >> 2;
old_options= xorriso->system_area_options & ~0xfc;
if((old_type != 0 || old_options != 0) &&
(old_type != sa_type || (old_options != 0 && old_options != options))) {
sprintf(xorriso->info_text, "%s : First sector already occupied by %s",
cmd, old_type < 2 ? type_names[old_type] : "other boot facility");
if(old_type == 0 && old_options == 2)
strcat(xorriso->info_text, " for ISOLINUX isohybrid");
if(old_type == 0 && old_options == 1)
strcat(xorriso->info_text, " for partition table");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
goto hint_revoke;
}
xorriso->system_area_options= ((sa_type << 2) & 0xfc) | (options & ~0xfc);
if(sa_type == 0)
xorriso->patch_system_area= xorriso->system_area_options;
return(1);
hint_revoke:;
if(old_type == 0)
sprintf(xorriso->info_text, "Revokable by -boot_image any discard");
else if(old_type == 1)
sprintf(xorriso->info_text, "Revokable by -boot_image any mips_discard");
if(old_type < 2)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
return(0);
}

View File

@ -614,7 +614,8 @@ treatment_patch:;
xorriso->patch_isolinux_image= 0;
xorriso->boot_image_bin_path[0]= 0;
xorriso->patch_system_area= 0;
xorriso->system_area_options&= ~0xfc; /* system area type 0 */
if((xorriso->system_area_options & 0xfc ) == 0)
xorriso->system_area_options= 0; /* Reset eventual type 0 flags */
if(xorriso->boot_count > 0) {
ret= Xorriso_attach_boot_image(xorriso, 2); /* dispose boot images */
if(ret <= 0)
@ -731,19 +732,11 @@ treatment_patch:;
xorriso->keep_boot_image= 0;
xorriso->boot_efi_default= 1;
} else if(strcmp(treatpt, "mips_path=") == 0) {
xorriso->boot_image_bin_path[0] = 0;
xorriso->boot_efi_default= 0;
/* >>> Preliminary : this should be adjustable per boot image */
xorriso->system_area_options&= ~0xfc; /* system area type 0 */
} else if(strncmp(treatpt, "mips_path=", 10) == 0) {
#ifdef Xorriso_mips_boot_file_pathS
/* >>> Check for contradicting xorriso->system_area_options */;
sprintf(eff_path, "-boot_image %s mips_path=", formpt);
ret= Xorriso_coordinate_system_area(xorriso, 1, 0, eff_path, 0);
if(ret <= 0)
return(ret);
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 10,
eff_path, 2);
if(ret <= 0)
@ -751,21 +744,10 @@ treatment_patch:;
ret= Xorriso_add_mips_boot_file(xorriso, eff_path, 0);
if(ret <= 0)
return(ret);
xorriso->system_area_options= 1 << 2; /* system area type 1 */
#else /* Xorriso_mips_boot_file_pathS */
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 10,
xorriso->boot_image_bin_path, 2);
if(ret <= 0)
return(ret);
xorriso->keep_boot_image= 0;
xorriso->boot_efi_default= 0;
/* >>> Preliminary : this should be adjustable per boot image */
xorriso->system_area_options&= 1 << 2; /* system area type 1 */
#endif /* ! Xorriso_mips_boot_file_pathS */
} else if(strcmp(treatpt, "mips_discard") == 0) {
xorriso->system_area_options&= ~0xfc; /* system area type 0 */
Xorriso_add_mips_boot_file(xorriso, "", 1); /* give up MIPS boot files */
} else if(strncmp(treatpt, "boot_info_table=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0)
@ -808,23 +790,27 @@ treatment_patch:;
}
} else if(strncmp(treatpt, "system_area=", 12) == 0) {
if(strcmp(formpt, "isolinux")==0) {
ret= Xorriso_coordinate_system_area(xorriso, 0, 2,
"-boot_image isolinux system_area=", 0);
if(ret <= 0)
return(ret);
}
ret= Xorriso_set_system_area_path(xorriso, treatpt + 12, 0);
if(ret <= 0)
return(ret);
if(strcmp(formpt, "isolinux")==0)
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 2;
} else if(strncmp(treatpt, "partition_table=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0) {
xorriso->system_area_options&= ~3;
xorriso->patch_system_area= xorriso->system_area_options;
} else if(strcmp(treatpt + 16, "on") == 0) {
xorriso->system_area_options&= ~3;
sprintf(eff_path, "-boot_image %s partition_table=", formpt);
if(strcmp(formpt, "isolinux")==0)
xorriso->system_area_options|= 2;
ret= Xorriso_coordinate_system_area(xorriso, 0, 2, eff_path, 0);
else
xorriso->system_area_options|= 1;
xorriso->patch_system_area= xorriso->system_area_options;
ret= Xorriso_coordinate_system_area(xorriso, 0, 1, eff_path, 0);
if(ret <= 0)
return(ret);
} else
was_ok= 0;

View File

@ -1390,6 +1390,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" |\"discard\"|\"keep\"|\"patch\"|\"dir=\"|\"bin_path=\"",
" |\"cat_path=\"|\"cat_hidden=on|iso_rr|joliet|off\"",
" |\"load_size=\"|\"system_area=\"|\"partition_table=on|off\"",
" |\"mips_path=\"|\"mips_discard\"|\"show_status\"",
" Whether to discard or keep an exiting El Torito boot image.",
" ISOLINUX can be made bootable by dir=/ or dir=/isolinux",
" or dir=/boot/isolinux. Others, like GRUB, by bin_path=...",
@ -1398,6 +1399,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" ISO image by the usual commands like -map or -add.",
" system_area= and partition_table= are for MBR based booting",
" from USB stick. The system_area= file needs not to be added.",
" mips_path= adds Big Endian MIPS boot files. Combinable with",
" El Torito but not with MBR production.",
"",
" -uid uid User id to be used for the whole multi-session ISO image.",
" -gid gid Group id for the same purpose.",

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 "Oct 07, 2010"
.TH XORRISO 1 "Oct 13, 2010"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -2409,6 +2409,15 @@ partition offset. 0 chooses a default value.
\fBpartition_hd_cyl=\fRnumber gives the number of heads per cylinder for
partition offset. 0 chooses a default value.
.br
\fBmips_path=\fRiso_rr_path declares a data file in the image to be a
MIPS Big Endian boot file. Enable production of a MIPS Big Endian Volume
Header. This is mutually exclusive with any MBR production. It will overwrite
the first 512 bytes of any data eventually provided by system_area=.
Up to 15 boot files can be declared by mips_path=.
.br
\fBmips_discard\fR revokes any boot file declarations made by mips_path=.
This removes the ban on MBR production.
.br
.TP
.B Jigdo Template Extraction:
.PP
@ -3403,6 +3412,8 @@ instead of -G to apply the effect of -boot_image isolinux partition_table=on.
.br
--boot-catalog-hide is -boot_image any cat_hidden=on.
.br
-mips-boot is the same as -boot_image any mips_path= .
.br
-partition_offset number is
-boot_image any partition_offset=number.
.br

View File

@ -2144,6 +2144,14 @@ of the existing sessions, unless one can assume overwriteable media.
partition offset. 0 chooses a default value.
*partition_hd_cyl=*number gives the number of heads per cylinder
for partition offset. 0 chooses a default value.
*mips_path=*iso_rr_path declares a data file in the image to be a
MIPS Big Endian boot file. Enable production of a MIPS Big Endian
Volume Header. This is mutually exclusive with any MBR production.
It will overwrite the first 512 bytes of any data eventually
provided by system_area=. Up to 15 boot files can be declared by
mips_path=.
*mips_discard* revokes any boot file declarations made by
mips_path=. This removes the ban on MBR production.

File: xorriso.info, Node: Jigdo, Next: Charset, Prev: Bootable, Up: Options
@ -3032,6 +3040,7 @@ programs trigger comparable actions.
this instead of -G to apply the effect of -boot_image isolinux
partition_table=on.
--boot-catalog-hide is -boot_image any cat_hidden=on.
-mips-boot is the same as -boot_image any mips_path= .
-partition_offset number is -boot_image any
partition_offset=number.
The options of genisoimage Jigdo Template Extraction are
@ -3958,7 +3967,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -out_charset sets output character set: SetWrite. (line 156)
* -outdev aquires a drive for output: AqDrive. (line 29)
* -overwrite enables overwriting in ISO: SetInsert. (line 127)
* -pacifier controls pacifier text form: Emulation. (line 126)
* -pacifier controls pacifier text form: Emulation. (line 127)
* -padding sets amount of image padding: SetWrite. (line 239)
* -page set terminal geometry: DialogCtl. (line 15)
* -paste_in copies file into disk file: Restore. (line 117)
@ -3978,7 +3987,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -quoted_not_list sets exclusions: SetInsert. (line 72)
* -quoted_path_list inserts paths from disk file: Insert. (line 80)
* -read_mkisofsrc searches and reads .mkisofsrc file: Emulation.
(line 114)
(line 115)
* -reassure enables confirmation question: DialogCtl. (line 28)
* -report_about controls verbosity: Exception. (line 55)
* -return_with controls exit value: Exception. (line 39)
@ -3988,7 +3997,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -rollback discards pending changes: Writing. (line 9)
* -rollback_end ends program without writing: Scripting. (line 125)
* -rom_toc_scan searches for sessions: Loading. (line 184)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 136)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 137)
* -scsi_log reports SCSI commands: Scripting. (line 113)
* -session_log logs written sessions: Scripting. (line 104)
* -session_string composes session info line: Inquiry. (line 56)
@ -4044,11 +4053,11 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Backslash Interpretation, _definition: Processing. (line 49)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 163)
* Backup, enable features, -for_backup: Loading. (line 158)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 136)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 137)
* Blank media, _definition: Media. (line 29)
* Blind growing, _definition: Methods. (line 40)
* Bootability, control, -boot_image: Bootable. (line 20)
* cdrecord, Emulation: Emulation. (line 81)
* cdrecord, Emulation: Emulation. (line 82)
* Character Set, _definition: Charset. (line 6)
* Character Set, for input, -in_charset: Loading. (line 73)
* Character Set, for input/output, -charset: Charset. (line 43)
@ -4083,10 +4092,10 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Drive, write and eject, -commit_eject: Writing. (line 40)
* El Torito, _definiton: Extras. (line 19)
* Emulation, -as: Emulation. (line 13)
* Emulation, .mkisofsrc, -read_mkisofsrc: Emulation. (line 114)
* Emulation, cdrecord, -as: Emulation. (line 81)
* Emulation, .mkisofsrc, -read_mkisofsrc: Emulation. (line 115)
* Emulation, cdrecord, -as: Emulation. (line 82)
* Emulation, mkisofs, -as: Emulation. (line 16)
* Emulation, pacifier form, -pacifier: Emulation. (line 126)
* Emulation, pacifier form, -pacifier: Emulation. (line 127)
* Examples: Examples. (line 6)
* Filter, _definition: Filter. (line 6)
* Filter, apply to file tree, -set_filter_r: Filter. (line 84)
@ -4149,6 +4158,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Media, erase, -blank: Writing. (line 45)
* Media, format, -format: Writing. (line 69)
* Media, list formats, -list_formats: Writing. (line 107)
* MIPS boot file, activation: Bootable. (line 156)
* mkisofs, Emulation: Emulation. (line 16)
* Modifying, _definition: Methods. (line 27)
* Multi-session media, _definition: Media. (line 7)
@ -4287,38 +4297,38 @@ Node: Filter75440
Node: Writing79789
Node: SetWrite86078
Node: Bootable98029
Node: Jigdo107119
Node: Charset111377
Node: Exception114128
Node: DialogCtl118643
Node: Inquiry120988
Node: Navigate125118
Node: Verify132716
Node: Restore141136
Node: Emulation147792
Node: Scripting155792
Node: Frontend161354
Node: Examples162555
Node: ExDevices163724
Node: ExCreate164358
Node: ExDialog165632
Node: ExGrowing166894
Node: ExModifying167696
Node: ExBootable168197
Node: ExCharset168744
Node: ExPseudo169572
Node: ExCdrecord170466
Node: ExMkisofs170781
Node: ExGrowisofs171784
Node: ExException172908
Node: ExTime173362
Node: ExIncBackup173821
Node: ExRestore177293
Node: ExRecovery178262
Node: Files178828
Node: Seealso180056
Node: Legal180580
Node: CommandIdx181502
Node: ConceptIdx195446
Node: Jigdo107608
Node: Charset111866
Node: Exception114617
Node: DialogCtl119132
Node: Inquiry121477
Node: Navigate125607
Node: Verify133205
Node: Restore141625
Node: Emulation148281
Node: Scripting156341
Node: Frontend161903
Node: Examples163104
Node: ExDevices164273
Node: ExCreate164907
Node: ExDialog166181
Node: ExGrowing167443
Node: ExModifying168245
Node: ExBootable168746
Node: ExCharset169293
Node: ExPseudo170121
Node: ExCdrecord171015
Node: ExMkisofs171330
Node: ExGrowisofs172333
Node: ExException173457
Node: ExTime173911
Node: ExIncBackup174370
Node: ExRestore177842
Node: ExRecovery178811
Node: Files179377
Node: Seealso180605
Node: Legal181129
Node: CommandIdx182051
Node: ConceptIdx195995

End Tag Table

View File

@ -44,7 +44,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 "Oct 07, 2010"
@c man .TH XORRISO 1 "Oct 13, 2010"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -2879,6 +2879,16 @@ partition offset. 0 chooses a default value.
@strong{partition_hd_cyl=}number gives the number of heads per cylinder for
partition offset. 0 chooses a default value.
@*
@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. Enable production of a MIPS Big Endian Volume
Header. This is mutually exclusive with MBR production. It will overwrite
the first 512 bytes of any data eventually provided by system_area=.
Up to 15 boot files can be declared by mips_path=.
@*
@strong{mips_discard} revokes any boot file declarations made by mips_path=.
This removes the ban on MBR production.
@*
@end table
@c man .TP
@c man .B Jigdo Template Extraction:
@ -4049,6 +4059,8 @@ instead of -G to apply the effect of -boot_image isolinux partition_table=on.
@*
@minus{}@minus{}boot-catalog-hide is -boot_image any cat_hidden=on.
@*
@minus{}mips-boot is the same as -boot_image any mips_path= .
@*
@minus{}partition_offset number is
@minus{}boot_image any partition_offset=number.
@*

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.10.12.183125"
#define Xorriso_timestamP "2010.10.13.170641"