diff --git a/libisoburn/trunk/xorriso/xorriso.1 b/libisoburn/trunk/xorriso/xorriso.1 index 5e05f7ee..87806514 100644 --- a/libisoburn/trunk/xorriso/xorriso.1 +++ b/libisoburn/trunk/xorriso/xorriso.1 @@ -144,11 +144,13 @@ There are two families of media in the MMC standard: .br \fBMulti-session\fR media are CD-R, CD-RW, DVD-R, DVD+R, DVD+R/DL, and unformatted DVD-RW. These media provide a table of content which -describes their existing sessions. +describes their existing sessions. See option \fB-toc\fR. .br \fBOverwriteable\fR media are DVD-RAM, DVD+RW, and formatted DVD-RW. They allow random write access but do not provide information about their -session history. +session history. If they contain one or more ISO 9660 sessions and if the +first session was written by modern xorriso, then a table of content can +be emulated. Else only a single overall session will be visible. .br DVD-RW media can be formatted by -format full. They can be made unformatted by -blank deformat. @@ -183,6 +185,10 @@ written with option -close on. If the drive is incapable of writing it will probably show any media as closed CD-ROM resp. DVD-ROM. .br Overwriteable media assume this state only in such read-only drives. +.br +\fBRead-only\fR drives may or may not show session histories of multi-session +media. Often only the first and the last session are visible. Sometimes +not even that. Option -rom_toc_scan might or might not help in such cases. .SS .B Creating, Growing, Modifying: .br @@ -431,6 +437,21 @@ apply. See above paragraph "Libburn drives". An empty address string "" gives up the current output drive without aquiring a new one. No writing is possible without an output drive. .TP +\fB\-rom_toc_scan\fR "on"|"off" +Read-only drives do not tell the actual media type but show any media as +ROM (e.g. as DVD-ROM). The session history of MMC multi-session media might +be truncated to first and last session or even be completely false. +The eventual emulated history of overwriteable media is not affected by this. +.br +To have in case of failure a chance of getting the session history and +especially the address of the last session, there is a scan for ISO 9660 +filesystem headers which might help but also might yield worse results +than the drive's table of content. At its end it can cause read attempts +to invalid addresses and thus ugly drive behavior. +.br +To be in effect, -rom_toc_scan has to be enabled by "on" before the -*dev +command which aquires drive and media. +.TP \fB\-ban_stdio_write\fR Allow for writing only the usage of MMC optical drives. Disallow to write the result into files of nearly arbitrary type. @@ -1311,14 +1332,20 @@ use -rollback to revoke the whole session. .TP \fB\-toc\fR .br -Show media specific table of content. This is the media -structure, not the ISO image directory tree. In case of -overwriteable media holding a valid ISO image, a single -session gets fabricated from the ISO image size info. +Show media specific table of content. This is the media session history, +not the ISO image directory tree. +.br +In case of overwriteable media holding a valid ISO image, a single session +gets fabricated from the ISO image size info. If the first session on the +overwriteable media was written by modern xorriso then a complete session +history can be emulated. .br A drive which is incapable of writing may show any media as CD-ROM or DVD-ROM with only one or two sessions on it. The last of these sessions is supposed to be the most recent real session then. +.br +Some read-only drives and media show no usable session history at all. +Eventually option -rom_toc_scan might help. .TP \fB\-devices\fR Show list of available MMC drives with the addresses of @@ -1933,8 +1960,9 @@ on media and if the expected changes are much smaller than the full backup. An update run will probably save no time but last longer than a full backup. .br With \fBmount\fR option \fB"sbsector="\fR it is possible to access the session -trees which represent the older backup versions. Multi-session media can tell -the sbsector by xorriso option -toc, as "data lba:". For other media one +trees which represent the older backup versions. Multi-session media and +overwriteable media iwritten by modern xorriso can tell +the sbsector by xorriso option -toc. For other media one may set before writing a suitable path for xorriso option -session_log where the sbsector number gets recorded as the second word in each line. .br diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index 5e7fef6a..418422f3 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -2695,6 +2695,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag) m->global_file_mode= 0444; m->do_overwrite= 2; m->do_reassure= 0; + m->toc_emulation_flag= 0; m->indev[0]= 0; m->in_drive_handle= NULL; m->in_volset_handle= NULL; @@ -4034,6 +4035,12 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) #endif /* Xorriso_with_readlinE */ + is_default= !(xorriso->toc_emulation_flag&1); + sprintf(line,"-rom_toc_scan %s\n", + xorriso->toc_emulation_flag&1 ? "on" : "off"); + if(!(is_default && no_defaults)) + Xorriso_status_result(xorriso,filter,fp,flag&2); + if(strcmp(xorriso->indev,xorriso->outdev)==0) { sprintf(line,"-dev %s\n", Text_shellsafe(xorriso->indev,sfe,0)); Xorriso_status_result(xorriso,filter,fp,flag&2); @@ -8977,6 +8984,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag) " growing to modifying.", " -outdev address", " Set output drive and switch from growing to modifying.", +" -rom_toc_scan \"on\"|\"off\"", +" Enable scanning for ISO sessions on read-only drives/media.", " -ban_stdio_write", " Allow for writing only the usage of optical drives.", " -blank \"fast\"|\"all\"|\"deformat\"|\"deformat_quickest\"", @@ -10365,6 +10374,22 @@ int Xorriso_option_rollback(struct XorrisO *xorriso, int flag) } +/* Option -rom_toc_scan */ +int Xorriso_option_rom_toc_scan(struct XorrisO *xorriso, char *mode, int flag) +{ + if(strcmp(mode, "off")==0) + xorriso->toc_emulation_flag= 0; + else if(strcmp(mode, "on")==0) + xorriso->toc_emulation_flag= 1; + else { + sprintf(xorriso->info_text, "-rom_toc_scan: unknown mode '%s'", mode); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + return(0); + } + return(1); +} + + /* Option -session_log */ int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag) { @@ -11149,6 +11174,10 @@ next_command:; if(end_ret!=2) {ret= 3; goto ex;} + } else if(strcmp(cmd,"rom_toc_scan")==0) { + (*idx)++; + Xorriso_option_rom_toc_scan(xorriso, arg1, 0); + } else if(strcmp(cmd,"session_log")==0) { (*idx)++; ret= Xorriso_option_session_log(xorriso, arg1, 0); diff --git a/libisoburn/trunk/xorriso/xorriso.h b/libisoburn/trunk/xorriso/xorriso.h index 34e8f16b..59b9ded8 100644 --- a/libisoburn/trunk/xorriso/xorriso.h +++ b/libisoburn/trunk/xorriso/xorriso.h @@ -421,6 +421,10 @@ int Xorriso_option_rmi(struct XorrisO *xorriso, int argc, char **argv, */ int Xorriso_option_rollback(struct XorrisO *xorriso, int flag); +/* Option -rom_toc_scan */ +int Xorriso_option_rom_toc_scan(struct XorrisO *xorriso, char *mode, + int flag); + /* Option -session_log */ int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag); diff --git a/libisoburn/trunk/xorriso/xorriso_eng.html b/libisoburn/trunk/xorriso/xorriso_eng.html index c4f94ce8..7e28ce9a 100644 --- a/libisoburn/trunk/xorriso/xorriso_eng.html +++ b/libisoburn/trunk/xorriso/xorriso_eng.html @@ -251,6 +251,13 @@ old ISO copies to match the new disk trees. On CD-R[W], DVD-R[W] and DVD+R older states can be retrieved by help of mount option "session=". So this constitutes true incremental backup. On overwriteable media only the newest state is accessible. + + +