diff --git a/xorriso/emulators.c b/xorriso/emulators.c index 3929e154..270162df 100644 --- a/xorriso/emulators.c +++ b/xorriso/emulators.c @@ -2672,7 +2672,7 @@ problem_handler_2:; xorriso->system_area_options= xorriso->system_area_options | (1 << 17); } else if(strcmp(argpt, "--boot-catalog-hide")==0) { - xorriso->boot_image_cat_hidden|= 3; + xorriso->boot_image_cat_hidden|= 7; } else if(strcmp(argpt, "-partition_offset") == 0 || strcmp(argpt, "-partition_sec_hd") == 0 || strcmp(argpt, "-partition_hd_cyl") == 0 || @@ -2769,7 +2769,8 @@ problem_handler_boot:; continue; goto ex; } - if(with_boot_image && with_cat_path == 0) + if(with_boot_image && with_cat_path == 0 && + !(xorriso->boot_image_cat_hidden & 1)) strcpy(xorriso->boot_image_cat_path, "/boot.catalog"); /* The boot catalog has to be hidden separately */ if(xorriso->boot_image_cat_path[0]) { diff --git a/xorriso/write_run.c b/xorriso/write_run.c index 1cae4a41..fa021e27 100644 --- a/xorriso/write_run.c +++ b/xorriso/write_run.c @@ -621,7 +621,7 @@ int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag) int emul, platform_id; off_t load_size; struct stat stbuf; - int hflag= 0, is_interval= 0; + int hflag= 0, is_interval= 0, cat_tries; if(xorriso->boot_image_bin_path[0] == 0 && !(flag & 2)) { @@ -705,9 +705,19 @@ int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag) cpt++; } strcpy(cpt, "boot.cat"); + if(xorriso->boot_image_cat_hidden & 1) { + /* Find a name which does not yet exist */ + ret= 1; + for(cat_tries= 1; ret > 0 && cat_tries < 1000000; cat_tries++) { + ret= Xorriso_node_from_path(xorriso, image, + xorriso->boot_image_cat_path, &node, 1); + if(ret > 0) + sprintf(cpt, "real%d_boot.cat", cat_tries); + } + } } ret= Xorriso_node_from_path(xorriso, image, xorriso->boot_image_cat_path, - &node, 1); + &node, 1); if(ret > 0) { if(!xorriso->do_overwrite) { sprintf(xorriso->info_text, diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index ad8c6e5a..1e1b4448 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2022.12.11.182322" +#define Xorriso_timestamP "2022.12.17.190005"