source: MondoRescue/branches/2.2.10/mondo/src/include/my-stuff.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: 12.9 KB
Line 
1/* my-stuff.h
2 $Id: my-stuff.h 2508 2010-01-04 18:21:55Z bruno $
3*/
4
5#define HAVE_MALLOC 1
6
7
8// Extra info for ACLs and SELINUX users
9#define STAR_ACL_SZ "-xattr -acl"
10
11/**
12 * @file
13 * The main header file for Mondo.
14 */
15
16#if !defined(bool) && !defined(__cplusplus)
17/**
18 * Create the illusion of a Boolean type.
19 */
20#define bool int
21#define TRUE 1
22#define FALSE 0
23#endif
24
25#ifndef _MY_STUFF_H_
26#define _MY_STUFF_H_
27
28#ifdef HAVE_CONFIG_H
29#include <config.h>
30#endif
31
32#ifndef __FreeBSD__
33#include <getopt.h>
34#endif
35#include <sys/types.h>
36#include <sys/ipc.h>
37#include <sys/ioctl.h>
38#include <sys/sem.h>
39#include <sys/param.h>
40#include <stdio.h>
41#include <stdlib.h>
42#ifndef __USE_FILE_OFFSET64
43#define __USE_FILE_OFFSET64
44#endif
45#ifndef __USE_LARGEFILE64
46#define __USE_LARGEFILE64
47#endif
48#include <sys/stat.h>
49#include <fcntl.h>
50#include <errno.h>
51#include <stddef.h>
52#include <sys/stat.h>
53#include <sys/wait.h>
54#include <time.h>
55#include <unistd.h>
56#include <signal.h>
57//#include <curses.h>
58#include <newt.h>
59#include <ctype.h>
60#include <string.h>
61#include <pthread.h>
62#include <assert.h>
63
64#if defined(DEBUG) && !__cplusplus
65int count;
66char trace_log[255]; /*buffer for logging */
67char *trace_log_ptr;
68#endif /* DEBUG */
69
70#define IA64_BOOT_SIZE "16384" /* Should be coherent with mindi */
71#define STD_PREFIX "mondorescue" /* Should be coherent with mindi */
72
73/**
74 * The location where mindi media images are stored.
75 */
76#define MINDI_CACHE_REL "var/cache/mindi" /* Should be coherent with mindi */
77#define MINDI_CACHE "/"MINDI_CACHE_REL
78
79/**
80 * The location where mondo changed info are stored.
81 */
82#define MONDO_CACHE "/var/cache/mondo"
83
84/**
85 * The RAID kernel proc file
86 */
87#define MDSTAT_FILE "/proc/mdstat"
88
89#ifdef __FreeBSD__
90#define CMDLINE "/tmp/cmdline"
91#else
92// Default Linux
93#define CMDLINE "/proc/cmdline"
94#endif
95
96#undef assert
97
98extern void _mondo_assert_fail(const char *file, const char *function,
99 int line, const char *exp);
100
101/**
102 * An assert macro that calls _mondo_assert_fail() when it fails.
103 */
104#ifdef NDEBUG
105#define assert(exp) ((void)0)
106#else
107#define assert(exp) ((exp)?((void)0):_mondo_assert_fail(__FILE__, __FUNCTION__, __LINE__, #exp))
108#endif
109
110#define CRC_M16 0xA001 ///< Mask for crc16.
111#define CRC_MTT 0x1021 ///< Mask for crc-ccitt.
112
113#define FALSE 0 ///< The ubiquitous FALSE macro.
114#define TRUE 1 ///< The even more ubiquitous TRUE macro.
115
116#define SCREEN_LENGTH 25 ///< The default size of the screen.
117#define NOOF_ERR_LINES 6 ///< The number of lines of log output to keep at the bottom of the screen.
118#define ARBITRARY_MAXIMUM 2000 ///< The maximum number of items showing at once in the mountlist or filelist editor.
119#define MAX_TAPECATALOG_ENTRIES 16384 ///< The maximum number of entries in the tape catalog.
120#define MAX_MOUNTLIST_ENTRIES 8192 ///< The maximum number of entries in the mountlist.
121#define MAX_STR_LEN 384 ///< The maximum length of almost all @p char buffers in Mondo.
122 /// Note: Make this divisible by eight to avoid aligment issues
123 /// on 64bit platforms like ia64.
124#define MAXIMUM_RAID_DEVS 32 ///< The maximum number of RAID devices in the raidlist.
125#define MAXIMUM_ADDITIONAL_RAID_VARS 32 ///< The maximum number of additional RAID variables per RAID device in the raidlist.
126#define MAXIMUM_DISKS_PER_RAID_DEV 1024 ///< The maximum number of disks per RAID device in the raidtab.
127
128#define RAIDTAB_FNAME "/etc/raidtab" ///< The filename of the raidtab file, at least on Linux.
129
130#define BLK_START_OF_BACKUP 1 ///< Marker block: start a backup.
131#define BLK_START_OF_TAPE 2 ///< Marker block: start a tape.
132#define BLK_START_AFIOBALLS 10 ///< Marker block: start the afioball section.
133#define BLK_STOP_AFIOBALLS 19 ///< Marker block: stop the afioball section.
134#define BLK_START_AN_AFIO_OR_SLICE 20 ///< Marker block: start an afioball or a slice.
135#define BLK_STOP_AN_AFIO_OR_SLICE 29 ///< Marker block: stop an afioball or a slice.
136#define BLK_START_BIGGIEFILES 30 ///< Marker block: start the biggiefile section.
137#define BLK_STOP_BIGGIEFILES 39 ///< Marker block: stop the biggiefile section.
138#define BLK_START_A_NORMBIGGIE 40 ///< Marker block: start a normal biggiefile.
139#define BLK_START_A_PIHBIGGIE 41 ///< Marker block: start a ntfsprog'd biggiefile
140#define BLK_START_EXTENDED_ATTRIBUTES 45 ///< Marker block: start xattr/acl info
141#define BLK_STOP_EXTENDED_ATTRIBUTES 46 ///< Marker block: stop xattr/acl info
142#define BLK_START_EXAT_FILE 47
143#define BLK_STOP_EXAT_FILE 48
144#define BLK_STOP_A_BIGGIE 59 ///< Marker block: stop a biggiefile.
145#define BLK_START_FILE 80 ///< Marker block: start a file (non-afio or slice).
146#define BLK_STOP_FILE 89 ///< Marker block: stop a file (non-afio or slice).
147#define BLK_END_OF_TAPE 100 ///< Marker block: end of tape.
148#define BLK_END_OF_BACKUP 101 ///< Marker block: end of backup.
149#define BLK_ABORTED_BACKUP 102 ///< Marker block: backup was aborted.
150
151/// The external tape blocksize.
152#ifdef EXTTAPE
153#define TAPE_BLOCK_SIZE (long)EXTTAPE
154#else
155#define TAPE_BLOCK_SIZE 131072L /* was 8192; 06/2002-->65536; 11/2002-->131072 */
156#endif
157
158#define DEFAULT_INTERNAL_TAPE_BLOCK_SIZE 32768 // Nov 2003?
159
160
161
162
163#define SLICE_SIZE 4096 ///< The size of a slice of a biggiefile.
164
165
166
167
168
169
170/**
171 * Determine whether @p x (t_bkptype) is a streaming backup.
172 */
173#define IS_THIS_A_STREAMING_BACKUP(x) (x == tape || x == udev || x == cdstream)
174
175
176/**
177 * @c mkisofs command to generate a nonbootable CD, except for -o option and the directory to image.
178 */
179#define MONDO_MKISOFS_NONBOOT "mkisofs -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_"
180
181/**
182 * @c mkisofs command to generate a bootable CD using isolinux, except for -o option and the directory to image.
183 */
184#define MONDO_MKISOFS_REGULAR_SYSLINUX "mkisofs -J -boot-info-table -no-emul-boot -b isolinux.bin -c boot.cat -boot-load-size 4 -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_"
185
186/**
187 * @c mkisofs command to generate a bootable CD using LILO, except for -o option and the directory to image.
188 */
189#define MONDO_MKISOFS_REGULAR_LILO "mkisofs -boot-info-table -no-emul-boot -b isolinux.bin -c boot.cat -boot-load-size 4 -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_"
190
191/**
192 * @c mkisofs command to generate a bootable CD using ELILO, except for -o option and the directory to image.
193 */
194// Should replace 8192 by IA64_BOOT_SIZE
195#define MONDO_MKISOFS_REGULAR_ELILO "mkisofs -no-emul-boot -b images/mindi-bootroot.8192.img -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_"
196
197/**
198 * The stub name of the temporary ISO image to create, burn, and remove.
199 */
200#define MONDO_TMPISOS "temporary.iso"
201
202/**
203 * @c growisofs command to generate a bootable DVD using isolinux, except for the directory to image.
204 */
205#define MONDO_GROWISOFS_REGULAR_SYSLINUX "growisofs -use-the-force-luke -J -no-emul-boot -boot-load-size 4 -b isolinux.bin --boot-info-table -c boot.cat -boot-load-size 4 -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_ -v"
206
207/**
208 * @c growisofs command to generate a bootable DVD using LILO, except for the directory to image.
209 */
210#define MONDO_GROWISOFS_REGULAR_ELILO "growisofs -use-the-force-luke -no-emul-boot -b images/mindi-boot.2880.img -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
211
212/**
213 * @c growisofs command to generate a bootable DVD using LILO, except for the directory to image.
214 */
215#define MONDO_GROWISOFS_REGULAR_LILO "growisofs -no-emul-boot -b isolinux.bin -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
216
217/**
218 * @c growisofs command to generate a nonbootable DVD, except for the directory to image.
219 */
220#define MONDO_GROWISOFS_NONBOOT "growisofs -use-the-force-luke -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"
221
222/**
223 * Welcome string displayed at the top of the newt interface.
224 */
225#define WELCOME_STRING "W E L C O M E T O M O N D O R E S C U E"
226
227/**
228 * The maximum length of a filename in the tape catalog.
229 */
230#define MAX_TAPECAT_FNAME_LEN 32
231
232/**
233 * Assert that (@p x != NULL) and (@p x[0] != '\\0').
234 */
235#define assert_string_is_neither_NULL_nor_zerolength(x) {assert(x!=NULL);assert(x[0]!='\0');}
236
237/**
238 * Log the file, line, Mondo error message, and OS error message (errno).
239 */
240#define log_OS_error(x) {log_msg(0, "%s (%s)", x, strerror(errno));}
241
242/**
243 * Assert that (@p x != NULL).
244 */
245#define assert_pointer_is_not_NULL(x) {assert(x!=NULL);}
246
247/**
248 * close() @p x and log a message if it fails.
249 */
250#define paranoid_close(x) {if(close(x)) {log_msg(5, "close err");} x=-999; }
251
252/**
253 * fclose() @p x and log a message if it fails.
254 */
255#define paranoid_fclose(x) {if(fclose(x)) {log_msg(5, "fclose err");} x=NULL; }
256
257/**
258 * pclose() @p x and log a message if it fails.
259 */
260#define paranoid_pclose(x) {if(pclose(x)) {log_msg(5, "pclose err");} x=NULL; }
261
262/**
263 * Run the command @p x and log it if it fails.
264 */
265#define paranoid_system(x) {if(system(x)) log_msg(4, x); }
266
267/**
268 * Free @p x and set it to NULL.
269 */
270#define paranoid_free(x) {if (x != NULL) free(x); x=NULL;}
271
272/**
273 * Free variables and call finish(@p x).
274 */
275#define paranoid_MR_finish(x) {free_MR_global_filenames (); finish(x); }
276
277/**
278 * Yes, we want malloc() to help us fix bugs.
279 */
280#define MALLOC_CHECK_ 1
281
282/**
283 * Malloc @p x to be MAX_STR_LEN bytes and call fatal_error() if we're out of memory.
284 */
285#define malloc_string(x) { x = (char *)malloc(MAX_STR_LEN); if (!x) { fatal_error("Unable to malloc"); } x[0] = x[1] = '\0'; }
286
287/**
288 * Path to the location the hard drive is mounted on during a restore.
289 */
290#define MNT_RESTORING "/mnt/RESTORING"
291
292/** @def VANILLA_SCSI_CDROM The first SCSI CD-ROM in the system (most likely to be the one to write to). */
293/** @def VANILLA_SCSI_TAPE The first SCSI tape in the system (most likely to be the one towrite to. */
294/** @def DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE A string whose presence in a device name indicates the
295 * inability to check this device for errors in the mountlist. */
296/** @def RAID_DEVICE_STUB The stub of a RAID device (set up RAID if we find it). */
297/** @def SANE_FORMATS Sane formats for this OS, separated by spaces. */
298/** @def ALT_TAPE The first IDE tape in the system. */
299/** @def MKE2FS_OR_NEWFS @c mke2fs or @c newfs, depending on the OS. */
300/** @def CP_BIN The GNU @c cp binary to use. */
301#ifdef __FreeBSD__
302#define VANILLA_SCSI_CDROM "/dev/cd0"
303#define VANILLA_SCSI_TAPE "/dev/sa0"
304#define VANILLA_USB_DEVICE "tobegivenbybsdguru"
305#define DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE "/dev/vinum/"
306#define RAID_DEVICE_STUB DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE
307#define SANE_FORMATS "swap image msdosfs nfs ntfs ntfs-3g raid lvm ffs ufs ext2fs"
308#define ALT_TAPE "/dev/ast0"
309#define MKE2FS_OR_NEWFS "newfs"
310#define CP_BIN "gcp"
311#else
312#define VANILLA_SCSI_CDROM "/dev/scd0"
313#define VANILLA_SCSI_TAPE "/dev/st0"
314#define VANILLA_USB_DEVICE "/dev/hda"
315#define DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE "/dev/md"
316#define RAID_DEVICE_STUB DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE
317#define SANE_FORMATS "swap image vfat ext2 ext3 ext4 xfs vfs jfs reiserfs vmfs dos minix coda fuse.sshfs nfs nfs4 ntfs ntfs-3g hpfs raid lvm cifs ocfs ocfs2"
318#define ALT_TAPE "/dev/ht0"
319#define MKE2FS_OR_NEWFS "mke2fs"
320#define CP_BIN "cp"
321#endif
322
323
324/**
325 * The template for a filelist filename.
326 * The first argument (%s) is the tempdir and the second (%d) is the filelist number.
327 */
328#define FILELIST_FNAME_RAW_SZ "%s/filelist.%ld"
329
330#define XATTR_LIST_FNAME_RAW_SZ "%s/xattr_list.%ld.gz"
331#define XATTR_BIGGLST_FNAME_RAW_SZ "%s/xattr_list.big.gz"
332#define ACL_LIST_FNAME_RAW_SZ "%s/acl_list.%ld.gz"
333#define ACL_BIGGLST_FNAME_RAW_SZ "%s/acl_list.big.gz"
334
335/**
336 * The template for an afioball filename.
337 * The first argument (%s) is the tempdir and the second (%d) is the filelist number.
338 */
339#define AFIOBALL_FNAME_RAW_SZ (bkpinfo->use_star)?"%s/tmpfs/%ld.star.%s":"%s/tmpfs/%ld.afio.%s"
340#define ARCH_THREADS 2 ///< The number of simultaneous threads running afio in the background.
341#define ARCH_BUFFER_NUM (ARCH_THREADS*4) // Number of permissible queued afio files
342#define DO_MBR_PLEASE "/tmp/DO-MBR-PLEASE"
343
344
345/**
346 * Compatibility define to change log_it() calls to log_debug_msg() calls.
347 */
348#define log_it(format, args...) log_debug_msg(2, __FILE__, __FUNCTION__, __LINE__, format, ## args)
349
350/**
351 * Macro to log a message along with file, line, and function information.
352 */
353#define log_msg(level, format, args...) log_debug_msg(level, __FILE__, __FUNCTION__, __LINE__, format, ## args)
354
355#define DEFAULT_DVD_DISK_SIZE 4480 ///< The default size (in MB) of a DVD disk, unless the user says otherwise.
356
357#define DEFAULT_DEBUG_LEVEL 4 ///< By default, don't log messages with a loglevel higher than this.
358
359#define SZ_NTFSPROG_VOLSIZE "1048576" // was 4096
360#define NTFSPROG_PARAMS "-z0 -V" SZ_NTFSPROG_VOLSIZE " -o -b -d -g1"
361
362#define MNT_CDROM "/mnt/cdrom"
363#define MNT_FLOPPY "/mnt/floppy"
364
365#define DEFAULT_MR_LOGLEVEL 4
366
367#endif /* _MY_STUFF_H_ */
Note: See TracBrowser for help on using the repository browser.