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

Last change on this file since 2508 was 2508, checked in by Bruno Cornec, 14 years ago

r3287@localhost (orig r2285): bruno | 2009-07-20 11:36:47 +0200

r3285@localhost: bruno | 2009-07-20 11:17:35 +0200
Apply fix in 2.2.10 around multi USB device handling to 2.2.9 as well


r3291@localhost (orig r2288): bruno | 2009-07-21 16:48:31 +0200
Copy 2.2.10 test script in to 2.2.9 for memory problm analysis


r3293@localhost (orig r2290): bruno | 2009-07-22 14:03:44 +0200

  • Fix a printing error in mindi for the tar command
  • Fix all mr_asprintf which had no second param as a string


r3295@localhost (orig r2292): bruno | 2009-07-22 16:55:00 +0200

  • Fix #160 and #346 by rewriting the message.txt file with more valid information gathered in mindi


r3300@localhost (orig r2294): bruno | 2009-07-23 01:58:08 +0200

Man pages patch from Joe Ross (joe.ross_at_gmail.com)


r3303@localhost (orig r2297): bruno | 2009-07-23 17:43:49 +0200
Fix a remaining display error for 2.2.9. That version has been tested OK in a lab.


r3304@localhost (orig r2298): bruno | 2009-07-23 18:18:27 +0200

  • Remove memory leak for the last modification


r3308@localhost (orig r2302): bruno | 2009-07-24 21:18:50 +0200
Improve logging of mountlist.txt


r3310@localhost (orig r2304): bruno | 2009-07-27 19:45:10 +0200

  • popup_and_get_string needs an allocated buffer for the moment so fixing the calls with dyn. ones
  • Fix a bug in mem.c for mr_strcat, which wasn't modifying the right pointer level


r3311@localhost (orig r2305): bruno | 2009-07-27 19:49:35 +0200
Avoid a memory leak in the previous patch


r3314@localhost (orig r2308): bruno | 2009-07-27 20:59:06 +0200
Fix a bug in mr_strcat backported from 2.2.10. Should solve our seg faults.


r3315@localhost (orig r2309): bruno | 2009-07-28 02:14:23 +0200
Cosmetic changes to allow for quality to not giv false positive


r3343@localhost (orig r2311): bruno | 2009-08-18 02:13:43 +0200
Fix for initramfs detection with 2.6.30 (Hugo Vanwoerkom hvw59601_at_care2.com)


r3367@localhost (orig r2333): bruno | 2009-08-18 16:26:26 +0200
Adds a precision for -U option in man page on raw device usage and not partition name


r3373@localhost (orig r2336): bruno | 2009-08-20 17:37:41 +0200

  • Precise the combined usage of -E and -I in mondoarchive (Case 4601017223)


r3379@localhost (orig r2342): bruno | 2009-08-21 16:27:10 +0200


r3383@localhost (orig r2344): bruno | 2009-08-24 13:37:09 +0200

r3382@localhost: bruno | 2009-08-24 13:30:25 +0200
In NFS mode also propose access to expert, interactive, ... entry at boot prompt


r3388@localhost (orig r2346): bruno | 2009-08-27 11:41:16 +0200
Adds fdisk -l result in Log File at restore time


r3389@localhost (orig r2347): bruno | 2009-08-27 13:51:00 +0200

  • Solve tmp dir creation which sometimes was trying to create /%xx dirs. Should fix #293 for good


r3390@localhost (orig r2348): bruno | 2009-08-27 13:54:25 +0200
Improve logging (minor)


r3394@localhost (orig r2350): bruno | 2009-08-28 02:24:19 +0200
Change inerface of evaluate_mountlist and spread_flaws_across_three_lines in order to solve bugs linked to strings management in these functions. May fix a restoration crash seen by some customers


r3397@localhost (orig r2353): bruno | 2009-08-28 19:03:45 +0200

  • Addition of a nomd option to avoid starting mdadm
  • mpath is now already started if there was a mpath entry in mountlist


r3399@localhost (orig r2355): bruno | 2009-08-29 00:56:50 +0200
Remove function spread_flaws_across_three_lines and expand it at the single place where it was useful, and fix memory allocation issues in it.


r3402@localhost (orig r2358): bruno | 2009-09-01 19:02:35 +0200
P2V doc updated (Lester Wade lester.wade_at_hp.com)


r3404@localhost (orig r2360): bruno | 2009-09-01 19:26:53 +0200
Website update to refer to new P2V document


r3405@localhost (orig r2361): bruno | 2009-09-03 13:54:25 +0200

  • Fix a case where the NFS dir in restore mode was mounted rw (linked to bug #291 could create a huge problem)


r3407@localhost (orig r2363): bruno | 2009-09-03 14:46:46 +0200
More verbose at installation of additional tools


r3409@localhost (orig r2365): bruno | 2009-09-03 18:08:32 +0200

  • New update from Lester Wade (lester.wade_at_hp.com) for P2V doc


r3410@localhost (orig r2366): bruno | 2009-09-05 01:28:18 +0200
place the code of mondo_makefilelist before its call



r3411@localhost (orig r2367): bruno | 2009-09-06 01:51:26 +0200

  • Advertising for project-builder on the website added


r3412@localhost (orig r2368): bruno | 2009-09-07 15:36:23 +0200
Fix compilation issue


r3413@localhost (orig r2369): bruno | 2009-09-07 18:03:40 +0200
Another compilation issue fixed.


r3415@localhost (orig r2371): bruno | 2009-09-08 13:40:25 +0200

  • Fix a problem a error detection in evaluate_mountlist which casued nuke mode to abort. Error string should also be better now.


r3417@localhost (orig r2373): bruno | 2009-09-08 13:55:31 +0200
Avoid asking the Prefix name in NFS mode twice


r3418@localhost (orig r2374): bruno | 2009-09-08 20:04:07 +0200

  • Try to fix garbled screen progression in text mode based on 2.2.10 modifications which are working


r3424@localhost (orig r2380): bruno | 2009-09-09 20:30:47 +0200

  • Change NFS support into a NetFS support to allow for multiple protocol in addition to NFS (NEEDS TESTING)
  • Better logging to detect a potential nuke issue


r3425@localhost (orig r2381): bruno | 2009-09-10 02:05:55 +0200
Fix a missing param for sshfs call


r3428@localhost (orig r2384): bruno | 2009-09-10 13:02:56 +0200

  • Remove separate function look_for_duplicate_mountpoints used only once and whose interface created problems with caller


r3430@localhost (orig r2386): bruno | 2009-09-10 16:06:52 +0200
Be compatible on backup type by making old nfs recognized as netfs and proto forced


r3431@localhost (orig r2387): bruno | 2009-09-10 18:40:47 +0200
Fix a problem in netfs analysis in mondoarchive


r3432@localhost (orig r2388): bruno | 2009-09-10 20:25:13 +0200
Fix mondoarchive CLI analysis for NETFS type of requests


r3434@localhost (orig r2390): bruno | 2009-09-11 03:05:20 +0200

  • Adds ext3 initrd support for 2.6.30


r3437@localhost (orig r2393): bruno | 2009-09-11 11:56:52 +0200

  • Tries to add support for bzip2 and lzma initramfs (preliminary, not tested) for 2.6.30


r3438@localhost (orig r2394): bruno | 2009-09-12 02:53:02 +0200
Fix interface of evaluate_mountlist (remove 2nd param useless) and fix nuke mode which wasn't working.


r3441@localhost (orig r2397): bruno | 2009-09-14 18:54:34 +0200
Fix a format issue in text mode on percentage


r3452@localhost (orig r2398): bruno | 2009-09-15 16:00:13 +0200

  • Fix a bug where flaws_str could be NULL and wasn't tested correctly.


r3453@localhost (orig r2399): bruno | 2009-09-15 19:28:39 +0200

  • Use protocol name when displaying restore progress instead of netfs
  • Ask for network protocol name at restore time


r3455@localhost (orig r2401): bruno | 2009-09-15 19:34:19 +0200
Wrong structure member name was used


r3456@localhost (orig r2402): bruno | 2009-09-16 13:04:17 +0200
Use dir for shell related commands and dir1 for C related actions in open_and_list_dir to avoid missing some files with { in names e.g.


r3457@localhost (orig r2403): bruno | 2009-09-16 16:32:03 +0200

  • At restore time read the netfs protocol in the conf file


r3462@localhost (orig r2408): bruno | 2009-09-18 15:17:08 +0200
Remove useless script


r3463@localhost (orig r2409): bruno | 2009-09-18 15:25:35 +0200

  • Split deplist.txt into multiple conf files under deplist.d in the conf dir. This will allow to have a minimal.conf file for initrd content to analyze to improve support of new embedded feature in the future (sshfs, live install). The other conf files contain the additional commands to put in the all.tar.gz. For the moment, mindi is still working the same. THis infra will allow that support in a near future. deplist.txt is now reserved for the admin additional commands.


r3465@localhost (orig r2410): bruno | 2009-09-18 19:10:54 +0200

  • Better list of mandatory tools
  • Adds fuse and sshfs support in initrd


r3466@localhost (orig r2411): bruno | 2009-09-18 20:32:47 +0200
sshfs also needs ssh at restore time in initrd


r3478@localhost (orig r2418): bruno | 2009-09-23 23:22:39 +0200
Modify getfattr call to have all extended attributes, including non user ones. (patch from Kevin Ritzenthaler Kevin.Ritzenthaler_at_hp.com) and fix #357


r3479@localhost (orig r2419): bruno | 2009-09-23 23:50:34 +0200
star only supports ACL when used with exustar mode. Fix #356.


r3482@localhost (orig r2422): bruno | 2009-09-24 16:53:24 +0200

  • Adds support for bnx2x (BL 460 G6) and auth_rpcgss (Debian 2.6.31)


r3485@localhost (orig r2423): bruno | 2009-09-25 16:38:40 +0200
Fix an issue in is_this_device_mounted (string freed before last usage)


r3486@localhost (orig r2424): bruno | 2009-09-25 18:44:01 +0200

  • analyze-my-lvm now removes excluded devices from list coming from mondoarchive
  • new mr_make_devlist_from_pathlist which handle the new bkpinfo->exclude_devs field containing the excluded devices and remove corresponding code from libmondo-cli.c
  • Move DSF code into libmondo-devices.c for coherency, and only the previous function is made externally available
  • Remove dev_to_exclude in libmondo-archive.c which wasn't working correctly and replace it with bkpinfo->exclude_devs


r3487@localhost (orig r2425): bruno | 2009-09-25 18:58:23 +0200

  • Improving ssh support at restore time by providing a shadow file


r3489@localhost (orig r2426): bruno | 2009-09-25 19:42:09 +0200

  • Attempt to stay backward compatible without protocol for -n option


r3490@localhost (orig r2427): bruno | 2009-09-28 02:08:06 +0200
Avoids null param for excludes_devs for mindi call


r3492@localhost (orig r2429): bruno | 2009-09-28 11:46:16 +0200

  • Simplify GetInitrdFilesystemToUse which doesn't need to detect everything, but just know if it's initramfs (new mode) or a compressed FS ext2/3 (older mode) as initrd is anyway re-made by mindi. Should fix #353


r3494@localhost (orig r2431): bruno | 2009-09-28 13:16:18 +0200

  • Use only the AWK veriable everywhere and not the awk command


r3495@localhost (orig r2432): bruno | 2009-09-28 14:16:31 +0200
Warning emited in case of duplicate mountpoints or devices in fstab found


r3496@localhost (orig r2433): bruno | 2009-09-28 15:55:17 +0200
ssh in the restore env needs some dlopened libs (libnss_compat|files)


r3497@localhost (orig r2434): bruno | 2009-09-28 16:33:14 +0200
Compiler warning fixed


r3498@localhost (orig r2435): bruno | 2009-09-28 17:55:26 +0200
Improve user management for NetFS cases


r3499@localhost (orig r2436): bruno | 2009-09-29 01:48:32 +0200

  • Improve deplist.d/* files
  • adds libnss for ssh support in boot disk
  • Solve a memory management issue in DSF module (strtok => mr_strtok)
  • DSF now also supports partitions in addition to full disks
  • Adds debug in open_and_list_dir


r3500@localhost (orig r2437): bruno | 2009-09-29 10:41:56 +0200

  • Fix udev support in init for Mandriva 2009.1 (udevadm settle is blocking)


r3501@localhost (orig r2438): bruno | 2009-09-29 14:41:36 +0200

  • Improvements on sshfs/ssh management in restore mode
  • Include now all minimal requirements for sshfs


r3502@localhost (orig r2439): bruno | 2009-09-29 18:46:08 +0200

  • Avoids error message if some ssh conf files do not exist


r3503@localhost (orig r2440): bruno | 2009-09-29 18:57:13 +0200

  • Avoids comment analysis in the new code handling deplist.d


r3504@localhost (orig r2441): bruno | 2009-09-29 19:34:34 +0200

  • fuse device is needed at restore time for sshfs


r3505@localhost (orig r2442): bruno | 2009-09-29 20:02:36 +0200

  • Improves udev timeout handling


r3506@localhost (orig r2443): bruno | 2009-09-29 20:43:38 +0200

  • priority given to env var for tmpdir
  • fuse FS excluded from tmpdir computation


r3518@localhost (orig r2447): bruno | 2009-10-04 01:58:08 +0200

  • Iprove USB log in case of error by adding the conf file


r3519@localhost (orig r2448): bruno | 2009-10-05 11:06:13 +0200


r3520@localhost (orig r2449): bruno | 2009-10-06 01:10:35 +0200

  • Adds support for grub2 conf file grub.cfg in addition to menu.lst


r3521@localhost (orig r2450): bruno | 2009-10-06 01:24:02 +0200

  • Fix a mr_asprintf usage without & causing a seg fault.


r3523@localhost (orig r2452): bruno | 2009-10-06 12:47:56 +0200
CIFS mounts shouldn't be part of the mountlist analysis (should help solving #288)


r3524@localhost (orig r2453): bruno | 2009-10-07 10:17:03 +0200

  • Fix a bug in handling of -E option with real devices (bad report in function mr_make_devlist_from_pathlist of the test between -E and -I)


r3525@localhost (orig r2454): bruno | 2009-10-07 10:19:02 +0200

  • Fix an error in the test for grub conf files (or used instead of and)


r3526@localhost (orig r2455): bruno | 2009-10-07 16:14:59 +0200
afio is under /bin on Debian


r3527@localhost (orig r2456): bruno | 2009-10-07 17:31:26 +0200

  • Adds support for libcrc32c (needed by bnx2x)


r3532@localhost (orig r2457): bruno | 2009-10-09 13:33:44 +0200

  • Apply path from Matthew Cline (matt_at_nightrealms.com) in order to fix #359


r3533@localhost (orig r2458): bruno | 2009-10-09 13:41:02 +0200
Adds a conf file example for mindi and fix #360


r3535@localhost (orig r2459): bruno | 2009-10-09 15:13:01 +0200
MOde of conf file


r3546@localhost (orig r2461): bruno | 2009-10-14 01:12:24 +0200

  • umount freshly created VFAT partition on USB key as Ubunu has an automounter mounting it as soon as created (Steffen Neumann sneumann_at_ipb-halle.de)


r3566@localhost (orig r2463): bruno | 2009-10-26 01:34:16 +0100

  • Reset an error counter before blanking a DVD to avoid always returning an error (Vincent Raman vincent.raman_at_macqel.eu)


r3567@localhost (orig r2464): bruno | 2009-10-26 13:57:14 +0100
bzip2 is under /bin on Debian


r3568@localhost (orig r2465): bruno | 2009-10-28 01:46:30 +0100
some distro hold lvm commands under /usr/sbin


r3595@localhost (orig r2469): bruno | 2009-11-10 12:22:10 +0100
/dev/shm is now part of the default exclude list


r3596@localhost (orig r2470): bruno | 2009-11-10 12:32:40 +0100
Remove useless pb_log and MONDO_TRACEFILE


r3597@localhost (orig r2471): bruno | 2009-11-10 12:57:58 +0100
Improve analysis of kernel modules by printing whether it's a live or extra module which has not been found (Matthew Cline) as reported in #362


r3598@localhost (orig r2472): bruno | 2009-11-10 13:21:46 +0100

  • Default to DVD size when in iso or netfs mode


r3599@localhost (orig r2473): bruno | 2009-11-10 14:13:10 +0100

  • Fix #363 where exclude_paths was extended up to memory limit dumping core


r3600@localhost (orig r2474): bruno | 2009-11-10 14:31:14 +0100

  • Update deplist for Debian support


r3602@localhost (orig r2476): bruno | 2009-11-11 02:44:42 +0100

  • small improvement for loging in USB case


r3603@localhost (orig r2477): bruno | 2009-11-11 13:29:27 +0100

  • Adds a nolvm boot option at restore time


r3604@localhost (orig r2478): bruno | 2009-11-11 19:54:51 +0100

  • Fix #367 - the for loop doesn't make any test now, as it was computed before entering the loop, leading to an error, and was also made inside the loop anyway.


r3605@localhost (orig r2479): bruno | 2009-11-12 00:32:45 +0100

  • Add support for diskdumplib driver useful for RHEL 3 and IBM xseries 336


r3606@localhost (orig r2480): bruno | 2009-11-12 01:09:40 +0100

  • If using nolvm, mondorestore should also not nalyze and handle i-want-my-lvm


r3608@localhost (orig r2482): bruno | 2009-11-14 12:54:11 +0100
Fix bunzip2 on debian as well


r3610@localhost (orig r2484): bruno | 2009-11-15 00:44:19 +0100

  • Adds support for variable serial port console, with defalut to /dev/ttyS0, and a boot param to change it with serial=/dev/ttySx


r3615@localhost (orig r2485): bruno | 2009-11-15 01:34:33 +0100

r3614@localhost: bruno | 2009-11-15 01:34:12 +0100
Adds a space in exclude paths


r3623@localhost (orig r2487): bruno | 2009-11-18 20:41:40 +0100

r3620@localhost: bruno | 2009-11-18 10:31:36 +0100

  • Only link /dev/tty to serial port when there is indeed a serial port. If not breaks mondorestore on normal console


r3631@localhost (orig r2490): bruno | 2009-11-24 01:48:29 +0100
Put news below in the main page to make it more readable


r3648@localhost (orig r2492): bruno | 2009-11-25 23:50:13 +0100

r3647@localhost: bruno | 2009-11-25 23:49:11 +0100

  • Add warning for -f and SW Raid as in 2.2.10


r3650@localhost (orig r2493): bruno | 2009-11-26 00:19:52 +0100

r3649@localhost: bruno | 2009-11-26 00:18:27 +0100

  • Addition of the german translation made by Magnus Rasche (Magnus.rasche_at_gmx.de) and Website inclusion


r3652@localhost (orig r2495): bruno | 2009-11-27 15:55:55 +0100
cosmetic display fix
r3659@localhost (orig r2498): bruno | 2009-12-05 17:53:03 +0100
nfsopt restore boot time option added to support custom mount options for network restore


r3684@localhost (orig r2501): bruno | 2009-12-17 00:35:08 +0100
Fix #375 mondo will segfault if the partition in sensibly_set_tmpdir_and_scratchdir() is read-only (cylau)


r3685@localhost (orig r2502): bruno | 2009-12-17 01:02:47 +0100

  • Fix an issue in the function listing kernel modules when not found


r3686@localhost (orig r2503): bruno | 2009-12-17 01:15:01 +0100
Adds scsi_dump_register to mindi SCSI_MODS for RHEL3 + IBM servers


r3701@localhost (orig r2504): bruno | 2009-12-23 02:24:33 +0100

  • Addition of the Lab for Mondorescue


r3702@localhost (orig r2505): bruno | 2009-12-23 02:41:17 +0100
Web site update for Lab MondoRescue delivery


r3706@localhost (orig r2506): bruno | 2010-01-04 11:31:53 +0100

  • Fix a bug when isodir is / only when splitting it in iso_path and iso_mnt


r3707@localhost (orig r2507): bruno | 2010-01-04 13:22:49 +0100

  • Fix #377: Segfault in pause_and_ask_for_cdr() (ggeens)


  • Property svn:keywords set to Id
File size: 20.2 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 2508 2010-01-04 18:21: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 protocol to use for Network backup (NFS, SSHFS, ...)
584 */
585 char *netfs_proto;
586
587 /**
588 * A tarball containing a program called "usr/bin/post-nuke" that will be run
589 * after nuking the system. If "", do not use a post-nuke tarball.
590 */
591 char *postnuke_tarball;
592
593 /**
594 * If TRUE, then pass cdrecord the argument "blank=fast" to wipe the CDs before
595 * writing to them. This has no effect for DVDs.
596 */
597 bool wipe_media_first;
598
599// patch by Herman Kuster
600 /**
601 * The differential level of this backup. Currently only 0 (full backup) and 1
602 * (files changed since last full backup) are supported.
603 */
604 int differential;
605// end patch
606
607 /**
608 * If TRUE, then don't eject media when backing up or restoring.
609 */
610 bool please_dont_eject;
611
612 /**
613 * The speed of the CD-R[W] drive.
614 */
615 int cdrw_speed;
616
617 /**
618 * If TRUE, then cdrecord will be passed some flags to help compensate for PCs
619 * with eccentric CD-ROM drives. If it has BurnProof technology, or is in a laptop,
620 * it probably falls into this category.
621 */
622 bool manual_cd_tray;
623
624 /**
625 * If TRUE, do not make the first CD bootable. This is dangerous but it saves a minute
626 * or so. It is useful in testing. Use with care.
627 */
628 bool nonbootable_backup;
629
630 /**
631 * If TRUE, make the bootable CD use LILO/ELILO. If FALSE, use isolinux (the default).
632 */
633 bool make_cd_use_lilo;
634
635 /**
636 * If TRUE, make the the tape bootable. If FALSE, normal tape, the default
637 */
638 bool use_obdr;
639
640 /**
641 * Nature of the restore
642 */
643 t_restore_mode restore_mode;
644};
645
646
647
648/**
649 * A node in a directory structure.
650 * Its internals are managed by load_filelist() et al; you only need to keep track of the top node.
651 * @bug My understanding of this structure is horrendously incomplete. Could you please fill in the details?
652 */
653struct s_node {
654 /**
655 * The character this node contains.
656 */
657 char ch;
658
659 /**
660 * The node to the right of this one.
661 */
662 struct s_node *right;
663
664 /**
665 * The node below this one.
666 */
667 struct s_node *down;
668
669 /**
670 * If TRUE, then this node is selected (for restore, for example).
671 */
672 bool selected;
673
674 /**
675 * If TRUE, then we want to see the directories below this one.
676 */
677 bool expanded;
678};
679
680
681
682/**
683 * Information about one file.
684 * This is used as the "zeroth slice" of a biggiefile to be able to recreate
685 * its name, mode, owner, group, mtime, atime, and to be able to verify it in Compare Mode.
686 */
687struct s_filename_and_lstat_info {
688 /**
689 * The filename of the file this structure is describing.
690 */
691 char filename[MAX_STR_LEN];
692
693 /**
694 * The MD5 checksum (32 hex digits) of this file.
695 */
696 char checksum[64];
697
698 /**
699 * Unused; kept for backwards compatibility.
700 */
701 char for_backward_compatibility;
702
703 /**
704 * The stat buffer for this file.
705 * Generated with a call to <tt>lstat(&(struc->properties))</tt> where @p struc
706 * is the @p s_filename_and_lstat_info.
707 */
708 struct stat properties;
709 bool use_ntfsprog;
710};
711
712
713/**
714 * A file with associated severity if it differed in a verify or compare.
715 */
716struct s_filelist_entry {
717 /**
718 * The name of the file.
719 */
720 char filename[MAX_STR_LEN];
721 /**
722 * The severity if the file has changed between the backup and live filesystem.
723 * This is on a scale from 1 to 3, 3 being the most important. File patterns which cause
724 * a severity of 1 are:
725 * - /etc/adjtime
726 * - /etc/mtab
727 * - /var/lib/slocate
728 * - /var/lock
729 * - /var/log
730 * - /var/spool (except /var/spool/mail)
731 * - /var/run
732 * - *~
733 * - *.log
734 * - *cache*
735 * - other temporary or unimportant files
736 *
737 * File patterns which cause a severity of 2 are:
738 * - /var (except /var/lock, /var/log, /var/run, /var/spool)
739 * - /home
740 * - /root/.*
741 * - /var/lib (except /var/lib/slocate, /var/lib/rpm)
742 * - /var/spool/mail
743 *
744 * File patterns which cause a severity of 3 are:
745 * - /etc (except /etc/adjtime, /etc/mtab)
746 * - /root (except /root/.*)
747 * - /usr
748 * - /var/lib/rpm
749 * - Anything else not matched explicitly
750 *
751 * @see severity_of_difference
752 */
753 int severity;
754};
755
756
757/**
758 * A list of @c s_filelist_entry.
759 */
760struct s_filelist {
761 /**
762 * The number of entries in the list.
763 */
764 int entries;
765
766 /**
767 * The entries themselves, all @p entries of them.
768 */
769 struct s_filelist_entry el[ARBITRARY_MAXIMUM];
770};
771
772
773/**
774 * An entry in the tape catalog.
775 */
776struct s_tapecat_entry {
777 /**
778 * The type of archive it is (afioball, slice, or something else).
779 */
780 t_archtype type;
781
782 /**
783 * The filelist number or biggiefile (not slice!) number.
784 */
785 int number;
786
787 /**
788 * The slice number if it's a biggiefile.
789 */
790 long aux;
791
792 /**
793 * The tape position at the point this entry was added.
794 */
795 long long tape_posK;
796
797 /**
798 * The filename of the file cataloged here.
799 */
800 char fname[MAX_TAPECAT_FNAME_LEN + 1];
801};
802
803
804/**
805 * A tape catalog, made of a list of @p s_tapecat_entry.
806 */
807struct s_tapecatalog {
808 /**
809 * The number of entries in the tape catalog.
810 */
811 int entries;
812
813 /**
814 * The entries themselves, all @p entries of them.
815 */
816 struct s_tapecat_entry el[MAX_TAPECATALOG_ENTRIES];
817};
Note: See TracBrowser for help on using the repository browser.