Provide better support for overwriteable media
This commit is contained in:
@ -430,17 +430,19 @@ ecma119_target_new(struct iso_volset *volset,
|
||||
|
||||
t->total_size = (t->curblock - t->ms_block) * t->block_size;
|
||||
|
||||
if (opts->dvd_plus_rw) {
|
||||
if (opts->overwrite) {
|
||||
|
||||
/*
|
||||
* Get a copy of the volume descriptors to be written in a DVD+RW
|
||||
* disc
|
||||
*/
|
||||
uint8_t *buf;
|
||||
opts->vol_desc_count = 2 + (t->eltorito ? 1 : 0) +
|
||||
(t->joliet ? 1 : 0);
|
||||
opts->vol_desc = calloc(opts->vol_desc_count, t->block_size);
|
||||
buf = opts->vol_desc;
|
||||
|
||||
/* set the 32 block buffer to 0 */
|
||||
memset(opts->overwrite, 0, 32 * t->block_size);
|
||||
|
||||
/* skip the first 16 blocks (system area) */
|
||||
buf = opts->overwrite + 16 * t->block_size;
|
||||
|
||||
/*
|
||||
* In the PVM to be written in the 16th sector of the disc, we
|
||||
|
@ -277,26 +277,12 @@ struct ecma119_source_opts {
|
||||
* image, used to read file contents.
|
||||
* Otherwise it can be NULL.
|
||||
*/
|
||||
unsigned int dvd_plus_rw:1;
|
||||
uint8_t *overwrite;
|
||||
/**<
|
||||
* When 1, vol_desc and vol_desc_count will be filled propertly
|
||||
* with information useful for "growing" a DVD+RW.
|
||||
*/
|
||||
uint8_t *vol_desc;
|
||||
/**<
|
||||
* If dvd_plus_rw is set to one, this will be filled with a
|
||||
* pointer to a memory region containing a copy of the
|
||||
* volume descriptors of the image, including the volume
|
||||
* descriptor set terminator.
|
||||
* A suitable program can write the contents of this memory
|
||||
* region from sector 16 of a DVD+RW to "grow" its image.
|
||||
* The size of this region will be vol_desc_count * 2048 and
|
||||
* should be freed by user when no more needed.
|
||||
*/
|
||||
int vol_desc_count;
|
||||
/**<
|
||||
* If dvd_plus_rw is set to one, this will be filled with the
|
||||
* number of volume descriptors written to vol_desc.
|
||||
* When not NULL, it should point to a buffer of at least
|
||||
* 64KiB, where libisofs will write the contents that should
|
||||
* be written at the beginning of a overwriteable media, to
|
||||
* grow the image.
|
||||
*/
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user