diff --git a/xorriso/emulators.c b/xorriso/emulators.c index 6388ccca..206f98fb 100644 --- a/xorriso/emulators.c +++ b/xorriso/emulators.c @@ -1241,6 +1241,7 @@ not_enough_args:; strcmp(argv[i], "--efi-boot") == 0 || strcmp(argv[i], "-e") == 0 || strcmp(argv[i], "-mips-boot") == 0 || + strcmp(argv[i], "-mipsel-boot") == 0 || strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "-eltorito-catalog") == 0 || strcmp(argv[i], "-boot-load-size") == 0 || @@ -1552,11 +1553,15 @@ problem_handler_2:; if(ret <= 0) goto problem_handler_boot; - } else if(strcmp(argv[i], "-mips-boot")==0) { - if(i+1>=argc) + } else if(strcmp(argv[i], "-mips-boot") == 0 || + strcmp(argv[i], "-mipsel-boot") == 0) { + if(i + 1 >= argc) goto not_enough_args; i++; - strcpy(sfe, "mips_path="); + if(strcmp(argv[i - 1], "-mipsel-boot") == 0) + strcpy(sfe, "mipsel_path="); + else + strcpy(sfe, "mips_path="); ret= Sfile_str(sfe, argv[i], 1); if(ret <= 0) goto ex; diff --git a/xorriso/iso_img.c b/xorriso/iso_img.c index 940cedb3..2c8049b8 100644 --- a/xorriso/iso_img.c +++ b/xorriso/iso_img.c @@ -458,17 +458,20 @@ 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; + int i, num_boots, sa_type; char *paths[15], *line; line= xorriso->result_line; + sa_type= (xorriso->system_area_options & 0xfc) >> 2; num_boots= iso_image_get_mips_boot_files(image, paths, 0); Xorriso_process_msg_queues(xorriso, 0); if(num_boots <= 0) return(num_boots); + if(sa_type == 2) + num_boots= 1; for(i= 0; i < num_boots; i++) { - strcpy(line,"-boot_image any mips_path="); + sprintf(line, "-boot_image any mips%s_path=", sa_type ==2 ? "el" : ""); Text_shellsafe(paths[i], line, 1); strcat(line, "\n"); Xorriso_status_result(xorriso, filter, fp, flag & 2); @@ -1001,22 +1004,38 @@ ex:; /* @param flag bit0= give up all boot file paths + bit1= refuse if already a path is added */ int Xorriso_add_mips_boot_file(struct XorrisO *xorriso, char *path, int flag) { int ret; IsoImage *image; + char *paths[15]; 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); + iso_image_give_up_mips_boot(image, 0); + Xorriso_process_msg_queues(xorriso,0); + return(1); + } + if(flag & 2) { + ret= iso_image_get_mips_boot_files(image, paths, 0); + Xorriso_process_msg_queues(xorriso,0); + if(ret < 0) + goto report_error; + if(ret > 0) { + Xorriso_msgs_submit(xorriso, 0, + "There is already a boot image file registered.", + 0, "FAILURE", 0); + return(0); + } } ret = iso_image_add_mips_boot_file(image, path, 0); Xorriso_process_msg_queues(xorriso,0); if (ret < 0) { +report_error:; Xorriso_report_iso_error(xorriso, "", ret, "Error when adding MIPS boot file", 0, "FAILURE", 1); @@ -1030,7 +1049,8 @@ 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"}; + static char *type_names[3] = { + "MBR", "MIPS Big Endian Volume Header", "MIPS Little Endian Boot Block"}; old_type= (xorriso->system_area_options & 0xfc) >> 2; old_options= xorriso->system_area_options & ~0xfc; @@ -1053,7 +1073,7 @@ int Xorriso_coordinate_system_area(struct XorrisO *xorriso, int sa_type, hint_revoke:; if(old_type == 0) sprintf(xorriso->info_text, "Revokable by -boot_image any discard"); - else if(old_type == 1) + else if(old_type == 1 || old_type == 2) 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); diff --git a/xorriso/opts_a_c.c b/xorriso/opts_a_c.c index a39fc549..a90a50ba 100644 --- a/xorriso/opts_a_c.c +++ b/xorriso/opts_a_c.c @@ -745,7 +745,21 @@ treatment_patch:; if(ret <= 0) return(ret); - } else if(strcmp(treatpt, "mips_discard") == 0) { + } else if(strncmp(treatpt, "mipsel_path=", 12) == 0) { + sprintf(eff_path, "-boot_image %s mipsel_path=", formpt); + ret= Xorriso_coordinate_system_area(xorriso, 2, 0, eff_path, 0); + if(ret <= 0) + return(ret); + ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 12, + eff_path, 2); + if(ret <= 0) + return(ret); + ret= Xorriso_add_mips_boot_file(xorriso, eff_path, 2); + if(ret <= 0) + return(ret); + + } else if(strcmp(treatpt, "mips_discard") == 0 || + strcmp(treatpt, "mipsel_discard") == 0) { xorriso->system_area_options&= ~0xfc; /* system area type 0 */ Xorriso_add_mips_boot_file(xorriso, "", 1); /* give up MIPS boot files */ diff --git a/xorriso/opts_d_h.c b/xorriso/opts_d_h.c index f8387e6f..4948bfef 100644 --- a/xorriso/opts_d_h.c +++ b/xorriso/opts_d_h.c @@ -1390,7 +1390,8 @@ 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\"", +" |\"mips_path=\"|\"mipsel_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=...", @@ -1399,8 +1400,9 @@ 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.", +" mips_path= adds Big Endian MIPS boot files. mipsel_path=", +" sets one Little Endian MIPS boot file. Both are mutually", +" exclusive and exclusive to MBR production.", "", " -uid uid User id to be used for the whole multi-session ISO image.", " -gid gid Group id for the same purpose.", diff --git a/xorriso/xorriso.texi b/xorriso/xorriso.texi index 60a2c01e..5884d89f 100644 --- a/xorriso/xorriso.texi +++ b/xorriso/xorriso.texi @@ -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 13, 2010" +@c man .TH XORRISO 1 "Oct 15, 2010" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @@ -2882,10 +2882,17 @@ 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=. +Header. This is mutually exclusive with MBR production and mipsel_path=. +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{mipsel_path=}iso_rr_path declares a data file in the image to be the +MIPS Little Endian boot file. This is mutually exclusive with MBR production +and mips_path=. It will overwrite the first 512 bytes of any data eventually +provided by system_area=. +Only a single boot file can be declared by mipsel_path=. +@* @strong{mips_discard} revokes any boot file declarations made by mips_path=. This removes the ban on MBR production. @* diff --git a/xorriso/xorriso_private.h b/xorriso/xorriso_private.h index b87e598e..db9f426e 100644 --- a/xorriso/xorriso_private.h +++ b/xorriso/xorriso_private.h @@ -304,6 +304,7 @@ struct XorrisO { /* the global context of xorriso */ 0= with bit0 or bit1: MBR else: unspecified type 1= MIPS Big Endian Volume Header + 2= MIPS Little Endian Boot Block */ int patch_system_area; /* Bits as of system_area_options. to be applied to the loaded system @@ -558,8 +559,5 @@ struct XorrisO { /* the global context of xorriso */ #include "parse_exec.h" -/* <<< */ -#define Xorriso_mips_boot_file_pathS 1 - #endif /* Xorriso_private_includeD */ diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 07abde08..38cdb4de 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2010.10.13.170641" +#define Xorriso_timestamP "2010.10.15.112050"