New option -early_drive_test

This commit is contained in:
2011-03-21 09:37:02 +00:00
parent 37789c3f71
commit 393ad85438
13 changed files with 170 additions and 65 deletions

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2010 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -225,6 +225,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (4 | 32)))
aquire_flag|= 64;
burn_preset_device_open(xorriso->drives_exclusive, 0, 0);
burn_allow_drive_role_4(1 | (xorriso->early_stdio_test & 6));
ret= isoburn_drive_aquire(&dinfo, libburn_adr, aquire_flag);
burn_preset_device_open(1, 0, 0);
Xorriso_process_msg_queues(xorriso,0);
@ -832,14 +833,18 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if(profile_no == 0x0002 && s == BURN_DISC_EMPTY)
profile_no= 0;
sprintf(respt, "Media current: ");
drive_role= burn_drive_get_drive_role(drive);
if (profile_no > 0 && ret > 0) {
if (profile_name[0])
sprintf(respt+strlen(respt), "%s", profile_name);
else
sprintf(respt+strlen(respt), "%4.4Xh", profile_no);
drive_role= burn_drive_get_drive_role(drive);
if(drive_role==2)
sprintf(respt+strlen(respt), ", overwriteable");
else if(drive_role == 4)
sprintf(respt+strlen(respt), ", random read-only");
else if(drive_role == 5)
sprintf(respt+strlen(respt), ", random write-only");
else if(drive_role==0 || drive_role==3)
sprintf(respt+strlen(respt), ", sequential");
strcat(respt, "\n");
@ -898,15 +903,21 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if (disc==NULL) {
Xorriso_process_msg_queues(xorriso,0);
ret= isoburn_get_min_start_byte(drive, &start_byte, 0);
nwa= start_byte / 2048;
if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0);
if(flag&1)
if(drive_role == 5 && s == BURN_DISC_APPENDABLE) {
ret= burn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa);
if(ret == 1)
num_data= nwa;
} else {
ret= isoburn_get_min_start_byte(drive, &start_byte, 0);
nwa= start_byte / 2048;
if(ret<=0) {
Xorriso_process_msg_queues(xorriso,0);
if(flag&1)
{ret= 0; goto ex;}
sprintf(xorriso->info_text, "Cannot obtain Table Of Content");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
sprintf(xorriso->info_text, "Cannot obtain Table Of Content");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
}
}
/* fabricate TOC */
@ -921,13 +932,13 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
1, 0, image_blocks, volume_id);
nwa= image_blocks;
} else {
nwa= 0;
nwa= num_data;
ret= burn_disc_get_formats(drive, &status, &size, &dummy,
&num_formats);
if(ret>0 && status==BURN_FORMAT_IS_FORMATTED)
nwa= size/2048;
sprintf(respt, "%13s: %3d , %9d , %9ds , \n",
typetext, 1, 0, nwa);
typetext, 1, num_data, nwa);
}
if(!(flag&1))
Xorriso_toc_line(xorriso, flag & 8);
@ -1023,8 +1034,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
{ret= 1; goto ex;}
num_wasted= lba - num_payload;
num_nondata= lba - num_data;
Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1);
Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1);
sprintf(respt, "Media summary: %d session%s, %d data blocks, %s data",
num_sessions, (num_sessions==1 ? "" : "s"), num_data, mem_text);
num_free= isoburn_disc_available_space(drive, NULL);
@ -1293,6 +1304,12 @@ int Xorriso_atip(struct XorrisO *xorriso, int flag)
else if(ret==3)
sprintf(respt+strlen(respt), "%s\n",
"Emulated (stdio-drive, sequential write-only)");
else if(ret == 4)
sprintf(respt+strlen(respt), "%s\n",
"Emulated (stdio-drive, 2k random read-only)");
else if(ret == 5)
sprintf(respt+strlen(respt), "%s\n",
"Emulated (stdio-drive, 2k random write-only)");
else if(ret!=1)
sprintf(respt+strlen(respt), "%s\n","Emulated (stdio-drive)");
else