New -as mkisofs option -hard-disk-boot, enabled -b without -no-emul-boot

master
Thomas Schmitt 12 years ago
parent 689bcf0168
commit 4771254d1f
  1. 35
      xorriso/emulators.c
  2. 2
      xorriso/xorriso_timestamp.h

@ -639,23 +639,19 @@ no_volunteer:;
int Xorriso_genisofs_add_boot(struct XorrisO *xorriso, char *whom,
int *option_b, int *no_emul_boot, int flag)
int *option_b, int *emul_boot, int flag)
{
int ret;
if(*option_b && !*no_emul_boot) {
xorriso->boot_image_bin_path[0]= 0;
sprintf(xorriso->info_text,
"-as %s: Option -%s is supported only if option -no-emul-boot is given",
whom, (xorriso->boot_platform_id == 0xef ? "e" : "b"));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
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;
*no_emul_boot= 1;
*emul_boot= 2;
return(ret);
}
@ -724,6 +720,7 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" Set El Torito boot catalog name",
" --boot-catalog-hide Hide boot catalog from ISO9660/RR and Joliet",
" -boot-load-size # Set numbers of load sectors",
" -hard-disk-boot Boot image is a hard disk image",
" -no-emul-boot Boot image is 'no emulation' image",
" -boot-info-table Patch boot image with info table",
" -G FILE, -generic-boot FILE Set generic boot image name",
@ -843,7 +840,7 @@ 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= 0, no_emul_boot= 0;
int do_print_size= 0, fd, idx, iso_level= 0, emul_boot= 2;
int option_b= 0, was_failure= 0, fret, lower_r= 0, zero= 0;
int dir_mode= -1, file_mode= -1, count;
mode_t mode_and, mode_or;
@ -1211,6 +1208,7 @@ not_enough_args:;
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-no-emul-boot")==0 ||
strcmp(argv[i], "-hard-disk-boot")==0 ||
strcmp(argv[i], "-boot-info-table")==0 ||
strncmp(argv[i], "isolinux_mbr=", 13)==0 ||
strcmp(argv[i], "-eltorito-alt-boot")==0 ||
@ -1411,7 +1409,9 @@ problem_handler_2:;
for(j= 0; j < delay_opt_count; j++) {
i= delay_opt_list[j];
if(strcmp(argv[i], "-no-emul-boot")==0) {
no_emul_boot= 1;
emul_boot= xorriso->boot_image_emul= 0;
} else if(strcmp(argv[i], "-hard-disk-boot")==0) {
emul_boot= xorriso->boot_image_emul= 1;
} else if(strcmp(argv[i], "-boot-info-table")==0) {
xorriso->patch_isolinux_image= 1;
} else if(strcmp(argv[i], "-b") == 0 ||
@ -1422,12 +1422,13 @@ problem_handler_2:;
if(strcmp(argv[i - 1], "--efi-boot") == 0) {
if(xorriso->boot_image_bin_path[0]) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &no_emul_boot, 0);
&option_b, &emul_boot, 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;
} else {
boot_path= xorriso->boot_image_bin_path;
if(strcmp(argv[i - 1], "-e") == 0)
@ -1436,6 +1437,7 @@ problem_handler_2:;
xorriso->boot_platform_id= 0x00;
xorriso->boot_efi_default= 0;
option_b= 1;
xorriso->boot_image_emul= emul_boot;
}
boot_path[0]= 0;
if(argv[i][0] != '/')
@ -1445,8 +1447,9 @@ problem_handler_2:;
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, &no_emul_boot, 0);
&option_b, &emul_boot, 0);
if(ret <= 0)
goto problem_handler_boot;
}
@ -1479,7 +1482,7 @@ problem_handler_2:;
goto problem_handler_boot;
} else if(strcmp(argv[i], "-eltorito-alt-boot")==0) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &no_emul_boot, 0);
&option_b, &emul_boot, 0);
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argv[i], "--embedded-boot")==0 ||
@ -1511,7 +1514,7 @@ 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, &no_emul_boot, 0);
ret= Xorriso_genisofs_add_boot(xorriso, whom, &option_b, &emul_boot, 0);
if(ret <= 0)
goto ex;
}

@ -1 +1 @@
#define Xorriso_timestamP "2010.08.18.181640"
#define Xorriso_timestamP "2010.08.18.181855"

Loading…
Cancel
Save