From 7081bf395ce1b0ed08d1e4ecdf722ceef7b28638 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 5 Jul 2008 18:23:46 +0000 Subject: [PATCH] New options -C and -M for -as mkisofs --- libisoburn/trunk/xorriso/xorriso.1 | 24 ++++--- libisoburn/trunk/xorriso/xorriso.c | 67 ++++++++++++++++++-- libisoburn/trunk/xorriso/xorriso.h | 3 + libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 4 files changed, 83 insertions(+), 13 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso.1 b/libisoburn/trunk/xorriso/xorriso.1 index 24f310ab..392b9b01 100644 --- a/libisoburn/trunk/xorriso/xorriso.1 +++ b/libisoburn/trunk/xorriso/xorriso.1 @@ -474,6 +474,9 @@ growing will finally end up. It is the responsibility of the user to ensure this final position and the presence of the older sessions. Else the overall ISO image will not be mountable or will produce read errors when accessing file content. +.br +During a run of blind growing, the input drive gets released before output +begins. The output drive gets released when writing is done. .TP \fB\-load\fR entity id Load a particular (possibly outdated) ISO image from a -dev or -indev which @@ -1746,24 +1749,21 @@ as ISO 9660 image producer and cdrecord as burn program. xorriso does not strive for their comprehensive emulation. Nevertheless it is ready to perform some of its core tasks under control of commands which in said programs trigger comparable actions. -The scope is for now only a single first data track to be written to blank or -overwriteable media. If possible the media will get closed afterwards. -Multi-session is yet only possible via xorriso's own commands. .TP \fB\-as\fR personality option [options] -- .br Performs its variable length option list as sparse emulation of the program -depicted by the personality word. This is only allowed if no image changes -are pending. The input drive is given up. +depicted by the personality word. .br Personality "\fBmkisofs\fR" accepts the options listed with: .br -as mkisofs -help -- .br -Among them: -R (always on), -J, -graft-points, -o, -path-list, -m, -print-size, --V, -v, -version, pathspecs as with xorriso -add. A lot of options are not -supported and lead to failure of the mkisofs emulation. Some are ignored, +Among them: -R (always on), -J, -o, -M, -C, -path-list, -m, -exclude-list, -f, +-print-size, -pad, -no-pad, -V, -v, -version, -graft-points, +pathspecs as with xorriso -add. A lot of options are not supported and lead +to failure of the mkisofs emulation. Some are ignored, but better do not rely on this tolerance. .br -graft-points is equivalent to -pathspecs on. Note that pathspecs without "=" @@ -1802,6 +1802,14 @@ It ignores most other options of cdrecord and cdrskin but refuses on -audio, -scanbus, -multi, -msinfo, --grow_overwriteable_iso, and on blanking modes unknown to xorriso. .br + +The scope is for now only a single first data track to be written to blank or +overwriteable media. If possible the media will get closed afterwards. + +.br +An eventually aquired input drive is given up. +This is only allowed if no image changes are pending. +.br dev= must be given as xorriso device address. Adresses like 0,0,0 or ATA:1,1,0 are not supported. .br diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index 6d1b1a09..7d3a01d3 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -7455,7 +7455,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, int ret, i, k, was_path= 0, was_other_option= 0, mem_graft_points; int do_print_size= 0, idx_offset= 0, fd, idx; char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL]; - char *ept, *add_pt, eff_path[SfileadrL]; + char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt; /* mkisofs 2.01 options which are not scheduled for implementation, yet */ static char ignored_arg0_options[][41]= { @@ -7479,12 +7479,15 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, " -graft-points Allow to use graft points for filenames", " -help Print option help", " -J, -joliet Generate Joliet directory information", -" -no-pad Do not pad output", " -o FILE, -output FILE Set output file name", " -m GLOBFILE, -exclude GLOBFILE", " Exclude file name", " -exclude-list FILE File with list of file names to exclude", " -pad Pad output by 300k (default)", +" -no-pad Do not pad output", +" -M FILE, -prev-session FILE Set path to previous session to merge", +" -C PARAMS, -cdrecord-params PARAMS", +" Magic paramters from cdrecord", " -path-list FILE File with list of pathnames to process", " -print-size Print estimated filesystem size and exit", " -quiet Run quietly", @@ -7497,13 +7500,16 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, strcpy(ra_text, xorriso->report_about_text); +#ifdef NIX + /* <<< MULTI : */ if(xorriso->in_drive_handle != NULL) { ret= Xorriso_option_dev(xorriso, "", 1); /* give up indev */ if(ret!=1) return(ret); } +#endif - adr[0]= 0; + adr[0]= indev[0]= 0; for(i= 0; iresult_line, @@ -7525,6 +7531,26 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, strcpy(adr, "stdio:"); if(Sfile_str(adr+strlen(adr), argv[i], 0)<=0) {ret= -1; goto ex;} + } else if(strcmp(argv[i], "-M")==0 || strcmp(argv[i], "-dev")==0 || + strcmp(argv[i], "-prev-session")==0) { + if(i+1>=argc) + goto not_enough_args; + i++; + indev[0]= 0; + + /* >>> MULTI : + check whether indev is a valid MMC drive. Else : */ + strcpy(indev, "stdio:"); + + if(Sfile_str(indev+strlen(indev), argv[i], 0)<=0) + {ret= -1; goto ex;} + } else if(strcmp(argv[i], "-C")==0 || + strcmp(argv[i], "-cdrecord-params")==0) { + if(i+1>=argc) + goto not_enough_args; + i++; + strncpy(msc, argv[i], sizeof(msc)-1); + msc[sizeof(msc)-1]= 0; } else if(strcmp(argv[i], "-help")==0) { Xorriso_option_report_about(xorriso, "NOTE", 0); for(i= 0; strcmp(helptext[i], "@End_of_helptexT@")!=0; i++) { @@ -7570,6 +7596,32 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, return(ret); } + if(msc[0]) { + cpt= strchr(msc, ','); + if(cpt==NULL) { +illegal_c:; + sprintf(xorriso->info_text, + "-as %s: unusable parameter with option -C: %s", + whom, Text_shellsafe(msc, sfe, 0)); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + {ret= 0; goto ex;} + } else if(cpt==msc || msc[1]==0) + goto illegal_c; + strncpy(sfe, msc, cpt-msc); + sfe[cpt-msc]= 0; + ret= Xorriso_option_load(xorriso, "sbsector", sfe, 0); + if(ret<=0) + return(ret); + ret= Xorriso_option_grow_blindly(xorriso, cpt+1, 0); + if(ret<=0) + return(ret); + } + if(indev[0]) { + ret= Xorriso_option_dev(xorriso, indev, 1); + if(ret<=0) + goto ex; + } + xorriso->padding= 300*1024; for(i= 0; i