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