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