Commit 692a6753 authored by Thomas Schmitt's avatar Thomas Schmitt

New option -displacement

parent 668e5876
......@@ -2,11 +2,13 @@ SVN trunk (to become libisoburn-0.6.6.pl00.tar.gz)
===============================================================================
libisoburn novelties:
* New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label()
* New API calls isoburn_ropt_set_displacement(), isoburn_ropt_get_displacement()
xorriso novelties:
* Bug fix: -as mkisofs -print-size printed the size but also produced ISO image
* Build problem fix on Linux 2.4 in GNU xorriso libjte/checksum.c
* New -as mkisofs option -joliet-long
* New bootspec sparc_label=, new -as mkisofs options -sparc-boot , -sparc-label
* New option -displacement
libisoburn-0.6.4.pl00.tar.gz Tue Oct 26 2010
===============================================================================
......
......@@ -153,6 +153,7 @@ Xorriso_option_devices;
Xorriso_option_dialog;
Xorriso_option_disk_dev_ino;
Xorriso_option_disk_pattern;
Xorriso_option_displacement;
Xorriso_option_drive_class;
Xorriso_option_dummy;
Xorriso_option_dvd_obs;
......
......@@ -169,6 +169,8 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->toc_emulation_flag= 0;
m->image_start_mode= 0;
m->image_start_value[0]= 0;
m->displacement= 0;
m->displacement_sign= 0;
m->drives_exclusive= 1;
m->do_calm_drive= 1;
m->indev[0]= 0;
......
......@@ -379,6 +379,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
isoburn_ropt_set_default_perms(ropts, (uid_t) 0, (gid_t) 0, (mode_t) 0555);
isoburn_ropt_set_input_charset(ropts, xorriso->in_charset);
isoburn_ropt_set_auto_incharset(ropts, !!(xorriso->do_aaip & 512));
isoburn_ropt_set_displacement(ropts, xorriso->displacement,
xorriso->displacement_sign);
Xorriso_set_image_severities(xorriso, 1); /* No DEBUG messages */
Xorriso_pacifier_reset(xorriso, 0);
......
......@@ -199,6 +199,37 @@ int Xorriso_option_disk_pattern(struct XorrisO *xorriso, char *mode, int flag)
}
/* Option -displacement [-]offset */
int Xorriso_option_displacement(struct XorrisO *xorriso, char *value, int flag)
{
double num;
int displacement_sign= 1, l;
char *cpt;
cpt= value;
if(value[0] == '-') {
displacement_sign= -1;
cpt++;
} else if(value[0] == '+')
cpt++;
num= Scanf_io_size(cpt, 0);
l= strlen(cpt);
if(cpt[l - 1] < '0' || cpt[l - 1] > '9')
num/= 2048.0;
if(num < 0.0 || num > 4294967295.0) {
sprintf(xorriso->info_text,
"-displacement: too large or too small: '%s'", value);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(num == 0)
displacement_sign= 0;
xorriso->displacement= num;
xorriso->displacement_sign= displacement_sign;
return(1);
}
/* Option -drive_class */
int Xorriso_option_drive_class(struct XorrisO *xorriso,
char *d_class, char *pattern, int flag)
......@@ -1315,6 +1346,10 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -load \"session\"|\"track\"|\"lba\"|\"sbsector\"|\"volid\"|\"auto\" id",
" Load a particular (outdated) ISO image from a -dev or",
" -indev which hosts more than one session.",
" -displacement [-]lba",
" When loading ISO tree or reading data files compensate a",
" displacement versus the start address for which the image",
" was prepared.",
" -rom_toc_scan \"on\"|\"force\"|\"off\"[:\"emul_on\"|\"emul_off\"]",
" Enable scanning for ISO sessions on read-only drives/media",
" resp. on overwriteable media with emulated TOC.",
......
......@@ -459,7 +459,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"backslash_codes","blank","biblio_file",
"calm_drive","cd","cdi","cdx","charset","close",
"commit_eject","compliance","copyright_file",
"dev","dialog","disk_dev_ino","disk_pattern","dummy","dvd_obs","eject",
"dev","dialog","disk_dev_ino","disk_pattern","displacement",
"dummy","dvd_obs","eject",
"iso_rr_pattern","follow","format","fs","gid","grow_blindly","hardlinks",
"history","indev","in_charset","joliet",
"list_delimiter","list_profiles","local_charset",
......@@ -817,6 +818,10 @@ next_command:;
(*idx)++;
ret= Xorriso_option_disk_dev_ino(xorriso, arg1, 0);
} else if(strcmp(cmd,"displacement")==0) {
(*idx)++;
ret= Xorriso_option_displacement(xorriso, arg1, 0);
} else if(strcmp(cmd,"disk_pattern")==0) {
(*idx)++;
ret= Xorriso_option_disk_pattern(xorriso, arg1, 0);
......
......@@ -1690,6 +1690,13 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso, filter, fp, flag & 2);
is_default= (xorriso->displacement == 0);
sprintf(line, "-displacement %s%lu\n",
xorriso->displacement_sign < 0 ? "-" : "",
(unsigned long) xorriso->displacement);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso, filter, fp, flag & 2);
adr_mode= xorriso->image_start_mode & 0xffff;
if(adr_mode>=0 && adr_mode<=max_load_mode) {
is_default= (adr_mode==0);
......
......@@ -641,6 +641,22 @@ until the next -dev or -indev. After the image has been loaded once, the
setting is valid for -rollback until next -dev or -indev, where it
will be reset to "auto".
.TP
\fB\-displacement\fR [-]lba
Compensate an eventual displacement of the image versus the start address
for which the image was prepared. This affects only loading of ISO images
and reading of their files.
Examples:
.br
If a track of a CD starts at block 123456 and gets copied to a disk file
where it begins at block 0, then this copy can be loaded with
-displacement -123456.
.br
If an ISO image was written onto a partition with offset of 640000 blocks of
512 bytes, then it can be loaded from the base device by -displacement 160000.
.br
In both cases, the ISO sessions should be self contained, i.e. not add-on
sessions to an ISO image outside their track resp. partition.
.TP
\fB\-drive_class\fR "harmless"|"banned"|"caution"|"clear_list" disk_pattern
Add a drive path pattern to one of the safety lists or make those lists empty.
There are three lists defined which get tested in the following sequence:
......@@ -3747,8 +3763,8 @@ line by a channel indicator:
.br
Next is a decimal number of which only bit 0 has a meaning for now.
0 means no newline at end of payload, 1 means that the newline character at
the end of the output line belongs to the payload. After another colon follows
the payload text.
the end of the output line belongs to the payload. After another colon and
a blank follows the payload text.
.br
Example:
.br
......
......@@ -765,6 +765,10 @@ int Xorriso_option_disk_dev_ino(struct XorrisO *xorriso, char *mode, int flag);
/* Option -disk_pattern "on"|"ls"|"off" */
int Xorriso_option_disk_pattern(struct XorrisO *xorriso, char *mode, int flag);
/* Option -displacement [-]offset */
int Xorriso_option_displacement(struct XorrisO *xorriso, char *value,
int flag);
/* Option -drive_class */
int Xorriso_option_drive_class(struct XorrisO *xorriso,
char *d_class, char *pattern, int flag);
......
This diff is collapsed.
......@@ -837,6 +837,24 @@ until the next -dev or -indev. After the image has been loaded once, the
setting is valid for -rollback until next -dev or -indev, where it
will be reset to "auto".
@c man .TP
@item -displacement [-]lba
@kindex -displacment compensate altered image start address
@cindex Session, altered start address, -displacement
Compensate an eventual displacement of the image versus the start address
for which the image was prepared. This affects only loading of ISO images
and reading of their files.
Examples:
@*
If a track of a CD starts at block 123456 and gets copied to a disk file
where it begins at block 0, then this copy can be loaded with
-displacement -123456.
@*
If an ISO image was written onto a partition with offset of 640000 blocks of
512 bytes, then it can be loaded from the base device by -displacement 160000.
@*
In both cases, the ISO sessions should be self contained, i.e. not add-on
sessions to an ISO image outside their track resp. partition.
@c man .TP
@item -drive_class "harmless"|"banned"|"caution"|"clear_list" disk_pattern
@kindex -drive_class controls drive accessability
@cindex Drive, accessability, -drive_class
......@@ -4460,8 +4478,8 @@ line by a channel indicator:
@*
Next is a decimal number of which only bit 0 has a meaning for now.
0 means no newline at end of payload, 1 means that the newline character at
the end of the output line belongs to the payload. After another colon follows
the payload text.
the end of the output line belongs to the payload. After another colon and
a blank follows the payload text.
@*
Example:
@*
......
......@@ -231,6 +231,9 @@ struct XorrisO { /* the global context of xorriso */
*/
char image_start_value[81]; /* value according image_start_mode */
uint32_t displacement;
int displacement_sign;
int drives_exclusive; /* burn_preset_device_open() param exclusive */
int do_calm_drive; /* bit0= calm down drive after aquiring it */
......
#define Xorriso_timestamP "2010.11.30.093929"
#define Xorriso_timestamP "2010.11.30.094310"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment