New option tsize= with -as cdrecord

This commit is contained in:
Thomas Schmitt 2008-07-15 12:18:08 +00:00
parent af36e5e127
commit d382bdba17
5 changed files with 42 additions and 20 deletions

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Jul, 14, 2008" .TH XORRISO 1 "Jul, 15, 2008"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -1801,7 +1801,7 @@ Personality "\fBcdrecord\fR" accepts the options listed with:
.br .br
-as cdrecord -help -- -as cdrecord -help --
.br .br
Among them: -v, dev=, speed=, blank=, fs=, -eject, -atip, padsize=, Among them: -v, dev=, speed=, blank=, fs=, -eject, -atip, padsize=, tsize=,
-isosize, -multi, -msinfo, --grow_overwriteable_iso, write_start_address=, -isosize, -multi, -msinfo, --grow_overwriteable_iso, write_start_address=,
track source file path or "-" for standard input as track source. track source file path or "-" for standard input as track source.
.br .br
@ -2135,7 +2135,6 @@ first and only session to the output drive.
| gzip >image.iso.gz | gzip >image.iso.gz
.SS .SS
.B Perform multi-session runs as of cdrtools traditions .B Perform multi-session runs as of cdrtools traditions
This shall illustrate how xorriso can act in either role.
Between both processes there can be performed arbitrary transportation Between both processes there can be performed arbitrary transportation
or filtering. or filtering.
.br .br
@ -2151,11 +2150,15 @@ Follow-up sessions are written like this:
.br .br
\fB$\fR xorriso -as mkisofs -M /dev/sr0 -C $m prepared_for_iso/tree2 | \\ \fB$\fR xorriso -as mkisofs -M /dev/sr0 -C $m prepared_for_iso/tree2 | \\
.br .br
xorriso -as cdrecord -v dev=/dev/sr0 -multi -eject - xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject -
.br .br
Always eject the drive tray between sessions. The old sessions Always eject the drive tray between sessions. The old sessions
get read via stdio:/dev/sr0 and thus are prone to device driver get read via stdio:/dev/sr0 and thus are prone to device driver
peculiarities. peculiarities.
.br
This example works for multi-session media only.
Add cdrskin option --grow_overwriteable_iso to all -as cdrecord runs
in order to enable multi-session emulation on overwriteable media.
.SS .SS
.B Let xorriso work underneath growisofs .B Let xorriso work underneath growisofs
growisofs expects an ISO formatter program which understands options -o, -C, growisofs expects an ISO formatter program which understands options -o, -C,

View File

@ -7073,7 +7073,7 @@ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
int do_atip= 0, do_checkdrive= 0, do_eject= 0, do_scanbus= 0; int do_atip= 0, do_checkdrive= 0, do_eject= 0, do_scanbus= 0;
int do_toc= 0, do_verbous= 0, do_version= 0, do_help= 0, do_waiti= 0; int do_toc= 0, do_verbous= 0, do_version= 0, do_help= 0, do_waiti= 0;
int do_multi= 0, do_msinfo= 0, do_grow= 0, do_isosize= 0; int do_multi= 0, do_msinfo= 0, do_grow= 0, do_isosize= 0;
double write_start_address= -1.0; double write_start_address= -1.0, tsize= -1.0;
char track_source[SfileadrL], sfe[5*SfileadrL], dev_adr[SfileadrL], *cpt; char track_source[SfileadrL], sfe[5*SfileadrL], dev_adr[SfileadrL], *cpt;
char mem_report_about_text[80], *report_about= "SORRY", blank_mode[80]; char mem_report_about_text[80], *report_about= "SORRY", blank_mode[80];
char speed[80]; char speed[80];
@ -7091,8 +7091,6 @@ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
"direct_write_amount=", "msifile=", "direct_write_amount=", "msifile=",
"tsize=",
"" ""
}; };
static char ignored_full_options[][41]= { static char ignored_full_options[][41]= {
@ -7138,8 +7136,10 @@ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
"\t-atip\t\tretrieve media state, print \"Is *erasable\"", "\t-atip\t\tretrieve media state, print \"Is *erasable\"",
"\t-multi\t\tgenerate a TOC that allows multi session", "\t-multi\t\tgenerate a TOC that allows multi session",
"\t-waiti\t\twait until input is available before opening SCSI", "\t-waiti\t\twait until input is available before opening SCSI",
"\ttsize=#\t\tannounces exact size of source data",
"\tpadsize=#\tAmount of padding", "\tpadsize=#\tAmount of padding",
"\t-data\t\tSubsequent tracks are CD-ROM data mode 1 (default)", "\t-data\t\tSubsequent tracks are CD-ROM data mode 1 (default)",
"\t-isosize\tUse iso9660 file system size for next data track",
"\t-pad\t\tpadsize=30k", "\t-pad\t\tpadsize=30k",
"\t-nopad\t\tDo not pad", "\t-nopad\t\tDo not pad",
"\t--grow_overwriteable_iso\temulate multi-session on DVD+RW", "\t--grow_overwriteable_iso\temulate multi-session on DVD+RW",
@ -7324,6 +7324,18 @@ no_volunteer:;
speed[79]= 0; speed[79]= 0;
} else if(strcmp(argv[i], "-toc")==0) { } else if(strcmp(argv[i], "-toc")==0) {
do_toc= 1; do_toc= 1;
} else if(strncmp(argv[i], "-tsize=", 7)==0 ||
strncmp(argv[i], "tsize=", 6)==0) {
/* MULTI : tsize= */
cpt= strchr(argv[i], '=')+1;
tsize= Scanf_io_size(cpt, 1);
if(tsize > 1024.0*1024.0*1024.0*1024.0*1024.0) {
sprintf(xorriso->info_text, "-as %s: much too large: %s",whom, argv[i]);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
} else if(strcmp(argv[i], "-v")==0 || strcmp(argv[i],"-verbose")==0) { } else if(strcmp(argv[i], "-v")==0 || strcmp(argv[i],"-verbose")==0) {
do_verbous++; do_verbous++;
} else if(strcmp(argv[i], "-vv")==0) { } else if(strcmp(argv[i], "-vv")==0) {
@ -7337,11 +7349,8 @@ no_volunteer:;
} else if(strncmp(argv[i], "write_start_address=", 20)==0) { } else if(strncmp(argv[i], "write_start_address=", 20)==0) {
/* MULTI : allow write_start_address= */ /* MULTI : allow write_start_address= */
write_start_address= Scanf_io_size(argv[i]+20,0); write_start_address= Scanf_io_size(argv[i]+20,0);
/* ??? >>> MULTI : combine write_start_address=32 with --grow_overwriteable_iso */
/* ??? >>> MULTI : ??? how about cdrskin. shouldn't it combine too ? */
} else if(argv[i][0]=='-' && argv[i][1]!=0) { } else if(argv[i][0]=='-' && argv[i][1]!=0) {
sprintf(xorriso->info_text, "-as %s: Unknown option %s", sprintf(xorriso->info_text, "-as %s: Unknown option %s",
whom, Text_shellsafe(argv[i], sfe, 0)); whom, Text_shellsafe(argv[i], sfe, 0));
@ -7389,10 +7398,10 @@ no_volunteer:;
/* MULTI : /* MULTI :
if grow_overwriteable_iso : if grow_overwriteable_iso :
consider overwriteables with ISO as appendable */ consider overwriteables with ISO as appendable */
hflag= 2|32; hflag= 2|32;
if(!do_grow) if(!do_grow)
hflag|= 8; /* consider overwriteables as blank */ hflag|= 8; /* consider overwriteables as blank */
ret= Xorriso_option_dev(xorriso, dev_adr, hflag); ret= Xorriso_option_dev(xorriso, dev_adr, hflag);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
@ -7431,6 +7440,7 @@ no_volunteer:;
} }
/* MULTI : perform -msinfo */ /* MULTI : perform -msinfo */
if(do_msinfo) { if(do_msinfo) {
ret= Xorriso_msinfo(xorriso, &msc1, &msc2, 2 | !!do_grow); ret= Xorriso_msinfo(xorriso, &msc1, &msc2, 2 | !!do_grow);
if(ret<=0) if(ret<=0)
@ -7485,7 +7495,8 @@ no_volunteer:;
xorriso->do_close= !do_multi; xorriso->do_close= !do_multi;
ret= Xorriso_burn_track(xorriso, (off_t) write_start_address, ret= Xorriso_burn_track(xorriso, (off_t) write_start_address,
track_source, (!!do_grow)|((!!do_isosize)<<1)); track_source, (off_t) tsize,
(!!do_grow)|((!!do_isosize)<<1));
aq_ret= Xorriso_reaquire_outdev(xorriso, 2*(ret>0)); aq_ret= Xorriso_reaquire_outdev(xorriso, 2*(ret>0));
if(ret<=0 && ret<aq_ret) if(ret<=0 && ret<aq_ret)
goto ex; goto ex;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.07.15.063040" #define Xorriso_timestamP "2008.07.15.121754"

View File

@ -5942,11 +5942,12 @@ int Xorriso_atip(struct XorrisO *xorriso, int flag)
/* @param write_start_address is valid if >=0 /* @param write_start_address is valid if >=0
@param tsize is valid if >0
@param flag bit0= grow_overwriteable_iso @param flag bit0= grow_overwriteable_iso
bit1= do_isosize bit1= do_isosize
*/ */
int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address, int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
char *track_source, int flag) char *track_source, off_t tsize, int flag)
{ {
int ret, fd, unpredicted_size, profile_number, is_cd= 0, dummy, nwa= -1; int ret, fd, unpredicted_size, profile_number, is_cd= 0, dummy, nwa= -1;
int isosize= -1, i, full_size, do_isosize; int isosize= -1, i, full_size, do_isosize;
@ -5976,9 +5977,8 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
session= burn_session_create(); session= burn_session_create();
ret= burn_disc_add_session(disc,session,BURN_POS_END); ret= burn_disc_add_session(disc,session,BURN_POS_END);
if(ret==0) { if(ret==0) {
sprintf(xorriso->info_text, "Cannot add session object to disc object.");
/* >>> */; Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
goto ex; goto ex;
} }
track= burn_track_create(); track= burn_track_create();
@ -6069,7 +6069,13 @@ int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
if(isoburn_needs_emulation(drive)) if(isoburn_needs_emulation(drive))
burn_write_opts_set_multi(burn_options, 0); burn_write_opts_set_multi(burn_options, 0);
/* >>> MULTI : if -isosize : /* MULTI : tsize */
if(tsize > 0) {
fixed_size= tsize;
burn_track_set_size(track, fixed_size);
}
/* MULTI : if -isosize :
*/ */
if(do_isosize) { if(do_isosize) {
ret= burn_fifo_peek_data(xorriso->pacifier_fifo, head_buffer, 64*1024, 0); ret= burn_fifo_peek_data(xorriso->pacifier_fifo, head_buffer, 64*1024, 0);

View File

@ -189,10 +189,12 @@ int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf,
int Xorriso_atip(struct XorrisO *xorriso, int flag); int Xorriso_atip(struct XorrisO *xorriso, int flag);
/* @param write_start_address is valid if >=0 /* @param write_start_address is valid if >=0
@param tsize is valid if >0
@param flag bit0= grow_overwriteable_iso @param flag bit0= grow_overwriteable_iso
bit1= do_isosize
*/ */
int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address, int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address,
char *track_source, int flag); char *track_source, off_t tsize, int flag);
/* @param flag bit1= outdev rather than indev /* @param flag bit1= outdev rather than indev
@return <=0 = failure , 1= ok , 2= ok, is CD profile @return <=0 = failure , 1= ok , 2= ok, is CD profile