|
|
|
@ -534,6 +534,7 @@ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv,
|
|
|
|
|
"--hardlinks", "--acl", "--xattr", "--md5", "--for_backup",
|
|
|
|
|
"--protective-msdos-label", "--boot-catalog-hide", "--no-emul-toc",
|
|
|
|
|
"--emul-toc", "-disallow_dir_id_ext", "--old-empty",
|
|
|
|
|
"--old-root-no-md5", "--old-root-devno", "--old-root-no-ino",
|
|
|
|
|
""
|
|
|
|
|
};
|
|
|
|
|
static char arg1_options[][41]= {
|
|
|
|
@ -624,10 +625,10 @@ int Xorriso_genisofs_ignore(struct XorrisO *xorriso, char *whom,
|
|
|
|
|
""
|
|
|
|
|
};
|
|
|
|
|
static char ignored_arg1_options[][41]= {
|
|
|
|
|
"-check-session", "-hide-hfs", "-hide-hfs-list", "-root",
|
|
|
|
|
"-old-root", "-table-name", "-volset-seqno", "-volset-size",
|
|
|
|
|
"-check-session", "-hide-hfs", "-hide-hfs-list",
|
|
|
|
|
"-table-name", "-volset-seqno", "-volset-size",
|
|
|
|
|
""
|
|
|
|
|
};
|
|
|
|
|
}; /* "-root", "-old-root", */
|
|
|
|
|
int k, idx_offset= 0;
|
|
|
|
|
char sfe[5*SfileadrL];
|
|
|
|
|
|
|
|
|
@ -776,10 +777,16 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
|
|
|
|
|
" --old-empty Use old style block addresses for empty files",
|
|
|
|
|
" -z, -transparent-compression",
|
|
|
|
|
" Enable transparent compression of files",
|
|
|
|
|
" -root DIR Set root directory for all new files and directories",
|
|
|
|
|
" -old-root DIR Set root directory in previous session that is searched for files",
|
|
|
|
|
" --old-root-no-md5 Do not record and use MD5 with -old-root",
|
|
|
|
|
" --old-root-no-ino Do not use disk inode numbers with -old-root",
|
|
|
|
|
" --old-root-devno Use disk device numbers with -old-root",
|
|
|
|
|
" -v, -verbose Verbose",
|
|
|
|
|
" -version Print the current version",
|
|
|
|
|
"@End_of_helptexT@"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
char ra_text[80];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
@ -883,15 +890,22 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
|
|
|
|
|
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 root_seen= 0;
|
|
|
|
|
mode_t mode_and, mode_or;
|
|
|
|
|
int with_boot_image= 0, with_cat_path= 0, with_emul_toc= 0;
|
|
|
|
|
int old_root_md5= 1, old_root_dev= 0, old_root_ino= 1;
|
|
|
|
|
int *weight_list= NULL, weight_count= 0;
|
|
|
|
|
int *delay_opt_list= NULL, delay_opt_count= 0;
|
|
|
|
|
char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL];
|
|
|
|
|
char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt;
|
|
|
|
|
char *boot_path, partno_text[8];
|
|
|
|
|
char old_root[SfileadrL];
|
|
|
|
|
char *boot_path, partno_text[8], *iso_rr_pt, *disk_pt;
|
|
|
|
|
|
|
|
|
|
/* >>> This should not be static. Why is it ? */
|
|
|
|
|
static char *sort_weight_args[4]= {"", "-exec", "sort_weight", ""};
|
|
|
|
|
|
|
|
|
|
struct stat stbuf;
|
|
|
|
|
|
|
|
|
|
strcpy(ra_text, xorriso->report_about_text);
|
|
|
|
|
|
|
|
|
|
weight_list= TSOB_FELD(int, (argc / 3) + 1);
|
|
|
|
@ -908,7 +922,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
|
|
|
|
|
|
|
|
|
|
if(xorriso->boot_image_cat_path[0])
|
|
|
|
|
with_cat_path= -1;
|
|
|
|
|
adr[0]= indev[0]= msc[0]= 0;
|
|
|
|
|
adr[0]= indev[0]= msc[0]= old_root[0]= 0;
|
|
|
|
|
for(i= 0; i<argc; i++) {
|
|
|
|
|
ret= Xorriso_genisofs_ignore(xorriso, whom, argv, &i, 1);
|
|
|
|
|
if(ret == 1)
|
|
|
|
@ -1022,6 +1036,33 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
goto problem_handler_1;
|
|
|
|
|
|
|
|
|
|
} else if(strcmp(argv[i], "-root") == 0) {
|
|
|
|
|
if(i+1>=argc)
|
|
|
|
|
goto not_enough_args;
|
|
|
|
|
i++;
|
|
|
|
|
/* Always absolute */
|
|
|
|
|
strcpy(eff_path, "/");
|
|
|
|
|
if(Sfile_str(eff_path, argv[i], argv[i][0] != '/') <= 0)
|
|
|
|
|
{ret= -1; goto ex;}
|
|
|
|
|
strcpy(xorriso->wdi, eff_path);
|
|
|
|
|
root_seen= 1;
|
|
|
|
|
|
|
|
|
|
} else if(strcmp(argv[i], "-old-root") == 0) {
|
|
|
|
|
if(i+1>=argc)
|
|
|
|
|
goto not_enough_args;
|
|
|
|
|
i++;
|
|
|
|
|
/* Always absolute */
|
|
|
|
|
strcpy(old_root, "/");
|
|
|
|
|
if(Sfile_str(old_root, argv[i], argv[i][0] != '/') <= 0)
|
|
|
|
|
{ret= -1; goto ex;}
|
|
|
|
|
|
|
|
|
|
} else if(strcmp(argv[i], "--old-root-no-md5")==0) {
|
|
|
|
|
old_root_md5= 0;
|
|
|
|
|
} else if(strcmp(argv[i], "--old-root-devno")==0) {
|
|
|
|
|
old_root_dev= 1;
|
|
|
|
|
} else if(strcmp(argv[i], "--old-root-no-ino")==0) {
|
|
|
|
|
old_root_ino= 0;
|
|
|
|
|
|
|
|
|
|
} else if(strcmp(argv[i], "--hardlinks")==0) {
|
|
|
|
|
Xorriso_option_hardlinks(xorriso, "on", 0);
|
|
|
|
|
} else if(strcmp(argv[i], "--acl")==0) {
|
|
|
|
@ -1136,6 +1177,28 @@ illegal_c:;
|
|
|
|
|
if(!was_other_option)
|
|
|
|
|
{ret= 1; goto ex;}
|
|
|
|
|
|
|
|
|
|
if(old_root[0]) {
|
|
|
|
|
Xorriso_option_md5(xorriso, old_root_md5 ? "on" : "off", 0);
|
|
|
|
|
Xorriso_option_disk_dev_ino(xorriso,
|
|
|
|
|
old_root_dev && old_root_ino ? "on" :
|
|
|
|
|
old_root_ino ? "ino_only" : "off", 0);
|
|
|
|
|
ret= Xorriso_iso_lstat(xorriso, old_root, &stbuf, 0);
|
|
|
|
|
if(ret >= 0) {
|
|
|
|
|
if(root_seen) {
|
|
|
|
|
ret= Xorriso_mkdir(xorriso, xorriso->wdi, 1 | 2);
|
|
|
|
|
if(ret < 0)
|
|
|
|
|
{ret= -(ret != -1); goto ex;}
|
|
|
|
|
} else {
|
|
|
|
|
ret= Xorriso_option_cdi(xorriso, "/", 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
goto ex;
|
|
|
|
|
}
|
|
|
|
|
ret= Xorriso_clone_under(xorriso, old_root, xorriso->wdi, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
goto ex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xorriso->padding= 300*1024;
|
|
|
|
|
|
|
|
|
|
for(i= 0; i<argc; i++) {
|
|
|
|
@ -1353,6 +1416,16 @@ not_enough_args:;
|
|
|
|
|
goto not_enough_args;
|
|
|
|
|
i++;
|
|
|
|
|
/* was already handled in first argument scan */;
|
|
|
|
|
} else if(strcmp(argv[i], "-root") == 0 ||
|
|
|
|
|
strcmp(argv[i], "-old-root") == 0) {
|
|
|
|
|
if(i+1>=argc)
|
|
|
|
|
goto not_enough_args;
|
|
|
|
|
i++;
|
|
|
|
|
/* was already handled in first argument scan */;
|
|
|
|
|
} else if(strcmp(argv[i], "--old-root-no-md5")==0 ||
|
|
|
|
|
strcmp(argv[i], "--old-root-devno")==0 ||
|
|
|
|
|
strcmp(argv[i], "--old-root-no-ino")==0) {
|
|
|
|
|
/* was already handled in first argument scan */;
|
|
|
|
|
} else if(strcmp(argv[i], "-dir-mode") == 0) {
|
|
|
|
|
if(i+1>=argc)
|
|
|
|
|
goto not_enough_args;
|
|
|
|
@ -1497,13 +1570,41 @@ is_pathspec_2:;
|
|
|
|
|
add_pt= pathspec;
|
|
|
|
|
} else
|
|
|
|
|
add_pt= argv[i];
|
|
|
|
|
mem_graft_points= xorriso->allow_graft_points;
|
|
|
|
|
xorriso->allow_graft_points= 1;
|
|
|
|
|
zero= 0;
|
|
|
|
|
ret= Xorriso_option_add(xorriso, 1, &add_pt, &zero, was_path<<1);
|
|
|
|
|
xorriso->allow_graft_points= mem_graft_points;
|
|
|
|
|
|
|
|
|
|
if(old_root[0]) {
|
|
|
|
|
/* Split pathspec */
|
|
|
|
|
ret= Fileliste__target_source_limit(pathspec, '=', &ept, 0);
|
|
|
|
|
if(ret > 0) {
|
|
|
|
|
*ept= 0;
|
|
|
|
|
iso_rr_pt= pathspec;
|
|
|
|
|
disk_pt= ept + 1;
|
|
|
|
|
} else {
|
|
|
|
|
iso_rr_pt= "/";
|
|
|
|
|
disk_pt= pathspec;
|
|
|
|
|
}
|
|
|
|
|
if(root_seen) {
|
|
|
|
|
strcpy(eff_path, iso_rr_pt);
|
|
|
|
|
iso_rr_pt= eff_path;
|
|
|
|
|
ret= Sfile_prepend_path(xorriso->wdi, iso_rr_pt, 0);
|
|
|
|
|
if(ret<=0) {
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, "Effective path gets much too long",
|
|
|
|
|
0, "FAILURE", 0);
|
|
|
|
|
goto problem_handler_2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* update_r */
|
|
|
|
|
ret= Xorriso_option_update(xorriso, disk_pt, iso_rr_pt, 1 | 8);
|
|
|
|
|
} else {
|
|
|
|
|
mem_graft_points= xorriso->allow_graft_points;
|
|
|
|
|
xorriso->allow_graft_points= 1;
|
|
|
|
|
zero= 0;
|
|
|
|
|
ret= Xorriso_option_add(xorriso, 1, &add_pt, &zero,
|
|
|
|
|
(was_path << 1) | (root_seen << 2));
|
|
|
|
|
xorriso->allow_graft_points= mem_graft_points;
|
|
|
|
|
}
|
|
|
|
|
if(ret<=0)
|
|
|
|
|
goto problem_handler_2;
|
|
|
|
|
|
|
|
|
|
was_path= 1;
|
|
|
|
|
|
|
|
|
|
/* Enforce odd mkisofs defaults on first pathspec */
|
|
|
|
@ -1731,7 +1832,7 @@ problem_handler_boot:;
|
|
|
|
|
|
|
|
|
|
ret= !was_failure;
|
|
|
|
|
ex:;
|
|
|
|
|
if(was_path && !do_print_size)
|
|
|
|
|
if(was_path && (!do_print_size) && !old_root[0])
|
|
|
|
|
Xorriso_pacifier_callback(xorriso, "files added", xorriso->pacifier_count,
|
|
|
|
|
xorriso->pacifier_total, "", 1);
|
|
|
|
|
if(do_print_size && xorriso->volset_change_pending == 1)
|
|
|
|
|