New -boot_image action "replay"
This commit is contained in:
@ -2420,7 +2420,7 @@ ex:
|
||||
|
||||
/* @param flag bit0= currently not significant:
|
||||
report is about El Torito rather than System Area
|
||||
bit1= report -as mkisofsoptions
|
||||
bit1= report -as mkisofs options
|
||||
bit15= dispose cmds
|
||||
*/
|
||||
static int Xorriso_report_to_cmd(struct XorrisO *xorriso,
|
||||
@ -2484,12 +2484,12 @@ static void Xorriso_report_lines(struct XorrisO *xorriso,
|
||||
|
||||
|
||||
/* @param flag bit0= report El Torito rather than System Area
|
||||
>>> bit1= with form "cmd" do not report but rather execute
|
||||
bit1= with form "cmd" do not report but rather execute
|
||||
*/
|
||||
int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag)
|
||||
{
|
||||
int ret, line_count, cmd_count= 0, et_line_count= 0, sa_line_count= 0;
|
||||
int do_cmd= 0, as_mkisofs= 0;
|
||||
int do_cmd= 0, as_mkisofs= 0, i;
|
||||
char **lines = NULL, **et_lines= NULL, **sa_lines= NULL, **cmds= NULL;
|
||||
IsoImage *image;
|
||||
|
||||
@ -2578,9 +2578,26 @@ int Xorriso_report_system_area(struct XorrisO *xorriso, char *form, int flag)
|
||||
}
|
||||
}
|
||||
if(flag & 2) {
|
||||
|
||||
/* >>> execute commands */;
|
||||
|
||||
if(cmd_count > 0) {
|
||||
ret= Xorriso_execute_option(xorriso,
|
||||
"-boot_image any discard -boot_image any system_area=/dev/zero",
|
||||
1 | 16);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
for(i= 0; i < cmd_count; i++) {
|
||||
ret= Xorriso_execute_option(xorriso, cmds[i], 1 | 16);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
}
|
||||
sprintf(xorriso->info_text,
|
||||
"Replayed %d boot related commands", cmd_count);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||
} else {
|
||||
Xorriso_msgs_submit(xorriso, 0,
|
||||
"No proposals available for boot related commands",
|
||||
0, "NOTE", 0);
|
||||
ret= 2; goto ex;
|
||||
}
|
||||
} else if(do_cmd) {
|
||||
Xorriso_report_lines(xorriso, cmds, cmd_count);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user