source: MondoRescue/branches/2.2.10/mondo/src/common/mondostructures.h@ 2816

Last change on this file since 2816 was 2816, checked in by Bruno Cornec, 13 years ago

svn merge (in svk) -r 2714:2773 2.2.9 in 2.2.10

r4207@localhost (orig r2716): bruno | 2011-02-03 01:29:51 +0100

  • Increase boot size again to support better fedora 13/14


r4208@localhost (orig r2717): bruno | 2011-02-12 15:43:36 +0100

  • Excluding vmhgfs FS for VMWare guests mounting areas of the host.


r4209@localhost (orig r2718): bruno | 2011-02-18 00:30:35 +0100
-Extend EXTRA-SIZE for Debian 6.0 (at least)


r4210@localhost (orig r2719): bruno | 2011-02-18 00:45:40 +0100

  • Fix #462 (removes temp dir if analyze-my-lvm launched in stand alonae mode)


r4213@localhost (orig r2722): bruno | 2011-02-25 18:44:47 +0100

  • Fixes for RHEL6 support at least around dm extensions, bnx2x and cp210x dependencies


r4214@localhost (orig r2723): bruno | 2011-02-25 19:00:17 +0100

  • Adds a restore quiet option


r4215@localhost (orig r2724): bruno | 2011-02-25 19:43:50 +0100

  • Adds support for dm-log used on RHEL6 as well.


r4216@localhost (orig r2725): bruno | 2011-02-25 21:26:54 +0100

  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3


r4217@localhost (orig r2726): bruno | 2011-02-26 11:38:29 +0100

  • Fix error introduced in previous patch in the if/then/else case without member in the then


r4218@localhost (orig r2727): bruno | 2011-02-26 12:05:33 +0100

  • With mindi-busybox 1.18.3 the syntax of openvt changed. This patch keeps a compatible init script for both previous and current version.


r4219@localhost (orig r2728): bruno | 2011-02-26 15:27:40 +0100

  • Latest lvdisplay print MiB instead of MB. Impact on analyze-my-lvm fixed.


r4220@localhost (orig r2729): bruno | 2011-02-26 16:39:32 +0100

  • Adds feature rpc to mindi-busybox in case of need



r4221@localhost (orig r2730): bruno | 2011-02-26 16:42:43 +0100

  • Adds the rebot command to the list of mandatory ones at restore time


r4222@localhost (orig r2731): bruno | 2011-02-26 17:37:13 +0100

  • Adds functions and /bin/loadkeys (new location) to minimal set of commands to have
  • provides a makemessage option to mindi and this function now works with pbdistrocheck
  • Do not create an error when a phys device has 0 size and is a /dev/dm-* device


r4223@localhost (orig r2732): bruno | 2011-02-26 19:07:43 +0100

  • Syntax fix


r4224@localhost (orig r2733): bruno | 2011-02-26 19:51:16 +0100

  • Fix test on dm which was made in wrong sense
  • Adds a driver to allow raid456 to work


r4225@localhost (orig r2734): bruno | 2011-02-26 20:55:00 +0100

  • Fix 2 redirections issues


r4317@localhost (orig r2737): bruno | 2011-03-13 13:12:57 +0100

  • Add support for libahci driver, mandatory for debian 6.


r4318@localhost (orig r2738): bruno | 2011-03-13 14:46:37 +0100

  • Update from Lester Wade (lester.wade_at_hp.com) incorporating latest ML feedbacks


r4319@localhost (orig r2739): bruno | 2011-03-13 17:49:15 +0100

  • Updated Lab for TES 2011


r4323@localhost (orig r2743): bruno | 2011-03-20 01:37:40 +0100

  • Fix a seg fault bug when using the GUI in case exclude_paths was NULL (mc_at_carreira.com.pt)


r4324@localhost (orig r2744): bruno | 2011-03-20 19:38:14 +0100

  • Adds Arch Linux Keyboard support (mc_at_carreira.com.pt)


r4325@localhost (orig r2745): bruno | 2011-03-20 19:48:01 +0100

  • Avoids coredump again when exclude_path is NULL with mr_make_devlist_from_pathlist (feedback from mc_at_carreira.com.pt)


r4326@localhost (orig r2746): bruno | 2011-03-20 19:39:47 +0100

  • Remove blkid from busybox to solve #435


r4327@localhost (orig r2747): bruno | 2011-03-20 19:43:22 +0100

  • Adds reboot to fix #435


r4328@localhost (orig r2748): bruno | 2011-03-22 00:58:07 +0100

  • Fix Arch Linux kbd printed in log file now instead of screen.


r4329@localhost (orig r2749): bruno | 2011-03-22 00:59:58 +0100

  • Again increase size for boot env to support better fedora 14 and other latest distros


r4356@localhost (orig r2750): bruno | 2011-03-25 19:30:01 +0100

  • Improve Arch Linux support for mindi tools (mc_at_carreira.com.pt)


r4357@localhost (orig r2751): bruno | 2011-03-25 19:48:33 +0100

  • Accept to work with either wodim or cdreord and genisoimage or mkisofs


r4358@localhost (orig r2752): bruno | 2011-03-25 20:20:49 +0100

  • Documents option -v of mondoarchive


r4359@localhost (orig r2753): bruno | 2011-03-29 01:34:30 +0200

  • Use modprobe instead of insmod to load loop, cd, ... modules (in order to force them at rstore time). Also drop very old aes support for mdk 9.2


r4360@localhost (orig r2754): bruno | 2011-03-29 01:38:49 +0200

  • Arch Linux support for boot message of mindi (mc_at_carreira.com.pt) using /etc/arch-release and pacman.log


r4383@localhost (orig r2755): bruno | 2011-04-07 09:49:38 +0200

  • Adds a UdevadmTrigger function at restore time to deal with the various syntax formats changes ddepending on version (mc_at_carreira.com.pt)


r4384@localhost (orig r2756): bruno | 2011-04-07 10:05:24 +0200

  • Increase again sizes for Debian 6 support (victor.gattegno_at_hp.com)


r4385@localhost (orig r2757): bruno | 2011-04-07 10:13:00 +0200
Conform to the report of size really !


r4386@localhost (orig r2758): bruno | 2011-04-07 11:31:12 +0200

  • Improved message for Arch Linux for rebuilding the initrd (mc_at_carreira.com.pt)


r4390@localhost (orig r2759): bruno | 2011-04-12 01:15:00 +0200

  • Typo in Web site


r4392@localhost (orig r2761): bruno | 2011-04-14 00:23:38 +0200

  • Adds download references for latest versions.


r4394@localhost (orig r2763): bruno | 2011-04-16 00:35:08 +0200

  • Adds support for MT back mandatory for OBDR.


r4395@localhost (orig r2764): bruno | 2011-04-20 12:18:46 +0200
Function resize_drive_proportionately_to_suit_new_drives

  • Integrate some mr_asprintf
  • Use systematically long long data types in all computation to match the struct mountlist_reference size member and have correct precision
  • Apply JB general_at_itpsg.com patch to make the partition resizing work properly according to the drive size (keeping all calculation in KB and converting only for display)


r4396@localhost (orig r2765): bruno | 2011-04-21 11:20:58 +0200

  • Remove very old code creating confusing symlinks pico to nano in init (patch from MC). Fix #477


r4397@localhost (orig r2766): bruno | 2011-04-21 11:57:44 +0200

  • text's are properly centered in open_and_list_dir (Patch from Chucky). Fix #404.


r4398@localhost (orig r2767): bruno | 2011-04-21 12:49:40 +0200

  • Attempt to fix #432 with a better message at a start.


r4399@localhost (orig r2768): bruno | 2011-04-21 13:00:37 +0200

Log content of mondo-restore.cfg


r4400@localhost (orig r2769): bruno | 2011-04-21 13:48:52 +0200

  • Introduce a new bkpinfo member (subdir) to support storing the subdir under which ISO images are stored on an external HDD. Should fix mostly #433.


r4401@localhost (orig r2770): bruno | 2011-04-21 14:14:52 +0200

  • Fix compilation issues due to level of visibility of functions


r4402@localhost (orig r2771): bruno | 2011-04-22 01:49:03 +0200

  • Adds GUI support for compresion type. Fix half of #468.


r4403@localhost (orig r2772): bruno | 2011-04-22 02:00:07 +0200

  • Adds support of ext attr through the GUI. Fix second part of #468


r4404@localhost (orig r2773): bruno | 2011-04-22 02:22:24 +0200

  • Propose more variables in the mindi.conf example
  • More explicit messages when size unsufficient in mindi for kernel + initrd as per #471
  • Better loging of labeling in mondo when in nuke mode


  • Property svn:keywords set to Id
File size: 20.3 KB
Line 
1/***************************************************************************
2 mondostructures.h - description
3 -------------------
4 begin : Fri Apr 19 2002
5 copyright : (C) 2002 by Stan Benoit
6 email : troff@nakedsoul.org
7 cvsid : $Id: mondostructures.h 2816 2011-04-29 13:42:55Z bruno $
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19
20/**
21 * @file
22 * The header file defining all of Mondo's structures.
23 */
24
25
26/** @def MAX_NOOF_MEDIA The maximum number of media that can be used in any one backup. */
27///* So we can override it in config.h: */
28//#ifndef MAX_NOOF_MEDIA
29#define MAX_NOOF_MEDIA 50
30//#endif
31
32/**
33 * Structure indicating one entry in the mountlist.
34 * There is one mountlist_line for each device we're keeping track of in the mountlist.
35 */
36struct mountlist_line {
37 /**
38 * The name of the device (/dev entry) for this mountlist line. Guaranteed to be unique.
39 */
40 char device[64];
41
42 /**
43 * The mountpoint for this mountlist line. Should be unique.
44 * This can be "raid", for a RAID subdisk, or "lvm", for an LVM PV.
45 */
46 char mountpoint[256];
47
48 /**
49 * The filesystem type of this entry. Examples: ext2, ext3, reiserfs, xfs, swap.
50 * Also, this can be "raid", for a RAID subdisk, or "lvm", for an LVM PV.
51 */
52 char format[64];
53
54 /**
55 * The size in kilobytes of this device. 0 or -1 indicates LVM.
56 */
57 long long size;
58
59 /**
60 * For ext2 and ext3, this is the filesystem label or uuid (if there is one). If not, this should be "".
61 */
62 char label[256];
63
64};
65
66/**
67 * The mountlist structure.
68 * This is used to keep track of a list of all the devices/partitions/formats/sizes/labels in the
69 * system, so we can recreate them in a nuke restore.
70 */
71struct mountlist_itself {
72 /**
73 * Number of entries in the mountlist.
74 */
75 int entries;
76
77 /**
78 * The list of entries, all @p entries of them.
79 */
80 struct mountlist_line el[MAX_MOUNTLIST_ENTRIES];
81};
82
83/**
84 * A structure which holds references to elements of the mountlist.
85 * This is used in resize_drive_proportionately_to_fit_new_drives() to
86 * ensure accurate resizing.
87 */
88struct mountlist_reference {
89 /**
90 * The number of entries in the list of mountlist references.
91 */
92 int entries;
93
94 /**
95 * The array of mountlist_line, allocated on demand.
96 */
97 struct mountlist_line **el;
98};
99
100/**
101 * A line in @p additional_raid_variables.
102 */
103struct raid_var_line {
104 /**
105 * The label for this RAID variable.
106 */
107 char label[64];
108
109 /**
110 * The value for this RAID variable.
111 */
112 char value[64];
113};
114
115/**
116 * The additional RAID variables structure.
117 * This is used to store a list of additional variables to be put in the raidtab,
118 * to allow users to use (new) features of RAID which Mondo doesn't (yet) support directly.
119 * Each @p raid_device_record has one.
120 */
121struct additional_raid_variables {
122 /**
123 * The number of entries in the list.
124 */
125 int entries;
126
127 /**
128 * The list of entries, all @p entries of them.
129 */
130 struct raid_var_line el[MAXIMUM_ADDITIONAL_RAID_VARS];
131};
132
133/**
134 * One disk in a @p list_of_disks.
135 */
136struct s_disk {
137#ifdef __FreeBSD__
138 /**
139 * The name of this disk. If blank it will eventually get filled in automatically.
140 */
141 char name[64];
142#endif
143 /**
144 * The device this entry describes.
145 */
146 char device[64];
147
148 /**
149 * Index number of this entry in the whole disklist.
150 */
151 int index;
152
153 /**
154 * Type of disk.
155 */
156 char type; // ' ' = data (default), S = spare, F = faulty
157
158};
159
160/**
161 * A list of @p s_disk. Every @p raid_device_record has four.
162 */
163struct list_of_disks {
164 /**
165 * The number of entries in the disklist.
166 */
167 int entries;
168
169 /**
170 * The entries themselves, all @p entries of them.
171 */
172 struct s_disk el[MAXIMUM_DISKS_PER_RAID_DEV];
173};
174
175/**
176 * A type of media we're backing up to.
177 */
178typedef enum { none = 0, ///< No type has been set yet.
179 iso, ///< Back up to ISO images.
180 cdr, ///< Back up to recordable CDs (do not erase them).
181 cdrw, ///< Back up to CD-RWs and blank them first.
182 dvd, ///< Back up to DVD+R[W] or DVD-R[W] disks.
183 cdstream, ///< Back up to recordable CDs but treat them like a tape streamer.
184 netfs, ///< Back up to an NETFS mount on the local subnet.
185 tape, ///< Back up to tapes.
186 usb, ///< Back up to USB devices.
187 udev ///< Back up to another unsupported device; just send a stream of bytes.
188} t_bkptype;
189
190/**
191 * A type of file in the catalog of recent archives.
192 */
193typedef enum { other, ///< Some other kind of file.
194 fileset, ///< An afioball (fileset), optionally compressed.
195 biggieslice ///< A slice of a biggiefile, optionally compressed.
196} t_archtype;
197
198/**
199 * A type of file in the catalog of recent archives.
200 */
201typedef enum {
202 nuke = 0, /// Nuke mode
203 interactive, /// Interactive mode
204 compare, /// Compare mode
205 mbr, /// MBR mode
206 isoonly, /// ISO mode
207 isonuke, /// ISO+Nuke mode
208} t_restore_mode;
209
210
211#ifdef __FreeBSD__
212
213struct vinum_subdisk {
214 char which_device[64];
215};
216
217struct vinum_plex {
218 int raidlevel;
219 int stripesize;
220 int subdisks;
221 struct vinum_subdisk sd[MAXIMUM_RAID_DEVS];
222};
223
224struct vinum_volume {
225 char volname[64];
226 int plexes;
227 struct vinum_plex plex[9];
228};
229
230struct raidlist_itself {
231 int entries;
232 struct list_of_disks spares;
233 struct list_of_disks disks;
234 struct vinum_volume el[MAXIMUM_RAID_DEVS];
235};
236
237#else
238
239 /**
240 * A RAID device in the raidlist.
241 */
242struct raid_device_record {
243 /**
244 * The name of the RAID device (e.g. /dev/md0).
245 */
246 char raid_device[64];
247
248 /**
249 * The RAID level (-1 to 5) we're using.
250 */
251 int raid_level;
252
253 /**
254 * Whether the disk has a persistent superblock.
255 */
256 int persistent_superblock;
257
258 /**
259 * The chunk size of this RAID device.
260 */
261 int chunk_size;
262
263 /**
264 * The parity algorithm of this RAID device. (RAID5 only)
265 */
266 int parity; // 0=left-asymmetric, 1=right-asymmetric, 2=left-symmetric, 3=right-symmetric
267
268 /**
269 * A list of the disks to use for storing data.
270 */
271 struct list_of_disks data_disks;
272
273 /**
274 * A list of the disks to use as "hot spares" in case one dies.
275 */
276 struct list_of_disks spare_disks;
277
278 /**
279 * A list of the disks to use for storing parity information.
280 */
281 struct list_of_disks parity_disks;
282
283 /**
284 * A list of the disks in this RAID device that have failed\. Rare.
285 */
286 struct list_of_disks failed_disks;
287
288 /**
289 * The additional RAID variables for this device.
290 */
291 struct additional_raid_variables additional_vars;
292
293 /**
294 * Resync progress for this device.
295 */
296 int progress;
297};
298
299 /**
300 * The list of RAID devices.
301 * This is intended to be used along with the mountlist, and it can be
302 * directly loaded from/saved to raidtab format.
303 */
304struct raidlist_itself {
305 /**
306 * The number of entries in the list.
307 */
308 int entries;
309
310 /**
311 * The RAID devices in the raidlist, all @p entries of them.
312 */
313 struct raid_device_record el[MAXIMUM_RAID_DEVS];
314};
315
316#endif
317
318/**
319 * The backup information structure.
320 *
321 * This is the central structure to all the activity going on inside Mondo.
322 * It is passed to almost every function that is not just a helper, even those
323 * which only use one variable of it, because it is useful keeping all the information
324 * together in one place. The usage of particular fields in the bkpinfo is marked in
325 * function documentation, but it is best to fill out as many fields as apply, because
326 * that function may in turn pass the bkpinfo to other functions which use other fields.
327 *
328 * To fill out the bkpinfo first call init_bkpinfo() and pre_param_configuration(). Then set
329 * the backup-specific parameters (see mondo/mondoarchive/mondo-cli.c-\>process_switches for
330 * an example). After that, you should call post_param_configuration() to set some final
331 * parameters based on those you have already set. Failure to do the last step will result in
332 * extremely strange and hard-to-track errors in chop_filelist(), since optimal_set_size is 0.
333 */
334struct s_bkpinfo {
335 /**
336 * The device we're backing up to.
337 * If backup_media_type is @b cdr, @b cdrw, or @b cdstream, this should be the SCSI node (e.g. 0,1,0).
338 * If backup_media_type is @b dvd, @b tape, @b usb or @b udev, this should be a /dev entry.
339 * If backup_media_type is anything else, this should be blank.
340 */
341 char *media_device;
342
343 /**
344 * An array containing the sizes of each media in our backup set, in MB.
345 * For example, media 1's size would be stored in media_size[1].
346 * Element 0 is unused.
347 * If the size should be autodetected, make it -1 (preferable) or 0.
348 * @bug This should probably be only one variable, not an array.
349 */
350 long media_size[MAX_NOOF_MEDIA + 1];
351
352 /**
353 * The boot loader that is installed. Available choices are:
354 * - 'G' for GRUB
355 * - 'L' for LILO
356 * - 'E' for ELILO
357 * - (FreeBSD only) 'B' for boot0
358 * - (FreeBSD only) 'D' for dangerously dedicated
359 * - 'R' for Raw
360 * - 'U' for Unknown or None
361 *
362 * The function which_boot_loader() can help you set this.
363 */
364 char boot_loader;
365
366 /**
367 * The boot device on which @p boot_loader is installed.
368 * This is a bit difficult to autodetect; you may want
369 * to take truncate_to_drive_name() of where_is_root_mounted().
370 */
371 char *boot_device;
372
373 /**
374 * The compression program to use. Currently supported
375 * choices are lzop and bzip2; gzip may also work. This is ignored if
376 * compression_level is 0.
377 */
378 char *zip_exe;
379
380 /**
381 * The extension your compression program uses. lzop uses lzo, bzip uses
382 * bz2, gzip uses gz, lzma uses lzma etc. Do not include the dot.
383 */
384 char *zip_suffix;
385
386 /**
387 * Devices to back up as biggiefiles.
388 *
389 * This is useful for backing up NTFS partitions.
390 * @c ntfsclone is used to back up only the used sectors, so the space tradeoff is not bad.
391 * However, several caveats apply to such a partition:
392 * - It must not be mounted during the backup
393 * - It must be in a format that ntfsclone knows how to handle, i.e. NTFS
394 * - It cannot be verified during the verify or compare phase
395 * - It may not be resized or selectively restored at restore-time (all or nothing)
396 *
397 * This is a useful feature, but use at your own risk.
398 */
399 char *image_devs;
400
401 /**
402 * The compression level (1-9) to use. 0 disables compression.
403 */
404 int compression_level;
405
406 /**
407 * If TRUE, then use @c lzop to compress data.
408 * This is used mainly in estimates. The backup/restore may or may
409 * not work if you do not set this. You should also set @p zip_exe
410 * and @p zip_suffix.
411 */
412 bool use_lzo;
413
414 /**
415 * If TRUE, then use @c gzip to compress data.
416 * This is used mainly in estimates. The backup/restore may or may
417 * not work if you do not set this. You should also set @p zip_exe
418 * and @p zip_suffix.
419 */
420 bool use_gzip;
421
422/**
423 * If TRUE, then use @c lzma to compress data.
424 * This is used mainly in estimates. The backup/restore may or may
425 * not work if you do not set this. You should also set @p zip_exe
426 * and @p zip_suffix.
427 */
428 bool use_lzma;
429
430 /**
431 * If TRUE, then we should verify a backup.
432 */
433 bool verify_data;
434
435 /**
436 * If TRUE, then we should back up some data.
437 */
438 bool backup_data;
439
440 /**
441 * If TRUE, then we should restore some data.
442 */
443 bool restore_data;
444
445
446 /**
447 * If TRUE, then we should backup/restore using star, not afio
448 */
449 bool use_star;
450
451
452 /**
453 * Size of internal block reads/writes
454 */
455 long internal_tape_block_size;
456
457 /**
458 * If TRUE, we're making a CD that will autonuke without confirmation when booted.
459 */
460 bool disaster_recovery;
461
462 /**
463 * The directory we're backing up to.
464 * If backup_media_type is @b iso, then this is that directory.
465 * If backup_media_type is anything else, this is ignored.
466 */
467 char *isodir;
468
469/**
470 * The prefix to put in front of media number
471 * If backup_media_type is @b iso, then this is the prefix for the filename
472 * If backup_media_type is anything else, this is ignored.
473 */
474 char *prefix;
475
476 /**
477 * The scratch directory to use.
478 * This is the "stage" that the CD image is made directly from.
479 * As such, it needs to be at least as large as the largest CD/DVD/ISO.
480 */
481 char *scratchdir;
482
483 /**
484 * The temp directory to use.
485 * This is where filesets are stored by the archival threads before
486 * the main thread moves them to the scratchdir. You don't need a lot
487 * of space here.
488 */
489 char *tmpdir;
490
491 /**
492 * The optimal size for each fileset. This is set automatically in
493 * post_param_configuration() based on your @p backup_media_type; you
494 * needn't set it yourself.
495 */
496 long optimal_set_size;
497
498 /**
499 * The type of media we're backing up to.
500 */
501 t_bkptype backup_media_type;
502
503 /**
504 * Whether we should use a premade filelist or generate our own.
505 * If TRUE, then we generate our own filelist from the directories in @p include_paths.
506 * If FALSE, then we use the filelist whose name is specified in @p include_paths.
507 */
508 bool make_filelist;
509
510 /**
511 * Directories to back up, or (if !make_filelist) the filelist to use.
512 * In the former case, multiple directories should be separated by spaces.
513 * If you do nothing, "/" will be used.
514 */
515 char *include_paths;
516
517 /**
518 * Directories to NOT back up. Ignored if make_filelist == FALSE.
519 * Multiple directories should be separated by spaces. /tmp, /proc,
520 * the scratchdir, and the tempdir are automatically excluded.
521 */
522 char *exclude_paths;
523
524 /**
525 * Devices to NOT back up.
526 * Multiple devices should be separated by spaces.
527 */
528 char *exclude_devs;
529
530 /**
531 * The path to restore files relative to during a restore.
532 * This is useful if you want to extract the files (to test, for example)
533 * without overwriting the old ones. Ignored during a backup.
534 */
535 char *restore_path;
536
537 /**
538 * A command to call BEFORE making an ISO image.
539 */
540 char *call_before_iso;
541
542 /**
543 * A command to call to make an ISO image.
544 */
545 char *call_make_iso;
546
547 /**
548 * A command to call to burn the ISO image.
549 */
550 char *call_burn_iso;
551
552 /**
553 * A command to call AFTER making an ISO image.
554 * BERLIOS: Never initialized in code !!
555 */
556 char *call_after_iso;
557
558 /**
559 * Path to the user's kernel included with Mindi.
560 */
561 char *kernel_path;
562
563 /**
564 * The NETFS mount to back up to/restore from.
565 * If backup_media_type is not @b netfs, this is ignored.
566 * It must contain a colon, and the server's address should be in dotted-decimal IP
567 * address form. (Domain names will be resolved in post_param_configuration().)
568 */
569 char *netfs_mount;
570
571 /**
572 * The directory, relative to the root of @p netfs_mount, to put
573 * the backups in.
574 */
575 char *netfs_remote_dir;
576
577 /**
578 * The potential user to use for NETFS backup
579 */
580 char *netfs_user;
581
582 /**
583 * The potential subdirectory under which are located ISO images on HDD (restore mode only)
584 */
585 char *subdir;
586
587 /**
588 * The protocol to use for Network backup (NFS, SSHFS, ...)
589 */
590 char *netfs_proto;
591
592 /**
593 * A tarball containing a program called "usr/bin/post-nuke" that will be run
594 * after nuking the system. If "", do not use a post-nuke tarball.
595 */
596 char *postnuke_tarball;
597
598 /**
599 * If TRUE, then pass cdrecord the argument "blank=fast" to wipe the CDs before
600 * writing to them. This has no effect for DVDs.
601 */
602 bool wipe_media_first;
603
604// patch by Herman Kuster
605 /**
606 * The differential level of this backup. Currently only 0 (full backup) and 1
607 * (files changed since last full backup) are supported.
608 */
609 int differential;
610// end patch
611
612 /**
613 * If TRUE, then don't eject media when backing up or restoring.
614 */
615 bool please_dont_eject;
616
617 /**
618 * The speed of the CD-R[W] drive.
619 */
620 int cdrw_speed;
621
622 /**
623 * If TRUE, then cdrecord will be passed some flags to help compensate for PCs
624 * with eccentric CD-ROM drives. If it has BurnProof technology, or is in a laptop,
625 * it probably falls into this category.
626 */
627 bool manual_cd_tray;
628
629 /**
630 * If TRUE, do not make the first CD bootable. This is dangerous but it saves a minute
631 * or so. It is useful in testing. Use with care.
632 */
633 bool nonbootable_backup;
634
635 /**
636 * If TRUE, make the bootable CD use LILO/ELILO. If FALSE, use isolinux (the default).
637 */
638 bool make_cd_use_lilo;
639
640 /**
641 * If TRUE, make the the tape bootable. If FALSE, normal tape, the default
642 */
643 bool use_obdr;
644
645 /**
646 * Nature of the restore
647 */
648 t_restore_mode restore_mode;
649};
650
651
652
653/**
654 * A node in a directory structure.
655 * Its internals are managed by load_filelist() et al; you only need to keep track of the top node.
656 * @bug My understanding of this structure is horrendously incomplete. Could you please fill in the details?
657 */
658struct s_node {
659 /**
660 * The character this node contains.
661 */
662 char ch;
663
664 /**
665 * The node to the right of this one.
666 */
667 struct s_node *right;
668
669 /**
670 * The node below this one.
671 */
672 struct s_node *down;
673
674 /**
675 * If TRUE, then this node is selected (for restore, for example).
676 */
677 bool selected;
678
679 /**
680 * If TRUE, then we want to see the directories below this one.
681 */
682 bool expanded;
683};
684
685
686
687/**
688 * Information about one file.
689 * This is used as the "zeroth slice" of a biggiefile to be able to recreate
690 * its name, mode, owner, group, mtime, atime, and to be able to verify it in Compare Mode.
691 */
692struct s_filename_and_lstat_info {
693 /**
694 * The filename of the file this structure is describing.
695 */
696 char filename[MAX_STR_LEN];
697
698 /**
699 * The MD5 checksum (32 hex digits) of this file.
700 */
701 char checksum[64];
702
703 /**
704 * Unused; kept for backwards compatibility.
705 */
706 char for_backward_compatibility;
707
708 /**
709 * The stat buffer for this file.
710 * Generated with a call to <tt>lstat(&(struc->properties))</tt> where @p struc
711 * is the @p s_filename_and_lstat_info.
712 */
713 struct stat properties;
714 bool use_ntfsprog;
715};
716
717
718/**
719 * A file with associated severity if it differed in a verify or compare.
720 */
721struct s_filelist_entry {
722 /**
723 * The name of the file.
724 */
725 char filename[MAX_STR_LEN];
726 /**
727 * The severity if the file has changed between the backup and live filesystem.
728 * This is on a scale from 1 to 3, 3 being the most important. File patterns which cause
729 * a severity of 1 are:
730 * - /etc/adjtime
731 * - /etc/mtab
732 * - /var/lib/slocate
733 * - /var/lock
734 * - /var/log
735 * - /var/spool (except /var/spool/mail)
736 * - /var/run
737 * - *~
738 * - *.log
739 * - *cache*
740 * - other temporary or unimportant files
741 *
742 * File patterns which cause a severity of 2 are:
743 * - /var (except /var/lock, /var/log, /var/run, /var/spool)
744 * - /home
745 * - /root/.*
746 * - /var/lib (except /var/lib/slocate, /var/lib/rpm)
747 * - /var/spool/mail
748 *
749 * File patterns which cause a severity of 3 are:
750 * - /etc (except /etc/adjtime, /etc/mtab)
751 * - /root (except /root/.*)
752 * - /usr
753 * - /var/lib/rpm
754 * - Anything else not matched explicitly
755 *
756 * @see severity_of_difference
757 */
758 int severity;
759};
760
761
762/**
763 * A list of @c s_filelist_entry.
764 */
765struct s_filelist {
766 /**
767 * The number of entries in the list.
768 */
769 int entries;
770
771 /**
772 * The entries themselves, all @p entries of them.
773 */
774 struct s_filelist_entry el[ARBITRARY_MAXIMUM];
775};
776
777
778/**
779 * An entry in the tape catalog.
780 */
781struct s_tapecat_entry {
782 /**
783 * The type of archive it is (afioball, slice, or something else).
784 */
785 t_archtype type;
786
787 /**
788 * The filelist number or biggiefile (not slice!) number.
789 */
790 int number;
791
792 /**
793 * The slice number if it's a biggiefile.
794 */
795 long aux;
796
797 /**
798 * The tape position at the point this entry was added.
799 */
800 long long tape_posK;
801
802 /**
803 * The filename of the file cataloged here.
804 */
805 char fname[MAX_TAPECAT_FNAME_LEN + 1];
806};
807
808
809/**
810 * A tape catalog, made of a list of @p s_tapecat_entry.
811 */
812struct s_tapecatalog {
813 /**
814 * The number of entries in the tape catalog.
815 */
816 int entries;
817
818 /**
819 * The entries themselves, all @p entries of them.
820 */
821 struct s_tapecat_entry el[MAX_TAPECATALOG_ENTRIES];
822};
Note: See TracBrowser for help on using the repository browser.