Enabled multi-session with partition offset

This commit is contained in:
2010-09-10 17:13:00 +00:00
parent bc9e0ab92c
commit 2ad974f639
6 changed files with 104 additions and 87 deletions

View File

@ -213,6 +213,8 @@ int Xorriso_set_system_area(struct XorrisO *xorriso, struct burn_drive *drive,
unsigned char *ub;
ElToritoBootImage *bootimg;
IsoFile *bootimg_node;
uint32_t offst;
enum burn_disc_status state;
system_area_options= xorriso->system_area_options;
memset(buf, 0, 32768);
@ -308,7 +310,19 @@ do_set:;
0, "FAILURE", 1);
{ret= 0; goto ex;}
}
ret= isoburn_igopt_set_part_offset(sopts, xorriso->partition_offset,
offst= xorriso->partition_offset;
state= isoburn_disc_get_status(drive);
if(state == BURN_DISC_APPENDABLE) {
ret= isoburn_get_img_partition_offset(drive, &offst);
if(ret == 1) {
sprintf(xorriso->info_text,
"Preserving in ISO image: -boot_image any partition_offset=%lu",
(unsigned long) offst);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
} else
offst= xorriso->partition_offset;
}
ret= isoburn_igopt_set_part_offset(sopts, offst,
xorriso->partition_secs_per_head,
xorriso->partition_heads_per_cyl);
if(ret != ISO_SUCCESS) {
@ -532,17 +546,6 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
if(ret<=0)
return(0);
/* <<< TWINTREE: preliminary */
if(xorriso->partition_offset > 0) {
s= isoburn_disc_get_status(drive);
if(s != BURN_DISC_BLANK) {
sprintf(xorriso->info_text,
"Output drive not blank with non-zero partition offset");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
}
if(xorriso->out_drive_handle == xorriso->in_drive_handle) {
source_drive= drive;
} else {
@ -701,11 +704,6 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
((!!(xorriso->do_md5 & 8)) * isoburn_igopt_file_stability);
if(xorriso->no_emul_toc & 1)
ext|= isoburn_igopt_no_emul_toc;
/* <<< TWINTREE: preliminary */
if(xorriso->partition_offset > 0)
ext|= isoburn_igopt_no_emul_toc;
isoburn_igopt_set_extensions(sopts, ext);
isoburn_igopt_set_relaxed(sopts, relax);
isoburn_igopt_set_sort_files(sopts, 1);