New -boot_image settings hppa_cmdline=, hppa_bootloader=, hppa_kernel_32=, hppa_kernel_64=, hppa_ramdisk=

This commit is contained in:
2014-01-14 09:11:02 +00:00
parent b2eacd7d7f
commit 49ba26d6b0
10 changed files with 263 additions and 115 deletions

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2013 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2014 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -515,6 +515,22 @@ ex:;
}
int Xorriso_status_hppa(struct XorrisO *xorriso, char *what, char *value,
char *filter, FILE *fp, int flag)
{
char *line;
line= xorriso->result_line;
if(value == NULL)
return(1);
sprintf(line, "-boot_image any hppa_%s=", what);
Text_shellsafe(value, line, 1);
strcat(line, "\n");
Xorriso_status_result(xorriso, filter, fp, flag & 2);
return(1);
}
/*
bit0= do only report non-default settings
bit1= do only report to fp
@ -522,8 +538,9 @@ ex:;
int Xorriso_boot_status_non_mbr(struct XorrisO *xorriso, IsoImage *image,
char *filter, FILE *fp, int flag)
{
int i, num_boots, sa_type;
int i, num_boots, sa_type, ret;
char *paths[15], *line;
char *cmdline, *bootloader, *kernel_32, *kernel_64, *ramdisk;
line= xorriso->result_line;
@ -539,21 +556,37 @@ int Xorriso_boot_status_non_mbr(struct XorrisO *xorriso, IsoImage *image,
Xorriso_status_result(xorriso, filter, fp, flag & 2);
return(0);
}
if(sa_type != 1 && sa_type != 2)
if(sa_type != 1 && sa_type != 2 && sa_type != 4)
return(0);
num_boots= iso_image_get_mips_boot_files(image, paths, 0);
Xorriso_process_msg_queues(xorriso, 0);
if(num_boots <= 0)
if(sa_type == 1 || sa_type == 2) {
num_boots= iso_image_get_mips_boot_files(image, paths, 0);
Xorriso_process_msg_queues(xorriso, 0);
if(num_boots > 0) {
if(sa_type == 2)
num_boots= 1;
for(i= 0; i < num_boots; i++) {
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);
}
}
return(num_boots);
if(sa_type == 2)
num_boots= 1;
for(i= 0; i < num_boots; i++) {
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);
}
return(num_boots);
if(sa_type == 4) {
ret= iso_image_get_hppa_palo(image, &cmdline, &bootloader, &kernel_32,
&kernel_64, &ramdisk);
if(ret == 1) {
Xorriso_status_hppa(xorriso, "cmdline", cmdline, filter, fp, 0);
Xorriso_status_hppa(xorriso, "bootloader", bootloader, filter, fp, 0);
Xorriso_status_hppa(xorriso, "kernel_32", kernel_32, filter, fp, 0);
Xorriso_status_hppa(xorriso, "kernel_64", kernel_64, filter, fp, 0);
Xorriso_status_hppa(xorriso, "ramdisk", ramdisk, filter, fp, 0);
}
return(0);
}
return(0);
}
@ -1226,6 +1259,54 @@ report_error:;
}
/* @param flag bit0= Give up HP-PA boot parameters
*/
int Xorriso_set_hppa_boot_parm(struct XorrisO *xorriso, char *text, char *what,
int flag)
{
int ret;
IsoImage *image;
char *par[5];
ret= Xorriso_get_volume(xorriso, &image, 0);
if(ret <= 0)
return(ret);
par[0]= par[1]= par[2]= par[3]= par[4]= NULL;
if(flag & 1) {
/* Give up HP-PA boot parameters */
iso_image_set_hppa_palo(image, par[0], par[1], par[2], par[3], par[4],
1);
return(1);
}
if(strcmp(what, "cmdline") == 0) {
par[0]= text;
} else if(strcmp(what, "bootloader") == 0) {
par[1]= text;
} else if(strcmp(what, "kernel_32") == 0 || strcmp(what, "kernel-32") == 0) {
par[2]= text;
} else if(strcmp(what, "kernel_64") == 0 || strcmp(what, "kernel-64") == 0) {
par[3]= text;
} else if(strcmp(what, "ramdisk") == 0) {
par[4]= text;
} else {
strcpy(xorriso->info_text,
"HP-PA boot parameter name not recognized: hppa_");
Text_shellsafe(what, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
ret= iso_image_set_hppa_palo(image, par[0], par[1], par[2], par[3], par[4],
0);
if (ret < 0) {
Xorriso_report_iso_error(xorriso, "", ret,
"Error when adding HP-PA boot parameter",
0, "FAILURE", 1);
return(0);
}
return(1);
}
int Xorriso_coordinate_system_area(struct XorrisO *xorriso, int sa_type,
int options, char *cmd, int flag)
{