Changeset 1663 in MondoRescue for branches/stable/mondo/src/mondorestore
- Timestamp:
- Sep 27, 2007, 12:21:18 PM (17 years ago)
- Location:
- branches/stable/mondo/src/mondorestore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondorestore/mondo-restore-EXT.h
r1213 r1663 25 25 26 26 extern void ask_about_these_imagedevs(char *, char *); 27 extern int catchall_mode(struct s_bkpinfo *, structmountlist_itself *,27 extern int catchall_mode(struct mountlist_itself *, 28 28 struct raidlist_itself *); 29 29 extern void sort_mountlist_by_device(struct mountlist_itself *); 30 extern int interactive_mode(struct s_bkpinfo *, structmountlist_itself *,30 extern int interactive_mode(struct mountlist_itself *, 31 31 struct raidlist_itself *); 32 extern int nuke_mode(struct s_bkpinfo *, structmountlist_itself *,32 extern int nuke_mode(struct mountlist_itself *, 33 33 struct raidlist_itself *); 34 extern int compare_mode(struct s_bkpinfo *, structmountlist_itself *,34 extern int compare_mode(struct mountlist_itself *, 35 35 struct raidlist_itself *); 36 extern int iso_mode( struct s_bkpinfo *bkpinfo,36 extern int iso_mode( 37 37 struct mountlist_itself *mountlist, 38 38 struct raidlist_itself *raidlist, bool nuke_me_please); 39 39 extern int load_mountlist(struct mountlist_itself *, char *); 40 40 extern int load_raidtab_into_raidlist(struct raidlist_itself *, char *); 41 extern int restore_mode(struct s_bkpinfo *, structmountlist_itself *,41 extern int restore_mode(struct mountlist_itself *, 42 42 struct raidlist_itself *); 43 43 extern int save_raidlist_to_raidtab(struct raidlist_itself *, char *); 44 44 extern void process_raidtab_line(FILE *, struct raid_device_record *, 45 45 char *, char *); 46 extern int restore_a_biggiefile_from_CD( struct s_bkpinfo *,long,46 extern int restore_a_biggiefile_from_CD(long, 47 47 struct s_node *); 48 extern int restore_a_biggiefile_from_stream( struct s_bkpinfo *,char *,48 extern int restore_a_biggiefile_from_stream(char *, 49 49 long, char *, long long, 50 50 struct s_node *); 51 51 extern int restore_a_tarball_from_CD(char *, int, struct s_node *, struct s_bkpinfo *); 52 extern int restore_a_tarball_from_stream( struct s_bkpinfo *,char *, int,52 extern int restore_a_tarball_from_stream(char *, int, 53 53 struct s_node *, long long); 54 extern int restore_all_biggiefiles_from_CD( struct s_bkpinfo *,54 extern int restore_all_biggiefiles_from_CD( 55 55 struct s_node *); 56 extern int restore_all_biggiefiles_from_stream( struct s_bkpinfo *,56 extern int restore_all_biggiefiles_from_stream( 57 57 struct s_node *); 58 extern int restore_all_tarballs_from_CD( struct s_bkpinfo *,58 extern int restore_all_tarballs_from_CD( 59 59 struct s_node *); 60 extern int restore_all_tarballs_from_stream( struct s_bkpinfo *,60 extern int restore_all_tarballs_from_stream( 61 61 struct s_node *); 62 extern int restore_everything(struct s_ bkpinfo *, struct s_node *);63 extern int restore_live_from_monitas_server( struct s_bkpinfo *,char *,62 extern int restore_everything(struct s_node *); 63 extern int restore_live_from_monitas_server(char *, 64 64 char *, char *); 65 extern int restore_to_live_filesystem( struct s_bkpinfo *);65 extern int restore_to_live_filesystem(); 66 66 extern void swap_mountlist_entries(struct mountlist_itself *, int, int); 67 67 extern void sort_mountlist_by_mountpoint(struct mountlist_itself *, bool); … … 74 74 extern int save_raidlist_to_raidtab(struct raidlist_itself *raidlist, 75 75 char *fname); 76 extern int what_number_cd_is_this( struct s_bkpinfo *);76 extern int what_number_cd_is_this(); 77 77 78 78 #ifdef __FreeBSD__ -
branches/stable/mondo/src/mondorestore/mondo-restore.h
r1200 r1663 8 8 9 9 void ask_about_these_imagedevs(char *, char *); 10 int catchall_mode(struct s_bkpinfo *, structmountlist_itself *,10 int catchall_mode(struct mountlist_itself *, 11 11 struct raidlist_itself *); 12 int interactive_mode(struct s_bkpinfo *, structmountlist_itself *,12 int interactive_mode(struct mountlist_itself *, 13 13 struct raidlist_itself *); 14 int nuke_mode(struct s_bkpinfo *, structmountlist_itself *,14 int nuke_mode(struct mountlist_itself *, 15 15 struct raidlist_itself *); 16 int compare_mode(struct s_bkpinfo *, structmountlist_itself *,16 int compare_mode(struct mountlist_itself *, 17 17 struct raidlist_itself *); 18 int iso_mode(struct s_bkpinfo *bkpinfo, structmountlist_itself *mountlist,18 int iso_mode(struct mountlist_itself *mountlist, 19 19 struct raidlist_itself *raidlist, bool nuke_me_please); 20 int restore_mode(struct s_bkpinfo *, structmountlist_itself *,20 int restore_mode(struct mountlist_itself *, 21 21 struct raidlist_itself *); 22 int restore_a_biggiefile_from_CD( struct s_bkpinfo *,long, struct s_node *,22 int restore_a_biggiefile_from_CD(long, struct s_node *, 23 23 char *); 24 int restore_a_biggiefile_from_stream( struct s_bkpinfo *,char *, long,24 int restore_a_biggiefile_from_stream(char *, long, 25 25 char *, long long, struct s_node *, 26 26 int, char *); 27 27 int restore_a_tarball_from_CD(char *, long, struct s_node *, struct s_bkpinfo *); 28 int restore_a_tarball_from_stream( struct s_bkpinfo *,char *, long,28 int restore_a_tarball_from_stream(char *, long, 29 29 struct s_node *, long long, char *, 30 30 char *); 31 int restore_all_biggiefiles_from_CD(struct s_ bkpinfo *, struct s_node *);32 int restore_all_biggiefiles_from_stream( struct s_bkpinfo *,31 int restore_all_biggiefiles_from_CD(struct s_node *); 32 int restore_all_biggiefiles_from_stream( 33 33 struct s_node *); 34 int restore_all_tarballs_from_CD(struct s_ bkpinfo *, struct s_node *);35 int restore_all_tarballs_from_stream(struct s_ bkpinfo *, struct s_node *);36 int restore_everything(struct s_ bkpinfo *, struct s_node *);37 int restore_live_from_monitas_server( struct s_bkpinfo *,char *, char *,34 int restore_all_tarballs_from_CD(struct s_node *); 35 int restore_all_tarballs_from_stream(struct s_node *); 36 int restore_everything(struct s_node *); 37 int restore_live_from_monitas_server(char *, char *, 38 38 char *); 39 int restore_to_live_filesystem( struct s_bkpinfo *);39 int restore_to_live_filesystem(); 40 40 void swap_mountlist_entries(struct mountlist_itself *, int, int); 41 41 void sort_mountlist_by_mountpoint(struct mountlist_itself *, bool); 42 42 void sort_mountlist_by_device(struct mountlist_itself *); 43 int what_number_cd_is_this( struct s_bkpinfo *);43 int what_number_cd_is_this(); -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare-EXT.h
r1200 r1663 4 4 5 5 6 extern int compare_to_CD(struct s_bkpinfo *); 7 extern int compare_to_cdstream(struct s_bkpinfo *); 8 extern int compare_to_tape(struct s_bkpinfo *); 9 extern int compare_mode(struct s_bkpinfo *bkpinfo, 10 struct mountlist_itself *mountlist, 6 extern int compare_to_CD(); 7 extern int compare_to_cdstream(); 8 extern int compare_to_tape(); 9 extern int compare_mode(struct mountlist_itself *mountlist, 11 10 struct raidlist_itself *raidlist); -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c
r1638 r1663 19 19 extern char *MONDO_LOGFILE; 20 20 21 /* Reference to global bkpinfo */ 22 extern struct s_bkpinfo *bkpinfo; 23 21 24 //static char cvsid[] = "$Id$"; 22 25 … … 34 37 * @note This function uses an MD5 checksum. 35 38 */ 36 int compare_a_biggiefile( struct s_bkpinfo *bkpinfo,long bigfileno)39 int compare_a_biggiefile(long bigfileno) 37 40 { 38 41 … … 58 61 if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) { 59 62 if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { 60 insist_on_this_cd_number( bkpinfo,(++g_current_media_number));63 insist_on_this_cd_number((++g_current_media_number)); 61 64 } else { 62 65 mr_msg(2, "No CD's left. No biggiefiles left. No problem."); … … 133 136 134 137 if (retval) { 135 if (!(fout = fopen( "/tmp/changed.txt", "a"))) {138 if (!(fout = fopen(MINDI_CACHE"/changed.txt", "a"))) { 136 139 fatal_error("Cannot openout changed.txt"); 137 140 } … … 151 154 /** 152 155 * Compare all biggiefiles in the backup. 153 * @param bkpinfo The backup information structure. Used only in compare_a_biggiefile().154 156 * @return 0 for success, nonzero for failure. 155 157 */ 156 int compare_all_biggiefiles( struct s_bkpinfo *bkpinfo)158 int compare_all_biggiefiles() 157 159 { 158 160 int retval = 0; … … 161 163 char *tmp = NULL; 162 164 163 assert(bkpinfo != NULL);164 165 mr_msg(1, "Comparing biggiefiles"); 165 166 … … 187 188 mr_free(tmp); 188 189 189 res = compare_a_biggiefile(b kpinfo, bigfileno);190 res = compare_a_biggiefile(bigfileno); 190 191 retval += res; 191 192 g_current_progress++; … … 303 304 if (length_of_file(logfile) > 5) { 304 305 mr_asprintf(&command, 305 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> /tmp/changed.txt",306 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MINDI_CACHE"/changed.txt", 306 307 logfile); 307 308 system(command); … … 330 331 * @return 0 for success, nonzero for failure. 331 332 */ 332 int compare_all_tarballs( struct s_bkpinfo *bkpinfo)333 int compare_all_tarballs() 333 334 { 334 335 int retval = 0; … … 361 362 362 363 for (;;) { 363 insist_on_this_cd_number( bkpinfo,g_current_media_number);364 insist_on_this_cd_number(g_current_media_number); 364 365 update_progress_form(progress_str); 365 366 mr_asprintf(&tarball_fname, … … 441 442 * @return 0 for success, nonzero for failure. 442 443 */ 443 int compare_to_CD( struct s_bkpinfo *bkpinfo)444 int compare_to_CD() 444 445 { 445 446 /** needs malloc *********/ … … 460 461 chdir(bkpinfo->restore_path); 461 462 getcwd(new, MAX_STR_LEN - 1); 462 insist_on_this_cd_number( bkpinfo,g_current_media_number);463 unlink( "/tmp/changed.txt");464 465 resA = compare_all_tarballs( bkpinfo);466 resB = compare_all_biggiefiles( bkpinfo);463 insist_on_this_cd_number(g_current_media_number); 464 unlink(MINDI_CACHE"/changed.txt"); 465 466 resA = compare_all_tarballs(); 467 resB = compare_all_biggiefiles(); 467 468 chdir(cwd); 468 noof_changed_files = count_lines_in_file( "/tmp/changed.txt");469 noof_changed_files = count_lines_in_file(MINDI_CACHE"/changed.txt"); 469 470 if (noof_changed_files) { 470 471 log_to_screen(_("%ld files do not match the backup "), 471 472 noof_changed_files); 472 mr_asprintf(&command, "cat /tmp/changed.txt >> %s", MONDO_LOGFILE);473 mr_asprintf(&command, "cat "MINDI_CACHE"/changed.txt >> %s", MONDO_LOGFILE); 473 474 paranoid_system(command); 474 475 mr_free(command); … … 501 502 */ 502 503 int 503 compare_mode(struct s_bkpinfo *bkpinfo, 504 struct mountlist_itself *mountlist, 504 compare_mode(struct mountlist_itself *mountlist, 505 505 struct raidlist_itself *raidlist) 506 506 { … … 522 522 assert(raidlist != NULL); 523 523 524 while (get_cfg_file_from_archive( bkpinfo)) {524 while (get_cfg_file_from_archive()) { 525 525 if (!ask_me_yes_or_no 526 526 (_ … … 529 529 fatal_error("Unable to find config file/archives. Aborting."); 530 530 } 531 interactively_obtain_media_parameters_from_user( bkpinfo,FALSE);532 } 533 534 read_cfg_file_into_bkpinfo(g_mondo_cfg_file , bkpinfo);531 interactively_obtain_media_parameters_from_user(FALSE); 532 } 533 534 read_cfg_file_into_bkpinfo(g_mondo_cfg_file); 535 535 g_current_media_number = 1; 536 536 mvaddstr_and_log_it(1, 30, _("Comparing Automatically")); … … 544 544 if (bkpinfo->backup_media_type == tape 545 545 || bkpinfo->backup_media_type == udev) { 546 retval += compare_to_tape( bkpinfo);546 retval += compare_to_tape(); 547 547 } else if (bkpinfo->backup_media_type == cdstream) { 548 retval += compare_to_cdstream( bkpinfo);549 } else { 550 retval += compare_to_CD( bkpinfo);548 retval += compare_to_cdstream(); 549 } else { 550 retval += compare_to_CD(); 551 551 } 552 552 if (retval) { … … 557 557 } 558 558 559 if (count_lines_in_file( "/tmp/changed.txt") > 0) {559 if (count_lines_in_file(MINDI_CACHE"/changed.txt") > 0) { 560 560 mvaddstr_and_log_it(g_currentY++, 0, 561 561 _ 562 562 ("Differences found while files were being compared.")); 563 streamline_changes_file( "/tmp/changed.files", "/tmp/changed.txt");564 if (count_lines_in_file( "/tmp/changed.files") <= 0) {563 streamline_changes_file(MINDI_CACHE"/changed.files", MINDI_CACHE"/changed.txt"); 564 if (count_lines_in_file(MINDI_CACHE"/changed.files") <= 0) { 565 565 mvaddstr_and_log_it(g_currentY++, 0, 566 566 _ … … 569 569 ("The differences were logfiles and temporary files. Your archives are fine.")); 570 570 } else { 571 q = count_lines_in_file( "/tmp/changed.files");571 q = count_lines_in_file(MINDI_CACHE"/changed.files"); 572 572 mr_asprintf(&tmp, _("%ld significant difference%s found."), q, 573 573 (q != 1) ? "s" : ""); … … 586 586 chdir(bkpinfo->restore_path); 587 587 getcwd(new, MAX_STR_LEN - 1); 588 popup_changelist_from_file( "/tmp/changed.files");588 popup_changelist_from_file(MINDI_CACHE"/changed.files"); 589 589 mr_msg(2, "Returning from popup_changelist_from_file()"); 590 590 chdir(cwd); … … 616 616 * @return 0 for success, nonzero for failure. 617 617 */ 618 int compare_to_cdstream( struct s_bkpinfo *bkpinfo)618 int compare_to_cdstream() 619 619 { 620 620 int res; … … 642 642 last_line_of_file("/tmp/CDROM-LIVES-HERE")); 643 643 } 644 res = verify_tape_backups( bkpinfo);644 res = verify_tape_backups(); 645 645 chdir(dir); 646 if (length_of_file( "/tmp/changed.txt") > 2647 && length_of_file( "/tmp/changed.files") > 2) {646 if (length_of_file(MINDI_CACHE"/changed.txt") > 2 647 && length_of_file(MINDI_CACHE"/changed.files") > 2) { 648 648 mr_msg(0, 649 "Type 'less /tmp/changed.files' to see which files don't match the archives");649 "Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives"); 650 650 mr_msg(2, "Calling popup_changelist_from_file()"); 651 popup_changelist_from_file( "/tmp/changed.files");651 popup_changelist_from_file(MINDI_CACHE"/changed.files"); 652 652 mr_msg(2, "Returned from popup_changelist_from_file()"); 653 653 } … … 674 674 * returns: int * 675 675 **************************************************************************/ 676 int compare_to_tape( struct s_bkpinfo *bkpinfo)676 int compare_to_tape() 677 677 { 678 678 int res = 0; … … 692 692 mvaddstr_and_log_it(g_currentY, 693 693 0, _("Verifying archives against filesystem")); 694 res = verify_tape_backups( bkpinfo);694 res = verify_tape_backups(); 695 695 chdir(dir); 696 696 if (res) { -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare.h
r1200 r1663 4 4 5 5 6 int compare_to_CD( struct s_bkpinfo *);7 int compare_to_cdstream( struct s_bkpinfo *);8 int compare_to_tape( struct s_bkpinfo *);6 int compare_to_CD(); 7 int compare_to_cdstream(); 8 int compare_to_tape(); 9 9 10 10 int 11 compare_mode(struct s_bkpinfo *bkpinfo, 12 struct mountlist_itself *mountlist, 11 compare_mode(struct mountlist_itself *mountlist, 13 12 struct raidlist_itself *raidlist); -
branches/stable/mondo/src/mondorestore/mondo-rstr-newt.c
r1555 r1663 26 26 27 27 extern char err_log_lines[NOOF_ERR_LINES][MAX_STR_LEN]; 28 29 28 30 29 /** -
branches/stable/mondo/src/mondorestore/mondo-rstr-newt.h
r1297 r1663 43 43 extern struct s_node *find_node_in_filelist(struct s_node *, 44 44 char *filename); 45 extern int what_number_cd_is_this( struct s_bkpinfo *);45 extern int what_number_cd_is_this(); 46 46 //extern void fatal_error (char *); 47 47 extern void sort_mountlist_by_device(struct mountlist_itself *); -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools-EXT.h
r1580 r1663 4 4 5 5 extern void free_MR_global_filenames(void); 6 extern void get_cfg_file_from_archive_or_bust( struct s_bkpinfo *);6 extern void get_cfg_file_from_archive_or_bust(); 7 7 extern bool is_file_in_list(char *, char *, char *); /* needle, haystack, preamble */ 8 extern int iso_fiddly_bits( struct s_bkpinfo *bkpinfo,bool nuke_me_please);8 extern int iso_fiddly_bits(bool nuke_me_please); 9 9 extern void kill_petris(void); 10 extern int mount_cdrom( struct s_bkpinfo *bkpinfo);10 extern int mount_cdrom(); 11 11 extern int mount_all_devices(struct mountlist_itself *, bool); 12 12 extern void protect_against_braindead_sysadmins(void); 13 extern int read_cfg_file_into_bkpinfo(char *cfg_file, 14 struct s_bkpinfo *bkpinfo); 15 struct s_node *process_filelist_and_biggielist(struct s_bkpinfo *); 13 extern int read_cfg_file_into_bkpinfo(char *cfg_file); 14 struct s_node *process_filelist_and_biggielist(); 16 15 extern int backup_crucial_file(char *path_root, char *filename); 17 16 extern int run_boot_loader(bool); … … 24 23 extern void streamline_changes_file(char *, char *); 25 24 extern void set_signals(int on); 26 extern void setup_MR_global_filenames( struct s_bkpinfo *bkpinfo);25 extern void setup_MR_global_filenames(); 27 26 extern void terminate_daemon(int); 28 27 extern void termination_in_progress(int); 29 28 extern int unmount_all_devices(struct mountlist_itself *); 30 extern int get_cfg_file_from_archive( struct s_bkpinfo *bkpinfo);29 extern int get_cfg_file_from_archive(); 31 30 extern int 32 extract_config_file_from_ramdisk( struct s_bkpinfo *bkpinfo,31 extract_config_file_from_ramdisk( 33 32 char *ramdisk_fname, 34 33 char *output_cfg_file, -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1639 r1663 49 49 extern char *MONDO_LOGFILE; 50 50 51 /* Reference to global bkpinfo */ 52 extern struct s_bkpinfo *bkpinfo; 53 51 54 /* Should we use or not extended attributes and acl when restoring */ 52 55 char *g_getfattr = NULL; … … 141 144 */ 142 145 int 143 extract_config_file_from_ramdisk(struct s_bkpinfo *bkpinfo, 144 char *ramdisk_fname, 145 char *output_cfg_file, 146 char *output_mountlist_file) 146 extract_config_file_from_ramdisk(char *ramdisk_fname, 147 char *output_cfg_file, 148 char *output_mountlist_file) 147 149 { 148 150 char *mountpt = NULL; … … 211 213 /** 212 214 * Keep trying to get mondo-restore.cfg from the archive, until the user gives up. 213 * @param bkpinfo The backup information structure. 214 */ 215 void get_cfg_file_from_archive_or_bust(struct s_bkpinfo *bkpinfo) 216 { 217 while (get_cfg_file_from_archive(bkpinfo)) { 215 */ 216 void get_cfg_file_from_archive_or_bust() 217 { 218 while (get_cfg_file_from_archive()) { 218 219 if (!ask_me_yes_or_no 219 220 (_ … … 222 223 fatal_error("Could not find config file/archives. Aborting."); 223 224 } 224 interactively_obtain_media_parameters_from_user( bkpinfo,FALSE);225 interactively_obtain_media_parameters_from_user(FALSE); 225 226 } 226 227 } … … 285 286 * @return 0 for success, nonzero for failure. 286 287 */ 287 int iso_fiddly_bits( struct s_bkpinfo *bkpinfo,bool nuke_me_please)288 int iso_fiddly_bits(bool nuke_me_please) 288 289 { 289 290 char *mount_isodir_command = NULL; … … 341 342 } 342 343 if (!IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 343 mount_cdrom( bkpinfo);344 } 345 i = what_number_cd_is_this( bkpinfo); /* has the side-effect of calling mount_cdrom() */344 mount_cdrom(); 345 } 346 i = what_number_cd_is_this(); /* has the side-effect of calling mount_cdrom() */ 346 347 mr_msg(1, "%s #%d has been mounted via loopback mount", 347 348 bkpinfo->backup_media_string, i); … … 601 602 * @return 0 for success, nonzero for failure. 602 603 */ 603 int mount_cdrom( struct s_bkpinfo *bkpinfo)604 int mount_cdrom() 604 605 { 605 606 char *mount_cmd = NULL; … … 750 751 * @return 0 for success, nonzero for failure. 751 752 */ 752 int read_cfg_file_into_bkpinfo(char *cfgf , struct s_bkpinfo *bkpinfo)753 int read_cfg_file_into_bkpinfo(char *cfgf) 753 754 { 754 755 char *value = NULL; … … 1019 1020 mr_asprintf(&iso_mnt, ""); 1020 1021 mr_asprintf(&iso_path, ""); 1021 if (mount_cdrom( bkpinfo)) {1022 if (mount_cdrom()) { 1022 1023 fatal_error 1023 1024 ("Unable to mount isodir. Failed to mount CD-ROM as well."); … … 1043 1044 mr_msg(2, 1044 1045 "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)"); 1045 interactively_obtain_media_parameters_from_user( bkpinfo,FALSE);1046 interactively_obtain_media_parameters_from_user(FALSE); 1046 1047 media_specified_by_user = bkpinfo->backup_media_type; 1047 get_cfg_file_from_archive( bkpinfo);1048 get_cfg_file_from_archive(); 1048 1049 } 1049 1050 } … … 1072 1073 */ 1073 1074 struct 1074 s_node *process_filelist_and_biggielist( struct s_bkpinfo *bkpinfo)1075 s_node *process_filelist_and_biggielist() 1075 1076 { 1076 1077 struct s_node *filelist = NULL; … … 1115 1116 "Calling insist_on_this_cd_number; bkpinfo->isodir=%s", 1116 1117 bkpinfo->isodir); 1117 insist_on_this_cd_number( bkpinfo,1);1118 insist_on_this_cd_number(1); 1118 1119 mr_msg(2, "Back from iotcn"); 1119 1120 run_program_and_log_output("mount", 1); … … 1125 1126 FILELIST_FULL_STUB, 1126 1127 "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1127 1128 1128 mr_msg(1, "tarcommand = %s", command); 1129 1129 run_program_and_log_output(command, 1); … … 1790 1790 * - @c bkpinfo->disaster_recovery 1791 1791 */ 1792 void setup_MR_global_filenames( struct s_bkpinfo *bkpinfo)1792 void setup_MR_global_filenames() 1793 1793 { 1794 1794 char *temppath; … … 2081 2081 * @return 0 for success, nonzero for failure. 2082 2082 */ 2083 int get_cfg_file_from_archive( struct s_bkpinfo *bkpinfo)2083 int get_cfg_file_from_archive() 2084 2084 { 2085 2085 int retval = 0; … … 2125 2125 } else { 2126 2126 mr_msg(2, "gcffa --- calling mount_cdrom now :)"); 2127 if (!mount_cdrom( bkpinfo)) {2127 if (!mount_cdrom()) { 2128 2128 mr_msg(2, 2129 2129 "gcffa --- managed to mount CD; so, no need for Plan B"); … … 2132 2132 try_plan_B = TRUE; 2133 2133 } 2134 if (what_number_cd_is_this(bkpinfo) > 1) { 2135 insist_on_this_cd_number(bkpinfo, 2136 (g_current_media_number = 1)); 2134 if (what_number_cd_is_this() > 1) { 2135 insist_on_this_cd_number((g_current_media_number = 1)); 2137 2136 } 2138 2137 } -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.h
r1580 r1663 4 4 5 5 void free_global_filenames(void); 6 void get_cfg_file_from_archive_or_bust( struct s_bkpinfo *);6 void get_cfg_file_from_archive_or_bust(); 7 7 bool is_file_in_list(char *, char *, char *); /* needle, haystack, preamble */ 8 int iso_fiddly_bits( struct s_bkpinfo *bkpinfo,bool nuke_me_please);8 int iso_fiddly_bits(bool nuke_me_please); 9 9 void kill_petris(void); 10 int mount_cdrom( struct s_bkpinfo *bkpinfo);10 int mount_cdrom(); 11 11 int mount_device(char *, char *, char *, bool); 12 12 int mount_all_devices(struct mountlist_itself *, bool); 13 13 void protect_against_braindead_sysadmins(void); 14 int read_cfg_file_into_bkpinfo(char *cfg_file , struct s_bkpinfo *bkpinfo);15 struct s_node *process_filelist_and_biggielist( struct s_bkpinfo *);14 int read_cfg_file_into_bkpinfo(char *cfg_file); 15 struct s_node *process_filelist_and_biggielist(); 16 16 int backup_crucial_file(char *path_root, char *filename); 17 17 … … 24 24 void streamline_changes_file(char *, char *); 25 25 void set_signals(int on); 26 void setup_global_filenames( struct s_bkpinfo *bkpinfo);26 void setup_global_filenames(); 27 27 void twenty_seconds_til_yikes(void); 28 28 int run_raw_mbr(bool offer_to_hack_scripts, char *bd); … … 30 30 void termination_in_progress(int); 31 31 int unmount_all_devices(struct mountlist_itself *); 32 int get_cfg_file_from_archive( struct s_bkpinfo *bkpinfo);32 int get_cfg_file_from_archive(); 33 33 void ask_about_these_imagedevs(char *infname, char *outfname); -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1639 r1663 35 35 36 36 extern void twenty_seconds_til_yikes(void); 37 38 /* Reference to global bkpinfo */ 39 struct s_bkpinfo *bkpinfo; 37 40 38 41 /* For use in other programs (ex. XMondo) */ … … 205 208 * @ingroup restoreGuiGroup 206 209 */ 207 int let_user_edit_the_mountlist(struct s_bkpinfo *bkpinfo, 208 struct mountlist_itself *mountlist, 210 int let_user_edit_the_mountlist(struct mountlist_itself *mountlist, 209 211 struct raidlist_itself *raidlist) 210 212 { … … 306 308 */ 307 309 int 308 catchall_mode(struct s_bkpinfo *bkpinfo, 309 struct mountlist_itself *mountlist, 310 catchall_mode(struct mountlist_itself *mountlist, 310 311 struct raidlist_itself *raidlist) 311 312 { … … 321 322 iamhere("post wrm"); 322 323 if (c == 'I' || c == 'N' || c == 'C') { 323 interactively_obtain_media_parameters_from_user( bkpinfo,FALSE);324 interactively_obtain_media_parameters_from_user(FALSE); 324 325 } else { 325 326 popup_and_OK(_("No restoring or comparing will take place today.")); … … 338 339 339 340 if (bkpinfo->backup_media_type == iso) { 340 if (iso_fiddly_bits( bkpinfo,(c == 'N') ? TRUE : FALSE)) {341 if (iso_fiddly_bits((c == 'N') ? TRUE : FALSE)) { 341 342 mr_msg(2, 342 343 "catchall_mode --- iso_fiddly_bits returned w/ error"); … … 349 350 if (c == 'I') { 350 351 mr_msg(2, "IM selected"); 351 retval += interactive_mode( bkpinfo,mountlist, raidlist);352 retval += interactive_mode(mountlist, raidlist); 352 353 } else if (c == 'N') { 353 354 mr_msg(2, "NM selected"); 354 retval += nuke_mode( bkpinfo,mountlist, raidlist);355 retval += nuke_mode(mountlist, raidlist); 355 356 } else if (c == 'C') { 356 357 mr_msg(2, "CM selected"); 357 retval += compare_mode( bkpinfo,mountlist, raidlist);358 retval += compare_mode(mountlist, raidlist); 358 359 } 359 360 return (retval); … … 368 369 **************************************************************************/ 369 370 370 static void clean_blkid( struct s_bkpinfo *bkpinfo) {371 static void clean_blkid() { 371 372 372 373 char *tmp1 = NULL; … … 396 397 */ 397 398 int 398 interactive_mode(struct s_bkpinfo *bkpinfo, 399 struct mountlist_itself *mountlist, 399 interactive_mode(struct mountlist_itself *mountlist, 400 400 struct raidlist_itself *raidlist) 401 401 { … … 434 434 435 435 iamhere("About to load config file"); 436 get_cfg_file_from_archive_or_bust( bkpinfo);437 read_cfg_file_into_bkpinfo(g_mondo_cfg_file , bkpinfo);436 get_cfg_file_from_archive_or_bust(); 437 read_cfg_file_into_bkpinfo(g_mondo_cfg_file); 438 438 iamhere("Done loading config file; resizing ML"); 439 439 mr_asprintf(&tmp,bkpinfo->prefix); … … 560 560 { 561 561 mr_msg(1, "Restoring all data"); 562 retval += restore_everything( bkpinfo,NULL);562 retval += restore_everything(NULL); 563 563 } else if ((restore_all = 564 564 ask_me_yes_or_no … … 567 567 for (done = FALSE; !done;) { 568 568 unlink("/tmp/filelist.full"); 569 filelist = process_filelist_and_biggielist( bkpinfo);569 filelist = process_filelist_and_biggielist(); 570 570 /* Now you have /tmp/tmpfs/filelist.restore-these and /tmp/tmpfs/biggielist.restore-these; 571 571 the former is a list of regular files; the latter, biggiefiles and imagedevs. … … 587 587 strcpy(bkpinfo->restore_path, tmp1); 588 588 mr_msg(1, "Restoring subset"); 589 retval += restore_everything( bkpinfo,filelist);589 retval += restore_everything(filelist); 590 590 free_filelist(filelist); 591 591 } else { … … 622 622 } 623 623 624 clean_blkid( bkpinfo);624 clean_blkid(); 625 625 protect_against_braindead_sysadmins(); 626 626 retval += unmount_all_devices(mountlist); … … 671 671 * Run an arbitrary restore mode (prompt the user), but from ISO images 672 672 * instead of real media. 673 * @param bkpinfo The backup information structure. Most fields are used.674 673 * @param mountlist The mountlist containing information about the user's partitions. 675 674 * @param raidlist The raidlist that goes with @p mountlist. … … 678 677 */ 679 678 int 680 iso_mode(struct s_bkpinfo *bkpinfo, 681 struct mountlist_itself *mountlist, 679 iso_mode(struct mountlist_itself *mountlist, 682 680 struct raidlist_itself *raidlist, bool nuke_me_please) 683 681 { … … 685 683 int retval = 0; 686 684 687 assert(bkpinfo != NULL);688 685 assert(mountlist != NULL); 689 686 assert(raidlist != NULL); 690 if (iso_fiddly_bits( bkpinfo,nuke_me_please)) {687 if (iso_fiddly_bits(nuke_me_please)) { 691 688 mr_msg(1, "iso_mode --- returning w/ error"); 692 689 return (1); … … 694 691 c = which_restore_mode(); 695 692 if (c == 'I' || c == 'N' || c == 'C') { 696 interactively_obtain_media_parameters_from_user(bkpinfo, 697 FALSE); 693 interactively_obtain_media_parameters_from_user(FALSE); 698 694 } 699 695 if (c == 'I') { 700 retval += interactive_mode( bkpinfo,mountlist, raidlist);696 retval += interactive_mode(mountlist, raidlist); 701 697 } else if (c == 'N') { 702 retval += nuke_mode( bkpinfo,mountlist, raidlist);698 retval += nuke_mode(mountlist, raidlist); 703 699 } else if (c == 'C') { 704 retval += compare_mode( bkpinfo,mountlist, raidlist);700 retval += compare_mode(mountlist, raidlist); 705 701 } else { 706 702 log_to_screen(_("OK, I shan't restore/compare any files.")); … … 761 757 */ 762 758 int 763 nuke_mode(struct s_bkpinfo *bkpinfo, 764 struct mountlist_itself *mountlist, 759 nuke_mode(struct mountlist_itself *mountlist, 765 760 struct raidlist_itself *raidlist) 766 761 { … … 778 773 mr_msg(2, "nuke_mode --- starting"); 779 774 780 get_cfg_file_from_archive_or_bust( bkpinfo);775 get_cfg_file_from_archive_or_bust(); 781 776 load_mountlist(mountlist, g_mountlist_fname); // in case read_cfg_file_into_bkpinfo updated the mountlist 782 777 #ifdef __FreeBSD__ … … 796 791 if (ask_me_yes_or_no(tmp)) { 797 792 mr_free(tmp); 798 retval = interactive_mode( bkpinfo,mountlist, raidlist);793 retval = interactive_mode(mountlist, raidlist); 799 794 call_me_after_the_nuke(retval); 800 795 return(retval); … … 852 847 853 848 if (ask_me_yes_or_no(_("Try in interactive mode instead?"))) { 854 retval = interactive_mode( bkpinfo,mountlist, raidlist);849 retval = interactive_mode(mountlist, raidlist); 855 850 call_me_after_the_nuke(retval); 856 851 return(retval); … … 869 864 } 870 865 iamhere("Restoring everything"); 871 retval += restore_everything( bkpinfo,NULL);866 retval += restore_everything(NULL); 872 867 if (!run_boot_loader(FALSE)) { 873 868 mr_msg(1, … … 875 870 boot_loader_installed = TRUE; 876 871 } 877 clean_blkid( bkpinfo);872 clean_blkid(); 878 873 protect_against_braindead_sysadmins(); 879 874 retval += unmount_all_devices(mountlist); … … 910 905 * @return 0 for success, or the number of errors encountered. 911 906 */ 912 int restore_to_live_filesystem( struct s_bkpinfo *bkpinfo)907 int restore_to_live_filesystem() 913 908 { 914 909 int retval = 0; … … 932 927 sleep(1); 933 928 } 934 interactively_obtain_media_parameters_from_user( bkpinfo,FALSE);929 interactively_obtain_media_parameters_from_user(FALSE); 935 930 if (!bkpinfo->media_device) { 936 931 mr_msg(2, "Warning - failed to find media dev"); … … 944 939 open_evalcall_form(_("Thinking...")); 945 940 946 get_cfg_file_from_archive_or_bust( bkpinfo);947 read_cfg_file_into_bkpinfo(g_mondo_cfg_file , bkpinfo);941 get_cfg_file_from_archive_or_bust(); 942 read_cfg_file_into_bkpinfo(g_mondo_cfg_file); 948 943 load_mountlist(mountlist, g_mountlist_fname); // in case read_cfg_file_into_bkpinfo 949 944 … … 951 946 retval = load_mountlist(mountlist, g_mountlist_fname); 952 947 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 953 filelist = process_filelist_and_biggielist( bkpinfo);948 filelist = process_filelist_and_biggielist(); 954 949 if (filelist) { 955 950 save_filelist(filelist, "/tmp/selected-files.txt"); … … 959 954 bkpinfo->restore_path, MAX_STR_LEN)) { 960 955 iamhere("Restoring everything"); 961 retval += restore_everything( bkpinfo,filelist);956 retval += restore_everything(filelist); 962 957 } 963 958 free_filelist(filelist); … … 1006 1001 */ 1007 1002 int 1008 restore_a_biggiefile_from_CD(struct s_bkpinfo *bkpinfo, 1009 long bigfileno, 1003 restore_a_biggiefile_from_CD(long bigfileno, 1010 1004 struct s_node *filelist, 1011 1005 char *pathname_of_last_file_restored) … … 1178 1172 bkpinfo->backup_media_string, 1179 1173 g_current_media_number); 1180 insist_on_this_cd_number( bkpinfo,g_current_media_number);1174 insist_on_this_cd_number(g_current_media_number); 1181 1175 log_to_screen(_("Continuing to restore.")); 1182 1176 } else { … … 1307 1301 * @return 0 for success (or skip), nonzero for failure. 1308 1302 */ 1309 int restore_a_biggiefile_from_stream( struct s_bkpinfo *bkpinfo,char *orig_bf_fname, long biggiefile_number, char *orig_checksum, //UNUSED1303 int restore_a_biggiefile_from_stream(char *orig_bf_fname, long biggiefile_number, char *orig_checksum, //UNUSED 1310 1304 long long biggiefile_size, //UNUSED 1311 1305 struct s_node *filelist, … … 1474 1468 if (current_slice_number == 0) { 1475 1469 res = 1476 read_file_from_stream_to_file(bkpinfo, 1477 "/tmp/biggie-blah.txt", 1470 read_file_from_stream_to_file("/tmp/biggie-blah.txt", 1478 1471 slice_siz); 1479 1472 if (!(fin = fopen("/tmp/biggie-blah.txt", "r"))) { … … 1491 1484 } else { 1492 1485 res = 1493 read_file_from_stream_to_stream( bkpinfo,pout, slice_siz);1486 read_file_from_stream_to_stream(pout, slice_siz); 1494 1487 } 1495 1488 retval += res; … … 1776 1769 */ 1777 1770 int 1778 restore_a_tarball_from_stream(struct s_bkpinfo *bkpinfo, 1779 char *tarball_fname, 1771 restore_a_tarball_from_stream(char *tarball_fname, 1780 1772 long current_tarball_number, 1781 1773 struct s_node *filelist, … … 1817 1809 mr_asprintf(&filelist_subset_fname, "%s/filelist-subset-%ld.tmp", 1818 1810 bkpinfo->tmpdir, current_tarball_number); 1819 res = read_file_from_stream_to_file( bkpinfo,afio_fname, size);1811 res = read_file_from_stream_to_file(afio_fname, size); 1820 1812 if (strstr(tarball_fname, ".star")) { 1821 1813 bkpinfo->use_star = TRUE; … … 1951 1943 */ 1952 1944 int 1953 restore_all_biggiefiles_from_CD(struct s_bkpinfo *bkpinfo, 1954 struct s_node *filelist) 1945 restore_all_biggiefiles_from_CD(struct s_node *filelist) 1955 1946 { 1956 1947 int retval = 0; … … 2018 2009 "I'll continue to scan this CD for bigfiles to be restored."); 2019 2010 } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) { 2020 insist_on_this_cd_number(bkpinfo, 2021 ++g_current_media_number); 2011 insist_on_this_cd_number(++g_current_media_number); 2022 2012 log_to_screen(_("Restoring from %s #%d"), 2023 bkpinfo->backup_media_string,2013 media_descriptor_string(bkpinfo->backup_media_type), 2024 2014 g_current_media_number); 2025 2015 just_changed_cds = TRUE; … … 2037 2027 2038 2028 res = 2039 restore_a_biggiefile_from_CD(bkpinfo, bigfileno, filelist, 2040 pathname_of_last_biggie_restored); 2029 restore_a_biggiefile_from_CD(bigfileno, filelist, pathname_of_last_biggie_restored); 2041 2030 iamhere(pathname_of_last_biggie_restored); 2042 2031 if (fbw && pathname_of_last_biggie_restored[0]) { … … 2097 2086 */ 2098 2087 int 2099 restore_all_tarballs_from_CD(struct s_bkpinfo *bkpinfo, 2100 struct s_node *filelist) 2088 restore_all_tarballs_from_CD(struct s_node *filelist) 2101 2089 { 2102 2090 int retval = 0; … … 2126 2114 g_current_media_number = 1; 2127 2115 } 2128 insist_on_this_cd_number( bkpinfo,g_current_media_number);2116 insist_on_this_cd_number(g_current_media_number); 2129 2117 read_cfg_var(g_mondo_cfg_file, "last-filelist-number", tmp1); 2130 2118 max_val = atol(tmp1) + 1; … … 2140 2128 progress_str, max_val); 2141 2129 for (;;) { 2142 insist_on_this_cd_number( bkpinfo,g_current_media_number);2130 insist_on_this_cd_number(g_current_media_number); 2143 2131 update_progress_form(progress_str); 2144 2132 mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%ld.afio.bz2", … … 2252 2240 */ 2253 2241 int 2254 restore_all_biggiefiles_from_stream(struct s_bkpinfo *bkpinfo, 2255 struct s_node *filelist) 2242 restore_all_biggiefiles_from_stream(struct s_node *filelist) 2256 2243 { 2257 2244 long noof_biggiefiles = 0L; … … 2306 2293 if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) { 2307 2294 res = 2308 read_EXAT_files_from_tape( bkpinfo,&biggie_size, biggie_fname,2295 read_EXAT_files_from_tape(&biggie_size, biggie_fname, 2309 2296 &ctrl_chr, xattr_fname, acl_fname); 2310 2297 } … … 2342 2329 mr_free(tmp); 2343 2330 2344 res = restore_a_biggiefile_from_stream(b kpinfo, biggie_fname,2331 res = restore_a_biggiefile_from_stream(biggie_fname, 2345 2332 current_bigfile_number, 2346 2333 biggie_cksum, … … 2428 2415 */ 2429 2416 int 2430 restore_all_tarballs_from_stream(struct s_bkpinfo *bkpinfo, 2431 struct s_node *filelist) 2417 restore_all_tarballs_from_stream(struct s_node *filelist) 2432 2418 { 2433 2419 int retval = 0; … … 2493 2479 iamhere("Reading EXAT files from tape"); 2494 2480 res = 2495 read_EXAT_files_from_tape( bkpinfo,&tmp_size, tmp_fname,2481 read_EXAT_files_from_tape(&tmp_size, tmp_fname, 2496 2482 &ctrl_chr, xattr_fname, 2497 2483 acl_fname); … … 2506 2492 */ 2507 2493 res = 2508 restore_a_tarball_from_stream( bkpinfo,tmp_fname,2494 restore_a_tarball_from_stream(tmp_fname, 2509 2495 current_afioball_number, 2510 2496 filelist, tmp_size, xattr_fname, … … 2568 2554 * @ingroup restoreGroup 2569 2555 */ 2570 int restore_everything(struct s_ bkpinfo *bkpinfo, struct s_node *filelist)2556 int restore_everything(struct s_node *filelist) 2571 2557 { 2572 2558 int resA; … … 2602 2588 mvaddstr_and_log_it(g_currentY, 0, _("Preparing to read your archives")); 2603 2589 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2604 mount_cdrom( bkpinfo);2590 mount_cdrom(); 2605 2591 mvaddstr_and_log_it(g_currentY++, 0, 2606 2592 _("Restoring OS and data from streaming media")); 2607 2593 if (bkpinfo->backup_media_type == cdstream) { 2608 openin_cdstream( bkpinfo);2594 openin_cdstream(); 2609 2595 } else { 2610 assert_string_is_neither_NULL_nor_zerolength(bkpinfo-> 2611 media_device); 2612 openin_tape(bkpinfo); 2613 } 2614 resA = restore_all_tarballs_from_stream(bkpinfo, filelist); 2615 resB = restore_all_biggiefiles_from_stream(bkpinfo, filelist); 2596 assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device); 2597 openin_tape(); 2598 } 2599 resA = restore_all_tarballs_from_stream(filelist); 2600 resB = restore_all_biggiefiles_from_stream(filelist); 2616 2601 if (bkpinfo->backup_media_type == cdstream) { 2617 closein_cdstream( bkpinfo);2602 closein_cdstream(); 2618 2603 } else { 2619 closein_tape( bkpinfo);2604 closein_tape(); 2620 2605 } 2621 2606 } else { 2622 2607 mvaddstr_and_log_it(g_currentY++, 0, 2623 2608 _("Restoring OS and data from CD ")); 2624 mount_cdrom( bkpinfo);2625 resA = restore_all_tarballs_from_CD( bkpinfo,filelist);2626 resB = restore_all_biggiefiles_from_CD( bkpinfo,filelist);2609 mount_cdrom(); 2610 resA = restore_all_tarballs_from_CD(filelist); 2611 resB = restore_all_biggiefiles_from_CD(filelist); 2627 2612 } 2628 2613 chdir(cwd); … … 2651 2636 */ 2652 2637 int 2653 restore_live_from_monitas_server(struct s_bkpinfo *bkpinfo, 2654 char *monitas_device, 2638 restore_live_from_monitas_server(char *monitas_device, 2655 2639 char *restore_this_directory, 2656 2640 char *restore_here) … … 2724 2708 2725 2709 unlink(datadisks_fname); 2726 read_cfg_file_into_bkpinfo(g_mondo_cfg_file , bkpinfo);2710 read_cfg_file_into_bkpinfo(g_mondo_cfg_file); 2727 2711 retval = load_mountlist(&the_mountlist, g_mountlist_fname); // in case read_cfg_file_into_bkpinfo strcpy(bkpinfo->media_device, monitas_device); 2728 2712 … … 2751 2735 run_program_and_log_output(command, FALSE); 2752 2736 // filelist = load_filelist(g_filelist_restthese); // FIXME --- this probably doesn't work because it doesn't include the biggiefiles 2753 retval += restore_everything( bkpinfo,filelist);2737 retval += restore_everything(filelist); 2754 2738 free_filelist(filelist); 2755 2739 mr_msg(2, "--------End of restore_live_from_monitas_server--------"); … … 2820 2804 struct mountlist_itself *mountlist = NULL; 2821 2805 struct raidlist_itself *raidlist = NULL; 2822 struct s_bkpinfo *bkpinfo = NULL;2823 2806 struct s_node *filelist = NULL; 2824 2807 char *a = NULL, *b = NULL; … … 2840 2823 mr_conf = mr_malloc(sizeof(struct mr_rs_conf)); 2841 2824 mr_rs_reset_conf(mr_conf); 2825 bkpinfo = mr_malloc(sizeof(struct s_bkpinfo)); 2826 reset_bkpinfo(); 2842 2827 2843 2828 mr_conf->log_level = DEFAULT_MR_LOGLEVEL; … … 2859 2844 g_text_mode = FALSE; 2860 2845 } // newt :-) 2861 bkpinfo = mr_malloc(sizeof(struct s_bkpinfo));2862 2846 mountlist = mr_malloc(sizeof(struct mountlist_itself)); 2863 2847 raidlist = mr_malloc(sizeof(struct raidlist_itself)); … … 2873 2857 malloc_string(a); 2874 2858 malloc_string(b); 2875 setup_MR_global_filenames(bkpinfo); // malloc() and set globals, using bkpinfo->tmpdir etc. 2876 reset_bkpinfo(bkpinfo); 2859 setup_MR_global_filenames(); // malloc() and set globals, using bkpinfo->tmpdir etc. 2877 2860 bkpinfo->backup_media_type = none; // in case boot disk was made for one backup type but user wants to restore from another backup type 2878 2861 strcpy(bkpinfo->backup_media_string,""); … … 2909 2892 2910 2893 /* Init directories */ 2911 make_hole_for_dir(bkpinfo->tmpdir);2912 mr_asprintf(&tmp, "mkdir -p %s", bkpinfo->tmpdir);2913 run_program_and_log_output(tmp, FALSE);2914 mr_free(tmp);2915 2916 2894 make_hole_for_dir("/var/log"); 2917 2895 make_hole_for_dir("/tmp/tmpfs"); /* just in case... */ … … 2943 2921 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 2944 2922 } 2945 res = let_user_edit_the_mountlist( bkpinfo,mountlist, raidlist);2923 res = let_user_edit_the_mountlist(mountlist, raidlist); 2946 2924 #ifdef __FreeBSD__ 2947 2925 system("mv -f /etc/raidtab /tmp/raidconf.txt"); … … 2977 2955 2978 2956 malloc_string(tmp); 2979 restore_a_biggiefile_from_CD( bkpinfo,42, NULL, tmp);2957 restore_a_biggiefile_from_CD(42, NULL, tmp); 2980 2958 mr_free(tmp); 2981 2959 } … … 3077 3055 if (argc == 5 && strcmp(argv[1], "--monitas-live") == 0) { 3078 3056 retval = 3079 restore_live_from_monitas_server(bkpinfo, 3080 argv[2], 3057 restore_live_from_monitas_server(argv[2], 3081 3058 argv[3], argv[4]); 3082 3059 } else { 3083 3060 mr_msg(2, "Calling restore_to_live_filesystem()"); 3084 retval = restore_to_live_filesystem( bkpinfo);3061 retval = restore_to_live_filesystem(); 3085 3062 } 3086 3063 mr_msg(2, "Still here. Yay."); … … 3103 3080 iamhere("About to call load_mountlist and load_raidtab"); 3104 3081 strcpy(bkpinfo->restore_path, MNT_RESTORING); 3105 read_cfg_file_into_bkpinfo(g_mondo_cfg_file , bkpinfo);3082 read_cfg_file_into_bkpinfo(g_mondo_cfg_file); 3106 3083 retval = load_mountlist(mountlist, g_mountlist_fname); 3107 3084 retval += load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); … … 3163 3140 if (argc == 2 && strcmp(argv[1], "--nuke") == 0) { 3164 3141 iamhere("nuking"); 3165 retval += nuke_mode( bkpinfo,mountlist, raidlist);3142 retval += nuke_mode(mountlist, raidlist); 3166 3143 } else if (argc == 2 && strcmp(argv[1], "--interactive") == 0) { 3167 3144 iamhere("catchall"); 3168 retval += catchall_mode( bkpinfo,mountlist, raidlist);3145 retval += catchall_mode(mountlist, raidlist); 3169 3146 } else if (argc == 2 && strcmp(argv[1], "--compare") == 0) { 3170 3147 iamhere("compare"); 3171 retval += compare_mode( bkpinfo,mountlist, raidlist);3148 retval += compare_mode(mountlist, raidlist); 3172 3149 } else if (argc == 2 && strcmp(argv[1], "--iso") == 0) { 3173 3150 iamhere("iso"); 3174 retval = iso_mode( bkpinfo,mountlist, raidlist, FALSE);3151 retval = iso_mode(mountlist, raidlist, FALSE); 3175 3152 } else if (argc == 2 && strcmp(argv[1], "--mbr") == 0) { 3176 3153 iamhere("mbr"); … … 3185 3162 } else if (argc == 2 && strcmp(argv[1], "--isonuke") == 0) { 3186 3163 iamhere("isonuke"); 3187 retval = iso_mode( bkpinfo,mountlist, raidlist, TRUE);3164 retval = iso_mode(mountlist, raidlist, TRUE); 3188 3165 } else if (argc != 1) { 3189 3166 log_to_screen(_("Invalid parameters")); … … 3191 3168 } else { 3192 3169 iamhere("catchall (no mode specified in command-line call"); 3193 retval += catchall_mode( bkpinfo,mountlist, raidlist);3170 retval += catchall_mode(mountlist, raidlist); 3194 3171 } 3195 3172 } … … 3197 3174 /* clean up at the end */ 3198 3175 if (retval) { 3199 if (does_file_exist( "/tmp/changed.files")) {3176 if (does_file_exist(MINDI_CACHE"/changed.files")) { 3200 3177 log_to_screen 3201 (_("See /tmp/changed.files for list of files that have changed."));3178 (_("See "MINDI_CACHE"/changed.files for list of files that have changed.")); 3202 3179 } 3203 3180 mvaddstr_and_log_it(g_currentY++, -
branches/stable/mondo/src/mondorestore/mondorestore.h
r1346 r1663 8 8 * Compatibility #define to ease the transition to logfile-in-a-variable. 9 9 */ 10 char *MONDO_LOGFILE = "/ tmp/mondorestore.log";10 char *MONDO_LOGFILE = "/var/log/mondorestore.log"; 11 11 12 12 /* Busybox ps has no option and PID in first pos */ -
branches/stable/mondo/src/mondorestore/mr-externs.h
r1200 r1663 16 16 extern bool ask_me_yes_or_no(char *); 17 17 extern char *calc_checksum_of_file(char *); 18 extern int closein_tape( struct s_bkpinfo *);18 extern int closein_tape(); 19 19 extern void close_evalcall_form(void); 20 20 extern char *call_program_and_get_last_line_of_output(char *); … … 51 51 extern void open_evalcall_form(char *); 52 52 extern void open_progress_form(char *, char *, char *, char *, long); 53 extern int openin_cdstream( struct s_bkpinfo *);54 extern int openin_tape( struct s_bkpinfo *);53 extern int openin_cdstream(); 54 extern int openin_tape(); 55 55 extern int partition_device(char *, int, int, char *, long); 56 56 extern int partition_device_with_fdisk(char *, int, int, char *, long); … … 61 61 extern bool popup_and_get_string(char *, char *, char *, int); 62 62 extern void setup_newt_stuff(void); 63 extern void reset_bkpinfo( struct s_bkpinfo *);63 extern void reset_bkpinfo(); 64 64 extern int read_cfg_var(char *, char *, char *); 65 extern int read_file_from_stream_to_file( struct s_bkpinfo *,char *,65 extern int read_file_from_stream_to_file(char *, 66 66 long long); 67 extern int read_file_from_stream_to_stream( struct s_bkpinfo *,FILE *,67 extern int read_file_from_stream_to_stream(FILE *, 68 68 long long); 69 extern int read_file_from_stream_FULL( struct s_bkpinfo *,char *, FILE *,69 extern int read_file_from_stream_FULL(char *, FILE *, 70 70 long long); 71 71 extern int read_header_block_from_stream(long long *, char *, int *); … … 78 78 extern void update_evalcall_form(int); 79 79 extern void update_progress_form(char *); 80 extern int verify_tape_backups( struct s_bkpinfo *);80 extern int verify_tape_backups(); 81 81 extern char which_restore_mode(void); 82 82 extern int which_format_command_do_i_need(char *, char *); … … 91 91 mountlist_itself 92 92 *mountlist); 93 extern int get_cfg_file_from_archive( struct s_bkpinfo *);93 extern int get_cfg_file_from_archive(); 94 94 95 95
Note:
See TracChangeset
for help on using the changeset viewer.