New -boot_image bootspec grub2_sparc_core=

This commit is contained in:
Thomas Schmitt 2013-04-13 20:54:04 +00:00
parent ff347ebdd7
commit 109df000aa
6 changed files with 46 additions and 2 deletions

View File

@ -268,6 +268,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->appended_part_types[i]= 0; m->appended_part_types[i]= 0;
} }
m->ascii_disc_label[0]= 0; m->ascii_disc_label[0]= 0;
m->grub2_sparc_core[0]= 0;
memset(m->hfsp_serial_number, 0, 8); memset(m->hfsp_serial_number, 0, 8);
m->hfsp_block_size= 0; m->hfsp_block_size= 0;
m->apm_block_size= 0; m->apm_block_size= 0;

View File

@ -499,6 +499,10 @@ int Xorriso_boot_status_non_mbr(struct XorrisO *xorriso, IsoImage *image,
Text_shellsafe(xorriso->ascii_disc_label, line, 1); Text_shellsafe(xorriso->ascii_disc_label, line, 1);
strcat(line, "\n"); strcat(line, "\n");
Xorriso_status_result(xorriso, filter, fp, flag & 2); Xorriso_status_result(xorriso, filter, fp, flag & 2);
sprintf(line, "-boot_image grub grub2_sparc_core=");
Text_shellsafe(xorriso->grub2_sparc_core, line, 1);
strcat(line, "\n");
Xorriso_status_result(xorriso, filter, fp, flag & 2);
return(0); return(0);
} }
if(sa_type != 1 && sa_type != 2) if(sa_type != 1 && sa_type != 2)

View File

@ -852,7 +852,7 @@ treatment_patch:;
Xorriso_add_mips_boot_file(xorriso, "", 1); /* give up MIPS boot files */ Xorriso_add_mips_boot_file(xorriso, "", 1); /* give up MIPS boot files */
} else if(strncmp(treatpt, "sparc_label=", 12) == 0) { } else if(strncmp(treatpt, "sparc_label=", 12) == 0) {
sprintf(eff_path, "-boot_image %s sparc_path=", formpt); sprintf(eff_path, "-boot_image %s sparc_label=", formpt);
ret= Xorriso_coordinate_system_area(xorriso, 3, 0, eff_path, 0); ret= Xorriso_coordinate_system_area(xorriso, 3, 0, eff_path, 0);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
@ -860,6 +860,12 @@ treatment_patch:;
Xorriso_disc_label_sizE - 1); Xorriso_disc_label_sizE - 1);
xorriso->ascii_disc_label[Xorriso_disc_label_sizE - 1] = 0; xorriso->ascii_disc_label[Xorriso_disc_label_sizE - 1] = 0;
} else if(strncmp(treatpt, "grub2_sparc_core=", 17) == 0) {
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 17,
xorriso->grub2_sparc_core, 2);
if(ret <= 0)
goto ex;
} 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= (xorriso->patch_isolinux_image & ~3) | 0; xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 0;

View File

@ -311,9 +311,37 @@ int Xorriso_set_system_area(struct XorrisO *xorriso, struct burn_drive *drive,
unsigned char *ub; unsigned char *ub;
ElToritoBootImage *bootimg; ElToritoBootImage *bootimg;
IsoFile *bootimg_node; IsoFile *bootimg_node;
IsoNode *sparc_core_node;
uint32_t offst; uint32_t offst;
enum burn_disc_status state; enum burn_disc_status state;
if(xorriso->grub2_sparc_core[0]) {
ret= Xorriso_node_from_path(xorriso, img, xorriso->grub2_sparc_core,
&sparc_core_node, 1);
if(ret <= 0) {
sprintf(xorriso->info_text,
"Cannot find in ISO image: -boot_image grub grub2_sparc_core=");
Text_shellsafe(xorriso->grub2_sparc_core, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
if(!ISO_NODE_IS_FILE(sparc_core_node)) {
sprintf(xorriso->info_text,
"Not a data file: -boot_image grub grub2_sparc_core=");
Text_shellsafe(xorriso->grub2_sparc_core, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ret = iso_image_set_sparc_core(img, (IsoFile *) sparc_core_node, 0);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, "", ret,
"Error when setting up -boot_image grub grub2_sparc_core=",
0, "FAILURE", 1);
{ret= 0; goto ex;}
}
}
Xorriso_alloc_meM(buf, char, 32768); Xorriso_alloc_meM(buf, char, 32768);
system_area_options= xorriso->system_area_options; system_area_options= xorriso->system_area_options;
memset(buf, 0, 32768); memset(buf, 0, 32768);

View File

@ -443,6 +443,11 @@ struct XorrisO { /* the global context of xorriso */
*/ */
char ascii_disc_label[Xorriso_disc_label_sizE]; char ascii_disc_label[Xorriso_disc_label_sizE];
/* A data file of which the position and size shall be written after
a SUN Disk Label.
*/
char grub2_sparc_core[SfileadrL];
/* HFS+ image serial number. /* HFS+ image serial number.
00...00 means that it shall be generated by libisofs. 00...00 means that it shall be generated by libisofs.
*/ */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2013.04.13.144946" #define Xorriso_timestamP "2013.04.13.205230"