Lifted the ban to combine MIPS Big Endian boot with El Torito

This commit is contained in:
Thomas Schmitt 2010-10-12 18:31:54 +00:00
parent da5f01d95b
commit 2b7130ecdd
6 changed files with 85 additions and 4 deletions

View File

@ -1455,7 +1455,9 @@ problem_handler_2:;
xorriso->patch_isolinux_image= 1; xorriso->patch_isolinux_image= 1;
} else if(strcmp(argv[i], "-b") == 0 || } else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 || strcmp(argv[i], "-eltorito-boot") == 0 ||
#ifndef Xorriso_mips_boot_file_pathS
strcmp(argv[i], "-mips-boot") == 0 || strcmp(argv[i], "-mips-boot") == 0 ||
#endif
strcmp(argv[i], "--efi-boot") == 0 || strcmp(argv[i], "--efi-boot") == 0 ||
strcmp(argv[i], "-e") == 0) { strcmp(argv[i], "-e") == 0) {
i++; i++;
@ -1469,6 +1471,9 @@ problem_handler_2:;
boot_path= xorriso->boot_image_bin_path; boot_path= xorriso->boot_image_bin_path;
xorriso->boot_efi_default= 1; xorriso->boot_efi_default= 1;
emul_boot= xorriso->boot_image_emul= 0; emul_boot= xorriso->boot_image_emul= 0;
#ifndef Xorriso_mips_boot_file_pathS
} else if(strcmp(argv[i - 1], "-mips-boot") == 0) { } else if(strcmp(argv[i - 1], "-mips-boot") == 0) {
boot_path= xorriso->boot_image_bin_path; boot_path= xorriso->boot_image_bin_path;
option_b= 0; option_b= 0;
@ -1476,6 +1481,7 @@ problem_handler_2:;
/* >>> Preliminary : this should be adjustable per boot image */ /* >>> Preliminary : this should be adjustable per boot image */
xorriso->system_area_options= 1 << 2; /* system area type 1 */ xorriso->system_area_options= 1 << 2; /* system area type 1 */
#endif /* ! Xorriso_mips_boot_file_pathS */
} else { } else {
boot_path= xorriso->boot_image_bin_path; boot_path= xorriso->boot_image_bin_path;
@ -1559,6 +1565,24 @@ problem_handler_2:;
ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0); ret= Xorriso_option_boot_image(xorriso, "any", sfe, 0);
if(ret <= 0) if(ret <= 0)
goto problem_handler_boot; 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;
i++;
strcpy(sfe, "mips_path=");
ret= Sfile_str(sfe, argv[i], 1);
if(ret <= 0)
goto ex;
ret = Xorriso_option_boot_image(xorriso, "any", sfe, 0);
if(ret <= 0)
goto problem_handler_boot;
#endif /* Xorriso_mips_boot_file_pathS */
} }
continue; /* regular bottom of loop */ continue; /* regular bottom of loop */
problem_handler_boot:; problem_handler_boot:;

View File

@ -376,7 +376,7 @@ int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path,
strcpy(bspec, "dir=/boot/isolinux"); strcpy(bspec, "dir=/boot/isolinux");
memset(zeros, 0, 28); memset(zeros, 0, 28);
if(bspec[0] && platform_id == 0 && patch_isolinux && if(bspec[0] && platform_id == 0 && patch_isolinux &&
load_size == 2048 && is_default_id) { load_size == 2048 && is_default_id && emul == 0) {
sprintf(line, "-boot_image isolinux %s\n", bspec); sprintf(line, "-boot_image isolinux %s\n", bspec);
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
return(1); return(1);
@ -388,7 +388,7 @@ int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path,
file_size= ((stbuf.st_size / (off_t) 512) + file_size= ((stbuf.st_size / (off_t) 512) +
!!(stbuf.st_size % (off_t) 512)) * 512; !!(stbuf.st_size % (off_t) 512)) * 512;
if(platform_id == 0xef && !patch_isolinux && if(platform_id == 0xef && !patch_isolinux &&
load_size == file_size && is_default_id) { load_size == file_size && is_default_id && emul == 0) {
sprintf(line, "-boot_image any efi_path="); sprintf(line, "-boot_image any efi_path=");
Text_shellsafe(bin_path, line, 1); Text_shellsafe(bin_path, line, 1);
strcat(line, "\n"); strcat(line, "\n");
@ -404,6 +404,12 @@ int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path,
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2); Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (emul == 0);
sprintf(line, "-boot_image %s emul_type=%s\n",
form, emul == 2 ? "diskette" : emul == 1 ? "hard_disk" : "no_emulation");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (platform_id == 0 || (flag & 4)); is_default= (platform_id == 0 || (flag & 4));
sprintf(line, "-boot_image %s platform_id=0x%-2.2x\n", form, platform_id); sprintf(line, "-boot_image %s platform_id=0x%-2.2x\n", form, platform_id);
if(!(is_default && no_defaults)) if(!(is_default && no_defaults))
@ -531,6 +537,12 @@ int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp,
load_size= el_torito_get_load_size(boots[i]) * 512; load_size= el_torito_get_load_size(boots[i]) * 512;
el_torito_get_id_string(boots[i], id_string); el_torito_get_id_string(boots[i], id_string);
el_torito_get_selection_crit(boots[i], sel_crit); el_torito_get_selection_crit(boots[i], sel_crit);
if(media_type == ELTORITO_FLOPPY_EMUL)
media_type= 2;
else if(media_type == ELTORITO_HARD_DISC_EMUL)
media_type= 1;
else
media_type= 0;
ret= Xorriso_boot_item_status(xorriso, xorriso->boot_image_cat_path, ret= Xorriso_boot_item_status(xorriso, xorriso->boot_image_cat_path,
path, platform_id, patch & 1, media_type, path, platform_id, patch & 1, media_type,
load_size, id_string, sel_crit, "any", load_size, id_string, sel_crit, "any",
@ -959,3 +971,24 @@ ex:;
return(ret); return(ret);
} }
int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag)
{
int ret;
IsoImage *image;
ret= Xorriso_get_volume(xorriso, &image, 0);
if(ret <= 0)
return ret;
ret = iso_image_add_mips_boot_file(image, path, 0);
Xorriso_process_msg_queues(xorriso,0);
if (ret < 0) {
Xorriso_report_iso_error(xorriso, "", ret,
"Error when adding MIPS boot file",
0, "FAILURE", 1);
return(0);
}
return(1);
}

View File

@ -567,7 +567,7 @@ int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form,
{ {
int was_ok= 1, ret, isolinux_grub= 0, count; int was_ok= 1, ret, isolinux_grub= 0, count;
unsigned int u; unsigned int u;
char *formpt, *treatpt; char *formpt, *treatpt, eff_path[SfileadrL];
double num; double num;
formpt= form; formpt= form;
@ -739,6 +739,22 @@ treatment_patch:;
xorriso->system_area_options&= ~0xfc; /* system area type 0 */ xorriso->system_area_options&= ~0xfc; /* system area type 0 */
} else if(strncmp(treatpt, "mips_path=", 10) == 0) { } else if(strncmp(treatpt, "mips_path=", 10) == 0) {
#ifdef Xorriso_mips_boot_file_pathS
/* >>> Check for contradicting xorriso->system_area_options */;
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 10,
eff_path, 2);
if(ret <= 0)
return(ret);
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, ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 10,
xorriso->boot_image_bin_path, 2); xorriso->boot_image_bin_path, 2);
if(ret <= 0) if(ret <= 0)
@ -749,6 +765,8 @@ treatment_patch:;
/* >>> Preliminary : this should be adjustable per boot image */ /* >>> Preliminary : this should be adjustable per boot image */
xorriso->system_area_options&= 1 << 2; /* system area type 1 */ xorriso->system_area_options&= 1 << 2; /* system area type 1 */
#endif /* ! Xorriso_mips_boot_file_pathS */
} else if(strncmp(treatpt, "boot_info_table=", 16)==0) { } else if(strncmp(treatpt, "boot_info_table=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0) if(strcmp(treatpt + 16, "off") == 0)
xorriso->patch_isolinux_image= 0; xorriso->patch_isolinux_image= 0;

View File

@ -558,5 +558,8 @@ struct XorrisO { /* the global context of xorriso */
#include "parse_exec.h" #include "parse_exec.h"
/* <<< */
#define Xorriso_mips_boot_file_pathS 1
#endif /* Xorriso_private_includeD */ #endif /* Xorriso_private_includeD */

View File

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

View File

@ -518,6 +518,9 @@ int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp,
#define Xorriso_IFBOOT S_IFMT #define Xorriso_IFBOOT S_IFMT
int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag);
int Exprtest_match(struct XorrisO *xorriso, struct ExprtesT *ftest, int Exprtest_match(struct XorrisO *xorriso, struct ExprtesT *ftest,
void *node_pt, char *name, char *path, void *node_pt, char *name, char *path,
struct stat *boss_stbuf, struct stat *stbuf, int flag); struct stat *boss_stbuf, struct stat *stbuf, int flag);