[2202] | 1 | #include <stdio.h>
|
---|
| 2 | #include "my-stuff.h"
|
---|
| 3 | #include "../common/mondostructures.h"
|
---|
| 4 | #include "../common/libmondo.h"
|
---|
| 5 | #include "../mondorestore/mondorestore.h"
|
---|
[2204] | 6 | #include "../mondorestore/mr-externs.h"
|
---|
[2202] | 7 |
|
---|
| 8 | extern void twenty_seconds_til_yikes(void);
|
---|
| 9 |
|
---|
| 10 | /* Reference to global bkpinfo */
|
---|
| 11 | struct s_bkpinfo *bkpinfo;
|
---|
| 12 |
|
---|
| 13 | extern bool g_text_mode;
|
---|
| 14 | extern FILE *g_fprep;
|
---|
| 15 | extern double g_kernel_version;
|
---|
| 16 | extern int g_partition_table_locked_up;
|
---|
| 17 | extern int g_noof_rows;
|
---|
| 18 |
|
---|
| 19 | bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */
|
---|
| 20 | bool g_I_have_just_nuked = FALSE;
|
---|
| 21 | char *g_isodir_device;
|
---|
| 22 | char *g_isodir_format;
|
---|
| 23 | char *g_biggielist_txt;
|
---|
| 24 | char *g_filelist_full;
|
---|
| 25 | char *g_filelist_imagedevs;
|
---|
| 26 | char *g_imagedevs_restthese;
|
---|
| 27 |
|
---|
| 28 | char *g_mondo_cfg_file;
|
---|
| 29 |
|
---|
| 30 | char *g_mountlist_fname;
|
---|
| 31 | char *g_mondo_home;
|
---|
| 32 |
|
---|
| 33 | char *g_getfacl;
|
---|
| 34 | char *g_getfattr;
|
---|
| 35 |
|
---|
| 36 | extern char *MONDO_LOGFILE;
|
---|
[2209] | 37 | extern int copy_from_src_to_dest(FILE * f_orig, FILE * f_archived, char direction);
|
---|
| 38 | /* We don't have a cleanup function yet */
|
---|
| 39 | void (*mr_cleanup)(void) = NULL;
|
---|
[2202] | 40 |
|
---|
| 41 | void main() {
|
---|
| 42 |
|
---|
| 43 | struct mountlist_itself *mountlist = NULL;
|
---|
[2204] | 44 | struct raidlist_itself *raidlist;
|
---|
| 45 |
|
---|
[2202] | 46 | asprintf(&MONDO_LOGFILE,"/tmp/mrtest-mountlist.log");
|
---|
| 47 |
|
---|
[2206] | 48 | /* Globals */
|
---|
[2202] | 49 | g_loglevel = 99;
|
---|
| 50 | g_text_mode = FALSE;
|
---|
[2206] | 51 | g_main_pid = getpid();
|
---|
| 52 |
|
---|
[2202] | 53 | if (!(mountlist = malloc(sizeof(struct mountlist_itself)))) {
|
---|
| 54 | fatal_error("Cannot malloc mountlist");
|
---|
| 55 | }
|
---|
[2204] | 56 | if (!(raidlist = malloc(sizeof(struct raidlist_itself)))) {
|
---|
| 57 | fatal_error("Cannot malloc raidlist");
|
---|
| 58 | }
|
---|
[2202] | 59 | malloc_libmondo_global_strings();
|
---|
| 60 |
|
---|
| 61 | setup_newt_stuff();
|
---|
| 62 | asprintf(&g_mountlist_fname, "/tmp/mountlist.txt");
|
---|
[2206] | 63 | log_it("before mountlist");
|
---|
[2202] | 64 | load_mountlist(mountlist, g_mountlist_fname);
|
---|
[2206] | 65 | log_it("after mountlist");
|
---|
[2204] | 66 | resize_mountlist_proportionately_to_suit_new_drives(mountlist);
|
---|
[2206] | 67 | log_it("after resize_mountlist_proportionately_to_suit_new_drives");
|
---|
[2204] | 68 | load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
|
---|
[2206] | 69 | log_it("after load_raidtab_into_raidlist");
|
---|
[2204] | 70 | edit_mountlist(g_mountlist_fname, mountlist, raidlist);
|
---|
[2206] | 71 | log_it("after edit_mountlist");
|
---|
[2204] | 72 | exit(0);
|
---|
[2202] | 73 | }
|
---|