2007-10-14 12:20:56 +00:00
|
|
|
|
|
|
|
/* Command line oriented batch and dialog tool which creates, loads,
|
|
|
|
manipulates and burns ISO 9660 filesystem images.
|
|
|
|
|
2011-01-04 19:30:49 +00:00
|
|
|
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2010-01-25 15:05:43 +00:00
|
|
|
Provided under GPL version 2 or later.
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2007-12-08 17:52:32 +00:00
|
|
|
This file contains inner declarations of xorriso.
|
|
|
|
The public interface is in xorriso.h
|
2007-10-14 12:20:56 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* For now, #ifdef Xorriso_is_xorriso_selF has no meaning.
|
|
|
|
But it is already now to be set only by the xorriso.c module.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Xorriso_private_includeD
|
|
|
|
#define Xorriso_private_includeD yes
|
|
|
|
|
2010-04-26 12:11:59 +00:00
|
|
|
|
2010-09-05 11:37:45 +00:00
|
|
|
/* for uint32_t */
|
2011-01-18 15:47:18 +00:00
|
|
|
#ifdef HAVE_STDINT_H
|
2010-09-05 11:37:45 +00:00
|
|
|
#include <stdint.h>
|
2011-01-18 15:47:18 +00:00
|
|
|
#else
|
|
|
|
#ifdef HAVE_INTTYPES_H
|
|
|
|
#include <inttypes.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
2010-09-05 11:37:45 +00:00
|
|
|
|
|
|
|
|
2008-02-14 17:57:34 +00:00
|
|
|
/** The source code release timestamp */
|
|
|
|
#include "xorriso_timestamp.h"
|
|
|
|
#ifndef Xorriso_timestamP
|
|
|
|
#define Xorriso_timestamP "-none-given-"
|
|
|
|
#endif
|
|
|
|
|
2008-07-10 14:44:59 +00:00
|
|
|
/** The binary build timestamp is to be set externally by the compiler
|
|
|
|
or by a macro definition in xorriso_buildstamp.h.
|
|
|
|
*/
|
|
|
|
#include "xorriso_buildstamp.h"
|
2008-02-14 17:57:34 +00:00
|
|
|
#ifndef Xorriso_build_timestamP
|
|
|
|
#define Xorriso_build_timestamP "-none-given-"
|
|
|
|
#endif
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2010-05-15 18:48:10 +00:00
|
|
|
#include "sfile.h"
|
|
|
|
#include "misc_funct.h"
|
2007-10-14 12:20:56 +00:00
|
|
|
|
|
|
|
|
2008-05-26 18:11:51 +00:00
|
|
|
struct ExclusionS; /* List of -not_* conditions */
|
|
|
|
struct PermiteM; /* Stack of temporarily altered access permissions */
|
2008-08-09 16:14:16 +00:00
|
|
|
struct CheckmediajoB; /* Parameters for Xorriso_check_media() */
|
2008-08-11 20:17:09 +00:00
|
|
|
struct SectorbitmaP; /* Distiniction between valid and invalid sectors */
|
2010-05-15 18:48:10 +00:00
|
|
|
struct FindjoB; /* Program and status of a find run */
|
2008-05-02 20:50:40 +00:00
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
|
|
|
|
/* maximum number of history lines to be reported with -status:long_history */
|
|
|
|
#define Xorriso_status_history_maX 100
|
|
|
|
|
|
|
|
|
|
|
|
/** The list of startup file names */
|
|
|
|
#define Xorriso_rc_nuM 4
|
|
|
|
|
|
|
|
|
2008-08-27 12:13:07 +00:00
|
|
|
/* Default setting for the size limit of single data files:
|
2008-09-16 18:52:58 +00:00
|
|
|
100 extents with 4 GB - 2 kB each = 400 GB - 200 kB
|
|
|
|
*/
|
2008-08-27 12:13:07 +00:00
|
|
|
#define Xorriso_default_file_size_limiT \
|
2008-09-16 18:52:58 +00:00
|
|
|
(((off_t) 400) * ((off_t) 1024*1024*1024) - (off_t) 204800)
|
2008-08-27 12:13:07 +00:00
|
|
|
|
|
|
|
|
2010-11-05 14:46:34 +00:00
|
|
|
/* Maximum number of appended partitions. Effectively usable number depends
|
|
|
|
on system area type.
|
|
|
|
*/
|
|
|
|
#define Xorriso_max_appended_partitionS 8
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Maximum length of a disc label text plus 1.
|
|
|
|
*/
|
|
|
|
#define Xorriso_disc_label_sizE 129
|
|
|
|
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
struct XorrisO { /* the global context of xorriso */
|
|
|
|
|
2007-10-18 18:57:19 +00:00
|
|
|
int libs_are_started;
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
/* source */
|
|
|
|
char progname[SfileadrL];
|
|
|
|
char initial_wdx[SfileadrL];
|
|
|
|
int no_rc;
|
|
|
|
|
2008-07-08 10:26:00 +00:00
|
|
|
/* Command line argument emulations:
|
|
|
|
0=xorriso mode
|
|
|
|
1=mkisofs mode
|
2008-07-10 16:27:35 +00:00
|
|
|
2=cdrecord mode
|
2008-07-07 10:29:38 +00:00
|
|
|
*/
|
2008-07-08 10:26:00 +00:00
|
|
|
int argument_emulation;
|
2008-07-07 10:29:38 +00:00
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
/** List of startupfiles */
|
|
|
|
char rc_filenames[Xorriso_rc_nuM][SfileadrL];
|
|
|
|
int rc_filename_count;
|
|
|
|
|
2010-06-25 17:59:01 +00:00
|
|
|
/* Whether .mkisofsrc has already been read */
|
|
|
|
int mkisofsrc_done;
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
char wdi[SfileadrL];
|
|
|
|
char wdx[SfileadrL];
|
|
|
|
int did_something_useful;
|
|
|
|
|
2008-01-20 20:03:48 +00:00
|
|
|
int add_plainly;
|
2008-03-29 16:44:39 +00:00
|
|
|
off_t split_size;
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2008-09-05 09:54:38 +00:00
|
|
|
char list_delimiter[81];
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
/* >>> put libisofs aspects here <<< */
|
|
|
|
|
2009-05-09 20:17:35 +00:00
|
|
|
int ino_behavior; /* bit0= at image load time:
|
|
|
|
Do not load PX inode numbers but generate new
|
|
|
|
unique ones for all loaded IsoNode.
|
|
|
|
bit1= at image generation time:
|
|
|
|
Do not consolidate suitable nodes to hardlinks.
|
2009-05-26 14:00:54 +00:00
|
|
|
bit2= at restore-to-disk time:
|
|
|
|
Do not consolidate suitable nodes to hardlinks.
|
2009-06-15 12:15:12 +00:00
|
|
|
bit3= with update:
|
|
|
|
Do not try to detect hardlink splits and joinings.
|
2009-06-27 11:23:59 +00:00
|
|
|
bit4= with extract:
|
2009-07-25 18:18:05 +00:00
|
|
|
Do not create or use hln arrays if sort_lba_on
|
2009-05-09 20:17:35 +00:00
|
|
|
*/
|
|
|
|
|
2010-12-25 07:15:36 +00:00
|
|
|
int iso_level;
|
2007-10-14 12:20:56 +00:00
|
|
|
int do_joliet;
|
2010-12-23 19:01:42 +00:00
|
|
|
int do_iso1999;
|
2009-01-21 20:45:22 +00:00
|
|
|
|
2009-04-03 17:20:33 +00:00
|
|
|
int do_aaip; /* bit0= ACL in
|
|
|
|
bit1= ACL out
|
|
|
|
bit2= EA in
|
|
|
|
bit3= EA out
|
|
|
|
bit4= record dev,inode per node, isofs_st_out in root
|
|
|
|
bit5= check dev,inode,isofs_st_in
|
|
|
|
bit6= omit content check if bit5 check is conclusive
|
2009-03-20 19:33:51 +00:00
|
|
|
bit7= omit dev check with bit5
|
|
|
|
bit8= store output charset in xattr "isofs.cs"
|
|
|
|
bit9= allow to set input charset from xattr "isofs.cs"
|
2009-02-19 18:37:28 +00:00
|
|
|
*/
|
2009-01-21 20:45:22 +00:00
|
|
|
|
2009-08-10 19:37:47 +00:00
|
|
|
int do_md5; /* bit0= read MD5 array
|
|
|
|
bit1= write session MD5
|
2009-08-15 17:34:00 +00:00
|
|
|
bit2= write MD5 for each data file
|
2009-08-19 18:07:44 +00:00
|
|
|
bit3= make file content stability check by double reading
|
2009-08-22 18:41:45 +00:00
|
|
|
bit4= use recorded MD5 as proxy of ISO file
|
2009-08-10 19:37:47 +00:00
|
|
|
*/
|
2009-09-17 14:47:43 +00:00
|
|
|
|
2010-05-23 07:27:09 +00:00
|
|
|
int no_emul_toc; /* bit0= On overwriteables:
|
|
|
|
write first session to LBA 0 rather than 32.
|
|
|
|
*/
|
|
|
|
|
2011-01-26 13:31:05 +00:00
|
|
|
int do_old_empty; /* See -compliance old_empty
|
|
|
|
own data content: range [0,31]. The new way is to have
|
|
|
|
a dedicated block to which all such files will point.
|
|
|
|
*/
|
|
|
|
|
2009-08-31 21:09:16 +00:00
|
|
|
char scdbackup_tag_name[81];
|
|
|
|
char scdbackup_tag_time[19];
|
2009-09-17 14:47:43 +00:00
|
|
|
char scdbackup_tag_written[512];
|
|
|
|
char scdbackup_tag_listname[SfileadrL];
|
2009-08-10 19:37:47 +00:00
|
|
|
|
2008-11-21 16:07:03 +00:00
|
|
|
int relax_compliance; /* opaque bitfield to be set by xorrisoburn */
|
2010-12-22 13:39:55 +00:00
|
|
|
int untranslated_name_len;
|
2007-12-15 18:31:39 +00:00
|
|
|
int do_follow_pattern;
|
|
|
|
int do_follow_param;
|
2007-10-14 12:20:56 +00:00
|
|
|
int do_follow_links;
|
2007-12-15 18:31:39 +00:00
|
|
|
int follow_link_limit;
|
|
|
|
int do_follow_mount;
|
2007-10-14 12:20:56 +00:00
|
|
|
int do_global_uid;
|
|
|
|
uid_t global_uid;
|
|
|
|
int do_global_gid;
|
|
|
|
gid_t global_gid;
|
2007-11-08 14:49:16 +00:00
|
|
|
int do_global_mode;
|
|
|
|
mode_t global_dir_mode;
|
|
|
|
mode_t global_file_mode;
|
2007-10-31 18:01:20 +00:00
|
|
|
|
2009-04-02 16:25:33 +00:00
|
|
|
struct Xorriso_lsT *filters;
|
2009-04-04 14:40:11 +00:00
|
|
|
int filter_list_closed;
|
2009-04-02 16:25:33 +00:00
|
|
|
|
2009-04-11 17:26:48 +00:00
|
|
|
int zlib_level;
|
|
|
|
int zlib_level_default;
|
|
|
|
int zisofs_block_size;
|
|
|
|
int zisofs_block_size_default;
|
2009-04-14 09:23:06 +00:00
|
|
|
int zisofs_by_magic;
|
2009-04-11 17:26:48 +00:00
|
|
|
|
2007-11-06 16:32:39 +00:00
|
|
|
int do_overwrite; /* 0=off, 1=on, 2=nondir */
|
2007-11-07 12:37:19 +00:00
|
|
|
int do_reassure; /* 0=off, 1=on, 2=tree */
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2008-02-08 17:52:43 +00:00
|
|
|
char volid[33];
|
|
|
|
int volid_default;
|
2008-01-14 22:47:44 +00:00
|
|
|
char loaded_volid[33];
|
2008-12-14 09:31:52 +00:00
|
|
|
char assert_volid[SfileadrL];
|
|
|
|
char assert_volid_sev[80];
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2010-07-30 15:52:09 +00:00
|
|
|
char preparer_id[129];
|
|
|
|
|
2008-02-21 13:01:34 +00:00
|
|
|
char publisher[129];
|
2008-11-04 16:22:51 +00:00
|
|
|
char application_id[129];
|
2009-10-07 18:04:53 +00:00
|
|
|
char system_id[33];
|
|
|
|
char volset_id[129];
|
2008-02-21 13:01:34 +00:00
|
|
|
|
2010-06-26 11:40:36 +00:00
|
|
|
char copyright_file[38];
|
|
|
|
char biblio_file[38];
|
|
|
|
char abstract_file[38];
|
|
|
|
|
2008-04-03 20:41:00 +00:00
|
|
|
char session_logfile[SfileadrL];
|
|
|
|
int session_lba;
|
|
|
|
int session_blocks;
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
/* >>> put libburn/isoburn aspects here */
|
|
|
|
|
2008-12-16 13:02:11 +00:00
|
|
|
struct Xorriso_lsT *drive_blacklist;
|
|
|
|
struct Xorriso_lsT *drive_greylist;
|
|
|
|
struct Xorriso_lsT *drive_whitelist;
|
|
|
|
|
2008-05-08 14:19:09 +00:00
|
|
|
int toc_emulation_flag; /* bit0= bit3 for isoburn_drive_aquire()
|
|
|
|
scan -ROM profiles for ISO sessions
|
2008-10-05 07:55:20 +00:00
|
|
|
bit1= bit4 for isoburn_drive_aquire()
|
|
|
|
do not emulate TOC on overwriteable media
|
2009-10-07 08:05:00 +00:00
|
|
|
bit2= bit7 for isoburn_drive_aquire()
|
|
|
|
pretend any media to be -ROM
|
2008-05-08 14:19:09 +00:00
|
|
|
*/
|
|
|
|
|
2008-05-14 17:48:27 +00:00
|
|
|
int image_start_mode; /* From what address to load the ISO image
|
|
|
|
bit0-15= addressing mode
|
|
|
|
0= automatic lba as deduced from media
|
|
|
|
1= value is session number
|
|
|
|
2= value is track number
|
|
|
|
3= value is lba
|
2008-07-18 14:07:48 +00:00
|
|
|
bit16= with mode 3 : value is possibly 16 too high.
|
|
|
|
Let isoburn_set_msc1() adjust it.
|
2008-05-14 17:48:27 +00:00
|
|
|
bit30= interference with normal msc1 processing
|
|
|
|
is enabled. Without this bit,
|
|
|
|
isoburn_set_msc1() will not be called.
|
|
|
|
bit31= image loading has happened,
|
|
|
|
setting is kept for rollback only.
|
|
|
|
Always apply as 0=auto.
|
|
|
|
*/
|
|
|
|
char image_start_value[81]; /* value according image_start_mode */
|
|
|
|
|
2010-11-30 09:43:32 +00:00
|
|
|
uint32_t displacement;
|
|
|
|
int displacement_sign;
|
|
|
|
|
2009-09-19 16:09:21 +00:00
|
|
|
int drives_exclusive; /* burn_preset_device_open() param exclusive */
|
|
|
|
|
2009-08-28 10:16:28 +00:00
|
|
|
int do_calm_drive; /* bit0= calm down drive after aquiring it */
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
char indev[SfileadrL];
|
2010-06-23 17:54:41 +00:00
|
|
|
void *in_drive_handle; /* interpreted only by libburnia oriented modules */
|
|
|
|
void *in_volset_handle; /* interpreted only by libburnia oriented modules */
|
2008-11-03 11:57:57 +00:00
|
|
|
char *in_charset; /* The charset to interpret the filename bytes */
|
2009-09-19 16:09:21 +00:00
|
|
|
int indev_is_exclusive;
|
|
|
|
|
2009-04-03 17:20:33 +00:00
|
|
|
time_t isofs_st_out; /* A time point at least 1 second before image
|
|
|
|
composition began. To be stored with image as
|
|
|
|
xattr "isofs.st". */
|
|
|
|
time_t isofs_st_in; /* That time point as read from "isofs.st" of the
|
|
|
|
loaded image. */
|
2007-10-15 15:27:51 +00:00
|
|
|
|
2010-12-02 06:32:31 +00:00
|
|
|
int volset_change_pending; /* whether -commit would make sense
|
|
|
|
0= no change pending , 1= change pending
|
|
|
|
2= change pending, but -as misofs -print-size
|
|
|
|
was performed on the changed image model
|
|
|
|
*/
|
2008-03-20 21:20:19 +00:00
|
|
|
int no_volset_present; /* set to 1 on first failure */
|
2007-10-15 15:27:51 +00:00
|
|
|
|
2008-09-04 10:02:58 +00:00
|
|
|
struct CheckmediajoB *check_media_default;
|
2009-09-30 09:25:34 +00:00
|
|
|
int check_media_bad_limit; /* values defined as Xorriso_read_quality_* */
|
2008-08-17 22:05:48 +00:00
|
|
|
struct SectorbitmaP *in_sector_map; /* eventual sector validity bitmap */
|
|
|
|
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
char outdev[SfileadrL];
|
2007-10-15 15:27:51 +00:00
|
|
|
void *out_drive_handle; /* interpreted only by xorrisoburn.c */
|
2008-11-03 11:57:57 +00:00
|
|
|
char *out_charset; /* The charset to produce the filename bytes for */
|
2008-01-20 13:13:01 +00:00
|
|
|
int dev_fd_1; /* The fd which substitutes for /dev/fd/1 and is
|
|
|
|
connected to externaly perveived stdout.
|
|
|
|
*/
|
2009-09-19 16:09:21 +00:00
|
|
|
int outdev_is_exclusive;
|
2007-10-15 15:27:51 +00:00
|
|
|
|
2008-07-05 13:36:48 +00:00
|
|
|
int grow_blindly_msc2; /* if >= 0 this causes growing from drive to drive.
|
|
|
|
The value is used as block address offset for
|
|
|
|
image generation. Like in: mkisofs -C msc1,msc2
|
|
|
|
*/
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
int ban_stdio_write;
|
|
|
|
int do_dummy;
|
|
|
|
int do_close;
|
|
|
|
int speed; /* in libburn units : 1000 bytes/second , 0 = Max, -1 = Min */
|
|
|
|
int fs; /* fifo size in 2048 byte chunks : at most 1 GB */
|
2008-02-05 16:27:10 +00:00
|
|
|
int padding; /* number of bytes to add after ISO 9660 image */
|
2011-03-02 09:30:10 +00:00
|
|
|
int do_padding_by_libisofs; /* 0= by libburn , 1= by libisofs */
|
2008-10-21 11:26:16 +00:00
|
|
|
|
2011-03-02 09:30:10 +00:00
|
|
|
int alignment; /* if > 0 : output size alignment in 2048 byte blocks.
|
|
|
|
This is always done by libburn, i.e. attached
|
|
|
|
outside the image. Eventual inner alignment of
|
|
|
|
the image end happens first.
|
|
|
|
*/
|
2008-10-21 11:26:16 +00:00
|
|
|
|
2009-02-28 18:13:56 +00:00
|
|
|
int do_stream_recording; /* 0=no, 1=yes, 2=for data, not for dir
|
|
|
|
>=16 means yes with number as start LBA */
|
2008-02-05 16:27:10 +00:00
|
|
|
|
2009-11-17 13:41:28 +00:00
|
|
|
int dvd_obs; /* DVD write chunk size: 0, 32k or 64k */
|
|
|
|
int stdio_sync; /* stdio fsync interval: -1, 0, >=32 */
|
|
|
|
|
2008-02-11 09:48:29 +00:00
|
|
|
int keep_boot_image;
|
2010-04-26 12:11:59 +00:00
|
|
|
char boot_image_cat_path[SfileadrL];
|
2010-06-19 15:21:36 +00:00
|
|
|
int boot_image_cat_hidden; /* bit0= hidden in ISO/RR , bit1= in Joliet */
|
2010-04-26 12:11:59 +00:00
|
|
|
int boot_count; /* number of already attached boot images */
|
|
|
|
|
2008-09-26 16:14:21 +00:00
|
|
|
char boot_image_bin_path[SfileadrL];
|
2010-04-06 15:18:59 +00:00
|
|
|
char boot_image_bin_form[16];
|
2010-04-26 12:11:59 +00:00
|
|
|
int boot_platform_id;
|
2010-04-29 13:33:34 +00:00
|
|
|
int patch_isolinux_image; /* bit0= boot-info-table , bit1= not with EFI */
|
2008-09-26 16:14:21 +00:00
|
|
|
int boot_image_emul; /* 0=no emulation
|
2010-08-18 18:17:14 +00:00
|
|
|
1=emulation as hard disk
|
|
|
|
2=emulation as floppy
|
2008-09-26 16:14:21 +00:00
|
|
|
*/
|
|
|
|
off_t boot_image_load_size;
|
2010-04-26 12:11:59 +00:00
|
|
|
unsigned char boot_id_string[29];
|
|
|
|
unsigned char boot_selection_crit[21];
|
|
|
|
|
|
|
|
int boot_image_isohybrid; /* 0=off , deprecated: 1=auto , 2=on , 3=force */
|
|
|
|
|
|
|
|
int boot_efi_default; /* 0= no effect ,
|
|
|
|
1= appy --efi-boot parameters when attaching to img */
|
|
|
|
|
2010-04-06 15:18:59 +00:00
|
|
|
char system_area_disk_path[SfileadrL];
|
|
|
|
int system_area_options; /* bit0= "GRUB protective msdos label"
|
|
|
|
(a simple partition table)
|
2010-04-16 19:59:40 +00:00
|
|
|
bit1= isohybrid boot image pointer
|
|
|
|
and partition table
|
2010-10-12 10:32:22 +00:00
|
|
|
bit2-7= System area type
|
|
|
|
0= with bit0 or bit1: MBR
|
|
|
|
else: unspecified type
|
|
|
|
1= MIPS Big Endian Volume Header
|
2010-10-15 11:21:30 +00:00
|
|
|
2= MIPS Little Endian Boot Block
|
2011-03-03 18:18:41 +00:00
|
|
|
3= SUN Disk Label for SUN SPARC
|
|
|
|
bit8-9= Only with System area type 0
|
|
|
|
Cylinder alignment mode
|
|
|
|
0 = auto (align if bit1)
|
|
|
|
1 = always align
|
|
|
|
2 = never align
|
2010-04-16 19:59:40 +00:00
|
|
|
*/
|
|
|
|
int patch_system_area; /* Bits as of system_area_options.
|
|
|
|
to be applied to the loaded system
|
|
|
|
area of the image, if no
|
|
|
|
system_area_disk_path is set.
|
2010-04-06 15:18:59 +00:00
|
|
|
*/
|
2010-09-05 11:37:45 +00:00
|
|
|
|
2010-09-11 12:51:27 +00:00
|
|
|
/* The number of unclaimed 2K blocks before start of partition 1 as of
|
|
|
|
the MBR in system area.
|
|
|
|
If not 0 this will cause double volume descriptor sets and double tree.
|
2010-09-05 11:37:45 +00:00
|
|
|
*/
|
|
|
|
uint32_t partition_offset;
|
2010-09-11 12:51:27 +00:00
|
|
|
/* Partition table parameter: 1 to 63, 0= disabled/default */
|
2010-09-05 11:37:45 +00:00
|
|
|
int partition_secs_per_head;
|
2010-09-11 12:51:27 +00:00
|
|
|
/* 1 to 255, 0= disabled/default */
|
2010-09-05 11:37:45 +00:00
|
|
|
int partition_heads_per_cyl;
|
|
|
|
|
2010-10-18 21:22:23 +00:00
|
|
|
/* Path and type of image files to be appended as MBR partitions */
|
2010-11-05 14:46:34 +00:00
|
|
|
char *appended_partitions[Xorriso_max_appended_partitionS];
|
|
|
|
uint8_t appended_part_types[Xorriso_max_appended_partitionS];
|
|
|
|
|
|
|
|
/* Eventual name of the non-ISO aspect of the image. E.g. SUN ASCII label.
|
|
|
|
*/
|
|
|
|
char ascii_disc_label[Xorriso_disc_label_sizE];
|
2010-10-18 21:22:23 +00:00
|
|
|
|
2010-04-07 20:27:05 +00:00
|
|
|
/* User settable PVD time stamps */
|
|
|
|
time_t vol_creation_time;
|
|
|
|
time_t vol_modification_time;
|
|
|
|
time_t vol_expiration_time;
|
|
|
|
time_t vol_effective_time;
|
|
|
|
/* To eventually override vol_modification_time by unconverted string
|
|
|
|
and timezone 0 */
|
|
|
|
char vol_uuid[17];
|
|
|
|
|
2010-09-29 09:24:20 +00:00
|
|
|
#ifdef Xorriso_with_libjtE
|
|
|
|
/* Parameters and state of Jigdo Template Export environment */
|
|
|
|
struct libjte_env *libjte_handle;
|
2010-10-01 19:02:57 +00:00
|
|
|
#endif
|
2010-09-29 16:41:48 +00:00
|
|
|
|
|
|
|
/* List of -jigdo parameters since the most recent -jigdo clear */
|
|
|
|
struct Xorriso_lsT *jigdo_params;
|
|
|
|
struct Xorriso_lsT *jigdo_values;
|
2010-11-23 20:04:08 +00:00
|
|
|
int libjte_params_given; /* bits: 0= outfile , 1= verbosity , 2= template_path
|
|
|
|
3= jigdo_path , 4= md5_path , 5= min_size
|
|
|
|
6= checksum_iso , 7= checksum_template
|
|
|
|
8= compression , 9= exclude , 10= demand_md5
|
|
|
|
11= mapping
|
|
|
|
*/
|
2010-09-29 09:24:20 +00:00
|
|
|
|
2008-10-26 13:49:11 +00:00
|
|
|
/* LBA of boot image after image loading */
|
|
|
|
int loaded_boot_bin_lba;
|
|
|
|
/* Path of the catalog node after image loading */
|
|
|
|
char loaded_boot_cat_path[SfileadrL];
|
2007-10-14 12:20:56 +00:00
|
|
|
|
|
|
|
/* XORRISO options */
|
|
|
|
int allow_graft_points;
|
|
|
|
|
2009-04-05 14:30:45 +00:00
|
|
|
int allow_restore; /* -1=permanently disallowed
|
|
|
|
0=disallowed, 1=allowed, 2=device files allowed */
|
2008-05-31 17:40:18 +00:00
|
|
|
int do_concat_split; /* 1= restore complete split file directories as
|
|
|
|
regular files
|
|
|
|
*/
|
2008-06-20 09:16:34 +00:00
|
|
|
int do_auto_chmod; /* 1= eventually temporarily open access permissions
|
|
|
|
of self-owned directories during restore
|
|
|
|
*/
|
2009-05-26 14:00:54 +00:00
|
|
|
int do_restore_sort_lba; /* 1= restore via node_array rather than via
|
|
|
|
tree traversal. Better read performance,
|
|
|
|
no directory mtime restore, needs do_auto_chmod
|
|
|
|
*/
|
2009-10-10 14:22:50 +00:00
|
|
|
int mount_opts_flag; /* bit0= "shared" = not "exclusive"
|
|
|
|
Try to emit non-exclusive mount command.
|
|
|
|
Do not give up drives.
|
|
|
|
Linux: use loop device even on block devices
|
|
|
|
in order to circumvent the ban to mount a
|
|
|
|
device twice (with different sbsector=)
|
|
|
|
FreeBSD: ?
|
|
|
|
*/
|
2008-05-22 19:25:59 +00:00
|
|
|
|
2008-10-10 13:11:46 +00:00
|
|
|
int dialog; /* 0=off , 1=single-line , 2=multi-line */
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2008-10-17 07:50:35 +00:00
|
|
|
int bsl_interpretation;
|
|
|
|
/* whether to run input through Sfile_bsl_interpreter():
|
|
|
|
bit0-1= dialog and quoted file reading
|
|
|
|
0= no interpretation, leave unchanged
|
|
|
|
1= only inside double quotes
|
|
|
|
2= outside single quotes
|
|
|
|
3= everywhere
|
|
|
|
bit2-3= reserved as future expansion of bit0-1
|
|
|
|
bit4= interpretation within program start arguments
|
2008-10-17 12:33:49 +00:00
|
|
|
bit5= perform backslash encoding with results
|
|
|
|
bit6= perform backslash encoding with info texts
|
2008-10-17 07:50:35 +00:00
|
|
|
*/
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2007-10-31 18:01:20 +00:00
|
|
|
/* Pattern matching facility. It still carries legacy from scdbackup/askme.c
|
|
|
|
but is fully functional for xorriso.
|
|
|
|
*/
|
2007-10-14 12:20:56 +00:00
|
|
|
int search_mode;
|
|
|
|
/* 0= start text
|
|
|
|
1= fgrep ,
|
|
|
|
2= regular expression
|
|
|
|
3= (eventually structured) shell parser expression
|
|
|
|
4= shell parser expression for leaf name
|
|
|
|
*/
|
2007-11-09 19:30:25 +00:00
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
int structured_search;
|
2007-10-29 21:41:17 +00:00
|
|
|
/* 0= flat text search
|
2007-10-14 12:20:56 +00:00
|
|
|
1= '/' is a significant separator that cannot be matched by wildcards
|
|
|
|
( 2= like 1 : but report only occurence in tree, no payload, no location )
|
|
|
|
( 3= like 2 : but report first content level of matching directories )
|
|
|
|
4= actually not structured but unique find mode (with search_mode 4)
|
|
|
|
*/
|
2007-10-31 18:01:20 +00:00
|
|
|
|
2007-11-09 19:30:25 +00:00
|
|
|
int do_iso_rr_pattern; /* 0=off, 1=on, 2=ls */
|
2007-12-04 07:44:59 +00:00
|
|
|
int do_disk_pattern; /* 0=off, 1=on, 2=ls */
|
2007-11-09 19:30:25 +00:00
|
|
|
|
2007-10-31 10:34:52 +00:00
|
|
|
int temp_mem_limit;
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2008-08-27 12:13:07 +00:00
|
|
|
off_t file_size_limit;
|
|
|
|
|
2008-05-02 20:50:40 +00:00
|
|
|
struct ExclusionS *disk_exclusions;
|
2008-05-03 15:11:58 +00:00
|
|
|
int disk_excl_mode; /* bit0= on (else off)
|
|
|
|
bit1= parameter too (else rekursion only)
|
2008-05-03 22:32:51 +00:00
|
|
|
bit2= whole subtree banned (else only exact path)
|
|
|
|
bit3= when comparing ignore excluded files rather
|
|
|
|
than to treat them as truely missing on disk
|
2008-05-03 15:11:58 +00:00
|
|
|
*/
|
2008-05-02 20:50:40 +00:00
|
|
|
|
2010-06-23 13:43:40 +00:00
|
|
|
struct ExclusionS *iso_rr_hidings;
|
|
|
|
struct ExclusionS *joliet_hidings;
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
int use_stdin; /* use raw stdin even if readline support is compiled */
|
|
|
|
int result_page_length;
|
|
|
|
int result_page_width;
|
|
|
|
char mark_text[SfileadrL]; /* ( stdout+stderr, M: ) */
|
|
|
|
int packet_output;
|
|
|
|
char logfile[4][SfileadrL];
|
2008-08-13 19:08:07 +00:00
|
|
|
FILE *logfile_fp[4];
|
|
|
|
FILE *pktlog_fp;
|
|
|
|
struct Xorriso_lsT *result_msglists[Xorriso_max_outlist_stacK];
|
|
|
|
struct Xorriso_lsT *info_msglists[Xorriso_max_outlist_stacK];
|
2008-08-15 10:29:47 +00:00
|
|
|
int msglist_flags[Xorriso_max_outlist_stacK]; /* bit0= result is redirected
|
|
|
|
bit1= info is redirected
|
|
|
|
*/
|
2008-08-13 19:08:07 +00:00
|
|
|
int msglist_stackfill;
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
int status_history_max; /* for -status long_history */
|
2008-08-13 19:08:07 +00:00
|
|
|
|
2010-02-18 12:48:42 +00:00
|
|
|
/* 0= no logging of SCSI commands, 1= to stderr */
|
|
|
|
int scsi_log;
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2007-10-19 16:49:37 +00:00
|
|
|
char report_about_text[20];
|
|
|
|
int report_about_severity;
|
2007-10-17 13:00:58 +00:00
|
|
|
int library_msg_direct_print;
|
|
|
|
char abort_on_text[20];
|
|
|
|
int abort_on_severity; /* A severity rank number as threshold */
|
2011-01-04 19:30:49 +00:00
|
|
|
int abort_on_is_default; /* will be set to 0 by first -abort_on */
|
2007-10-17 13:00:58 +00:00
|
|
|
int problem_status; /* Severity rank number. 0= no abort condition present */
|
|
|
|
char problem_status_text[20];
|
2007-10-14 12:20:56 +00:00
|
|
|
|
2008-02-23 10:28:58 +00:00
|
|
|
char errfile_log[SfileadrL]; /* for -errfile_log */
|
|
|
|
int errfile_mode; /* bit0= marked */
|
|
|
|
FILE *errfile_fp;
|
|
|
|
|
2008-05-01 12:43:39 +00:00
|
|
|
int img_read_error_mode; /* 0=best_effort , 1=failure , 2=fatal */
|
2008-09-03 14:33:14 +00:00
|
|
|
int extract_error_mode; /* 0=best_effort , 1=keep , 2=delete */
|
2008-05-01 12:43:39 +00:00
|
|
|
|
2008-02-11 13:55:09 +00:00
|
|
|
char return_with_text[20];
|
|
|
|
int return_with_severity;
|
|
|
|
int return_with_value;
|
|
|
|
int eternal_problem_status;
|
|
|
|
char eternal_problem_status_text[20];
|
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
/* temporary search facilities */
|
|
|
|
regex_t *re;
|
|
|
|
regmatch_t match[1];
|
|
|
|
char **re_constants;
|
|
|
|
int re_count;
|
|
|
|
int re_fill;
|
|
|
|
char reg_expr[2*SfileadrL];
|
|
|
|
|
|
|
|
/* run state */
|
2008-02-11 19:49:03 +00:00
|
|
|
int run_state; /* 0=preparing , 1=writing image */
|
2007-10-14 12:20:56 +00:00
|
|
|
int is_dialog;
|
|
|
|
int bar_is_fresh;
|
|
|
|
char pending_option[SfileadrL]; /* eventual option entered at page prompt */
|
2007-10-17 13:00:58 +00:00
|
|
|
int request_to_abort; /* abort a single operation like -ls, not the program */
|
2007-11-07 12:37:19 +00:00
|
|
|
int request_not_to_ask; /* suppress reassure and pager */
|
2007-10-14 12:20:56 +00:00
|
|
|
double idle_time;
|
|
|
|
int re_failed_at; /* mismatch position with structured_search */
|
|
|
|
int prepended_wd;
|
|
|
|
double insert_count;
|
|
|
|
double insert_bytes;
|
|
|
|
double error_count; /* double will not roll over */
|
|
|
|
|
2008-02-06 13:11:20 +00:00
|
|
|
/* pacifiers */
|
2008-07-18 14:07:48 +00:00
|
|
|
int pacifier_style; /* 0= xorriso, 1=mkisofs 2=cdrecord */
|
2008-02-06 13:11:20 +00:00
|
|
|
double pacifier_interval;
|
|
|
|
double start_time;
|
|
|
|
double last_update_time;
|
|
|
|
/* optional global counters for brain reduced callback functions */
|
|
|
|
off_t pacifier_count;
|
|
|
|
off_t pacifier_total;
|
2008-06-20 16:41:08 +00:00
|
|
|
off_t pacifier_byte_count; /* auxiliary counter for data bytes */
|
2008-02-06 13:11:20 +00:00
|
|
|
|
2008-02-19 21:24:05 +00:00
|
|
|
void *pacifier_fifo;
|
|
|
|
|
2008-02-28 21:22:50 +00:00
|
|
|
int find_compare_result; /* 1=everything matches , 0=mismatch , -1=error */
|
2009-08-12 13:03:07 +00:00
|
|
|
int find_check_md5_result; /* bit0= seen mismatch
|
|
|
|
bit1= seen error
|
|
|
|
bit2= seen data file without MD5
|
2009-08-15 17:34:00 +00:00
|
|
|
bit3= seen match
|
2009-08-12 13:03:07 +00:00
|
|
|
*/
|
2008-02-28 21:22:50 +00:00
|
|
|
|
2010-11-03 08:11:45 +00:00
|
|
|
double last_abort_file_time; /* most recent check for aborting -check_md5 */
|
|
|
|
|
2009-06-22 11:28:34 +00:00
|
|
|
/* Tree node collection and LBA sorting facility */
|
2009-05-16 16:56:21 +00:00
|
|
|
int node_counter;
|
|
|
|
int node_array_size;
|
|
|
|
void **node_array;
|
2009-05-26 14:00:54 +00:00
|
|
|
struct Xorriso_lsT *node_disk_prefixes;
|
|
|
|
struct Xorriso_lsT *node_img_prefixes;
|
2009-05-16 16:56:21 +00:00
|
|
|
|
2009-06-22 11:28:34 +00:00
|
|
|
/* Hardlink matching at restore time memorizes hardlink target paths.
|
|
|
|
Array of nodes sorted by LBA. */
|
|
|
|
int hln_count;
|
|
|
|
void **hln_array;
|
|
|
|
void **hln_targets;
|
2009-07-25 18:18:05 +00:00
|
|
|
int hln_change_pending; /* whether a change was made since hln creation */
|
2009-06-22 11:28:34 +00:00
|
|
|
|
|
|
|
/* >>> this should count all temp_mem and thus change its name */
|
|
|
|
off_t node_targets_availmem;
|
|
|
|
|
|
|
|
/* Hardlink matching at update time:
|
|
|
|
Array of all nodes in the tree, sorted by disk dev,ino.
|
|
|
|
Bitmap of nodes which possibly got new hardlink siblings.
|
|
|
|
List of involved disk-iso path pairs. */
|
2009-06-15 12:15:12 +00:00
|
|
|
int di_count;
|
|
|
|
void **di_array;
|
2009-06-22 11:28:34 +00:00
|
|
|
char *di_do_widen;
|
|
|
|
struct Xorriso_lsT *di_disk_paths;
|
|
|
|
struct Xorriso_lsT *di_iso_paths;
|
2009-06-15 12:15:12 +00:00
|
|
|
|
2008-05-26 18:11:51 +00:00
|
|
|
struct PermiteM *perm_stack; /* Temporarily altered dir access permissions */
|
|
|
|
|
2011-02-12 17:14:23 +00:00
|
|
|
/* bit0= update_merge active: mark all newly added nodes as visited+found
|
|
|
|
*/
|
|
|
|
int update_flags;
|
|
|
|
|
2007-10-31 18:01:20 +00:00
|
|
|
/* result (stdout, R: ) */
|
2008-09-04 10:02:58 +00:00
|
|
|
char result_line[10*SfileadrL];
|
2007-10-14 12:20:56 +00:00
|
|
|
int result_line_counter;
|
|
|
|
int result_page_counter;
|
|
|
|
int result_open_line_len;
|
|
|
|
|
|
|
|
|
|
|
|
/* info (stderr, I:) */
|
|
|
|
char info_text[10*SfileadrL];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-05-15 18:48:10 +00:00
|
|
|
#include "base_obj.h"
|
|
|
|
#include "aux_objects.h"
|
|
|
|
#include "findjob.h"
|
|
|
|
#include "check_media.h"
|
|
|
|
#include "misc_funct.h"
|
|
|
|
#include "text_io.h"
|
|
|
|
#include "match.h"
|
|
|
|
#include "emulators.h"
|
|
|
|
#include "disk_ops.h"
|
|
|
|
#include "cmp_update.h"
|
|
|
|
#include "parse_exec.h"
|
2010-03-09 06:52:24 +00:00
|
|
|
|
2008-12-14 09:31:52 +00:00
|
|
|
|
2007-10-14 12:20:56 +00:00
|
|
|
#endif /* Xorriso_private_includeD */
|
|
|
|
|