[2235] | 1 | /*
|
---|
| 2 | * $Id$
|
---|
| 3 | *
|
---|
| 4 | * Test program for mountlist management at restore time
|
---|
| 5 | * Cn be used on host system with valgrind easier than with mondorestore
|
---|
| 6 | */
|
---|
| 7 | #include <stdio.h>
|
---|
| 8 | #include "my-stuff.h"
|
---|
| 9 | #include "mr_mem.h"
|
---|
| 10 | #include "../common/mondostructures.h"
|
---|
| 11 | #include "../common/libmondo.h"
|
---|
| 12 | #include "../mondoarchive/mondoarchive.h"
|
---|
| 13 |
|
---|
| 14 | extern void twenty_seconds_til_yikes(void);
|
---|
| 15 |
|
---|
| 16 | extern bool g_text_mode;
|
---|
| 17 | extern FILE *g_fprep;
|
---|
| 18 | extern double g_kernel_version;
|
---|
| 19 | extern int g_partition_table_locked_up;
|
---|
| 20 | extern int g_noof_rows;
|
---|
| 21 |
|
---|
[3141] | 22 | /* Whether we should fail immediately at first error */
|
---|
| 23 | bool g_fail_immediately = FALSE;
|
---|
| 24 |
|
---|
[2235] | 25 | bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */
|
---|
| 26 | bool g_I_have_just_nuked = FALSE;
|
---|
| 27 | char *g_biggielist_txt;
|
---|
| 28 | char *g_filelist_full;
|
---|
| 29 | char *g_filelist_imagedevs;
|
---|
| 30 | char *g_imagedevs_restthese;
|
---|
| 31 |
|
---|
| 32 | char *g_mondo_cfg_file;
|
---|
| 33 |
|
---|
| 34 | char *g_mountlist_fname;
|
---|
| 35 | char *g_mondo_home;
|
---|
| 36 |
|
---|
| 37 | char *g_getfacl;
|
---|
| 38 | char *g_getfattr;
|
---|
| 39 |
|
---|
[3374] | 40 | /* Reference to global bkpinfo */
|
---|
| 41 | struct s_bkpinfo *bkpinfo;
|
---|
| 42 |
|
---|
[2235] | 43 | extern char *MONDO_LOGFILE;
|
---|
[3042] | 44 | extern char *truncate_to_drive_name(const char *);
|
---|
[2235] | 45 | /* We don't have a cleanup function yet */
|
---|
| 46 | void (*mr_cleanup)(void) = NULL;
|
---|
| 47 | void free_MR_global_filenames() {
|
---|
| 48 | }
|
---|
| 49 |
|
---|
[3116] | 50 | int main() {
|
---|
[2235] | 51 |
|
---|
| 52 | char *part = NULL;
|
---|
| 53 | char *disk = NULL;
|
---|
| 54 | char *list[] = {
|
---|
| 55 | "/dev/sda99",
|
---|
| 56 | "/dev/hda12",
|
---|
| 57 | "/dev/cciss/c12d9p24",
|
---|
| 58 | "/dev/mapper/vg00lv02",
|
---|
| 59 | "/dev/mapper/dm-4",
|
---|
| 60 | "/dev/mapper/mpath4p19",
|
---|
| 61 | "/dev/mapper/part13",
|
---|
| 62 | "/dev/rd/c10d4p16",
|
---|
| 63 | "/dev/cciss/c1d12",
|
---|
| 64 | "/dev/mapper/mpath34",
|
---|
| 65 | NULL
|
---|
| 66 | };
|
---|
| 67 | int i;
|
---|
| 68 |
|
---|
[3185] | 69 | mr_asprintf(MONDO_LOGFILE,"/tmp/mrtest-truncname.log");
|
---|
[2235] | 70 |
|
---|
| 71 | /* Globals */
|
---|
| 72 | g_loglevel = 99;
|
---|
| 73 | g_text_mode = FALSE;
|
---|
| 74 | g_main_pid = getpid();
|
---|
| 75 |
|
---|
| 76 | log_it("Begin loop");
|
---|
| 77 | for (i=0; list[i] != NULL; i++) {
|
---|
| 78 | log_it("%d: partition %s ...",i, list[i]);
|
---|
[3185] | 79 | mr_asprintf(part,"%s",list[i]);
|
---|
[2235] | 80 | disk = truncate_to_drive_name(part);
|
---|
[2236] | 81 | log_it("...belongs to disk %s",disk);
|
---|
[2235] | 82 | mr_free(part);
|
---|
| 83 | }
|
---|
| 84 | log_it("end of loop");
|
---|
| 85 | mr_free(MONDO_LOGFILE);
|
---|
| 86 | exit(0);
|
---|
| 87 | }
|
---|