Improved interaction of -as mkisofs command with other commands

This commit is contained in:
2013-03-10 19:34:09 +00:00
parent 0d3908da8f
commit c2088a4d48
9 changed files with 116 additions and 83 deletions

View File

@ -703,20 +703,13 @@ no_volunteer:;
}
int Xorriso_genisofs_add_boot(struct XorrisO *xorriso, char *whom,
int *option_b, int *emul_boot, int flag)
int Xorriso_genisofs_add_boot(struct XorrisO *xorriso, int flag)
{
int ret;
if(*option_b)
xorriso->boot_image_emul= *emul_boot;
else
xorriso->boot_image_emul= 0;
ret= Xorriso_attach_boot_image(xorriso, 0);
if(ret <= 0)
xorriso->boot_image_bin_path[0]= 0;
*option_b= 0;
*emul_boot= 2;
return(ret);
}
@ -1095,9 +1088,10 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int argc, char **argv, int flag)
{
int ret, i, j, was_path= 0, was_other_option= 0, mem_graft_points, mem;
int do_print_size= 0, fd, idx, iso_level= 1, emul_boot= 2;
int option_b= 0, was_failure= 0, fret, lower_r= 0, zero= 0;
int dir_mode= -1, file_mode= -1, count, partition_number, allow_dir_id_ext= 1;
int do_print_size= 0, fd, idx, iso_level= -1;
int was_failure= 0, fret, lower_r= 0, zero= 0;
int dir_mode= -1, file_mode= -1, count, partition_number;
int allow_dir_id_ext= -1;
int root_seen= 0, do_md5_mem, option_d= 0, arg_count;
mode_t mode_and, mode_or;
int with_boot_image= 0, with_cat_path= 0, with_emul_toc= 0;
@ -2075,10 +2069,14 @@ rr_reloc_dir:;
/* Enforce odd mkisofs defaults on first pathspec */
xorriso->pacifier_style= 1;
if(xorriso->allow_dir_id_ext_dflt && allow_dir_id_ext < 0)
allow_dir_id_ext= 1;
if(allow_dir_id_ext == 1) {
Xorriso_relax_compliance(xorriso, "allow_dir_id_ext", 0);
allow_dir_id_ext= 2;
}
if(xorriso->iso_level_is_default && iso_level < 0)
iso_level= 1;
if(iso_level >= 1 && iso_level <= 3) {
sprintf(sfe, "iso_9660_level=%d", iso_level);
Xorriso_relax_compliance(xorriso, sfe, 0);
@ -2172,9 +2170,11 @@ problem_handler_2:;
else
argpt= argv[i];
if(strcmp(argpt, "-no-emul-boot")==0) {
emul_boot= xorriso->boot_image_emul= 0;
xorriso->boot_image_emul= 0;
xorriso->boot_emul_default= 0;
} else if(strcmp(argpt, "-hard-disk-boot")==0) {
emul_boot= xorriso->boot_image_emul= 1;
xorriso->boot_image_emul= 1;
xorriso->boot_emul_default= 0;
} else if(strcmp(argpt, "-boot-info-table")==0) {
xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~2) | 1;
} else if(strcmp(argpt, "-b") == 0 ||
@ -2184,14 +2184,14 @@ problem_handler_2:;
i++;
if(strcmp(argpt, "--efi-boot") == 0) {
if(xorriso->boot_image_bin_path[0]) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &emul_boot, 0);
ret= Xorriso_genisofs_add_boot(xorriso, 0);
if(ret <= 0)
goto problem_handler_boot;
}
boot_path= xorriso->boot_image_bin_path;
xorriso->boot_efi_default= 1;
emul_boot= xorriso->boot_image_emul= 0;
xorriso->boot_image_emul= 0;
xorriso->boot_emul_default= 0;
} else {
boot_path= xorriso->boot_image_bin_path;
@ -2200,8 +2200,8 @@ problem_handler_2:;
else
xorriso->boot_platform_id= 0x00;
xorriso->boot_efi_default= 0;
option_b= 1;
xorriso->boot_image_emul= emul_boot;
if(xorriso->boot_emul_default)
xorriso->boot_image_emul= 2;
}
boot_path[0]= 0;
if(argv[i][0] != '/')
@ -2210,10 +2210,7 @@ problem_handler_2:;
if(ret <= 0)
goto ex;
if(xorriso->boot_efi_default && xorriso->boot_image_bin_path[0]) {
option_b= 0;
emul_boot= 0;
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &emul_boot, 0);
ret= Xorriso_genisofs_add_boot(xorriso, 0);
if(ret <= 0)
goto problem_handler_boot;
}
@ -2265,8 +2262,7 @@ problem_handler_2:;
} else if(strcmp(argpt, "-isohybrid-apm-hfsplus") == 0) {
xorriso->patch_isolinux_image = xorriso->patch_isolinux_image | (1 << 8);
} else if(strcmp(argpt, "-eltorito-alt-boot")==0) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &emul_boot, 0);
ret= Xorriso_genisofs_add_boot(xorriso, 0);
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argpt, "--embedded-boot")==0 ||
@ -2358,11 +2354,6 @@ problem_handler_boot:;
}
if(with_boot_image && with_cat_path == 0)
strcpy(xorriso->boot_image_cat_path, "/boot.catalog");
if(xorriso->boot_image_bin_path[0]) {
ret= Xorriso_genisofs_add_boot(xorriso, whom, &option_b, &emul_boot, 0);
if(ret <= 0)
goto ex;
}
/* The boot catalog has to be hidden separately */
if(xorriso->boot_image_cat_path[0]) {
ret= Xorriso_path_is_hidden(xorriso, xorriso->boot_image_cat_path, 0);