New TOC layout with volume id and sbsector=, new option -rom_toc_scan

This commit is contained in:
Thomas Schmitt 2008-05-08 14:19:09 +00:00
parent 7f1b8b07a6
commit 0e1f89d7c3
7 changed files with 94 additions and 15 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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.
<!--
Older states can be retrieved by help of mount option "session=" from CD-R[W],
by help of "sbsector=" from other media.
So this constitutes true incremental backup.
-->
</DT>
<DD>$<KBD>&nbsp;xorriso -dev /dev/sr0 \</KBD></DD>
<DD><KBD>&nbsp;&nbsp; -update_r /home/thomas/open_source_projects /open_source_projects \</KBD></DD>

View File

@ -112,6 +112,10 @@ struct XorrisO { /* the global context of xorriso */
/* >>> put libburn/isoburn aspects here */
int toc_emulation_flag; /* bit0= bit3 for isoburn_drive_aquire()
scan -ROM profiles for ISO sessions
*/
char indev[SfileadrL];
void *in_drive_handle; /* interpreted only by xorrisoburn.c */
void *in_volset_handle; /* interpreted only by xorrisoburn.c */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.05.08.141054"
#define Xorriso_timestamP "2008.05.08.141920"

View File

@ -499,7 +499,7 @@ int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag)
*/
int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
{
int ret, hret, not_writeable= 0, has_what;
int ret, hret, not_writeable= 0, has_what, aquire_flag;
uint32_t size;
struct burn_drive_info *dinfo= NULL, *out_dinfo, *in_dinfo;
struct burn_drive *drive, *out_drive, *in_drive;
@ -550,7 +550,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
}
if(dinfo==NULL) {
ret= isoburn_drive_aquire(&dinfo, libburn_adr, 1|((flag&(8|4))>>1));
aquire_flag= 1 | ((flag&(8|4))>>1) | ((xorriso->toc_emulation_flag&1)<<3);
ret= isoburn_drive_aquire(&dinfo, libburn_adr, aquire_flag);
Xorriso_process_msg_queues(xorriso,0);
if(ret<=0) {
sprintf(xorriso->info_text,"Cannot aquire drive '%s'", adr);
@ -2336,7 +2337,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
#ifdef Xorriso_new_toc_formaT
sprintf(respt, "TOC layout : %3s , %9s , %10s , %s\n",
"Idx", "Start LBA", "Size", "Volume Id");
"Idx", "sbsector=", "Size", "Volume Id");
if(!(flag&1))
Xorriso_result(xorriso,0);
#endif
@ -2359,7 +2360,10 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
#ifdef Xorriso_new_toc_formaT
ret= isoburn_read_iso_head(drive, 0, &image_blocks, volume_id, 1);
if(flag&1)
ret= 0;
else
ret= isoburn_read_iso_head(drive, 0, &image_blocks, volume_id, 1);
if(ret>0) {
sprintf(respt, "ISO session : %3d , %9d , %9ds , %s\n",
1, 0, image_blocks, volume_id);
@ -2374,7 +2378,6 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
sprintf(respt+strlen(respt), "track %2d %s lba: %8d\n", 1, "data ", 0);
if(!(flag&1))
Xorriso_result(xorriso,0);
last_track_start= lba;
sprintf(respt, "Media content: session %2d ", 1);
sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa);
@ -2382,6 +2385,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if(!(flag&1))
Xorriso_result(xorriso,0);
last_track_start= lba;
num_payload= num_data= last_track_size= nwa;
num_sessions= 1;
} else {
@ -2445,7 +2449,10 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
#ifdef Xorriso_new_toc_formaT
ret= isoburn_read_iso_head(drive, lba, &image_blocks, volume_id, 1);
if(flag&1)
ret= 0;
else
ret= isoburn_read_iso_head(drive, lba, &image_blocks, volume_id, 1);
if(ret>0 && track_no==num_tracks-1) {
sprintf(respt, "ISO session : %3d , %9d , %9ds , %s\n",
session_no+1, lba, image_blocks , volume_id);