Changeset 1924 in MondoRescue for branches/stable/mondo
- Timestamp:
- Apr 18, 2008, 1:41:41 AM (17 years ago)
- Location:
- branches/stable/mondo/src
- Files:
-
- 3 deleted
- 14 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/Makefile.am
r1056 r1924 13 13 libmondo-mountlist.c libmondo-raid.c \ 14 14 libmondo-stream.c libmondo-string.c libmondo-tools.c \ 15 libmondo-verify.c newt-specific.c \15 libmondo-verify.c newt-specific.c libmondo-cli.c \ 16 16 libmondo-archive.h libmondo-devices.h \ 17 17 libmondo-filelist.h libmondo-files.h libmondo-fork.h \ 18 18 libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \ 19 19 libmondo-stream.h libmondo-string.h libmondo-tools.h \ 20 libmondo-verify.h libmondo-fifo.h \20 libmondo-verify.h libmondo-fifo.h libmondo-cli.h \ 21 21 libmondo-archive-EXT.h my-stuff.h mondostructures.h \ 22 22 libmondo-devices-EXT.h libmondo-fifo-EXT.h \ … … 25 25 libmondo-mountlist-EXT.h libmondo-raid-EXT.h \ 26 26 libmondo-string-EXT.h libmondo-tools-EXT.h \ 27 libmondo-verify-EXT.h libmondo-stream-EXT.h \27 libmondo-verify-EXT.h libmondo-stream-EXT.h libmondo-cli-EXT.h \ 28 28 newt-specific.h -
branches/stable/mondo/src/common/libmondo-devices.c
r1903 r1924 61 61 */ 62 62 bool g_restoring_live_from_cd = FALSE; 63 bool g_restoring_live_from_nfs = FALSE; 63 64 64 65 extern t_bkptype g_backup_media_type; // set by main() … … 1852 1853 } 1853 1854 } else { 1854 s z_size = 0;1855 strcpy(sz_size, "0"); 1855 1856 } 1856 1857 mr_free(comment); -
branches/stable/mondo/src/common/libmondo-filelist.c
r1903 r1924 1590 1590 mr_asprintf(&tmp2, call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|fat|vfat|dos' | awk '{print $3}'")); 1591 1591 if (strlen(tmp2) < 1) { 1592 mr_asprintf(&tmp1," ");1592 mr_asprintf(&tmp1," "); 1593 1593 } else { 1594 1594 mr_msg(2, "Found windows FS: %s",tmp2); -
branches/stable/mondo/src/common/libmondo-mountlist.c
r1904 r1924 843 843 #if linux 844 844 sscanf(incoming, 845 "%s %s %s %s %s %s",845 "%s %s %s %s %s", 846 846 mountlist->el[items].device, 847 847 mountlist->el[items].mountpoint, … … 909 909 mountlist->el[items].format, 910 910 mountlist->el[items].size, 911 mountlist->el[items].label);911 mountlist->el[items].label); 912 912 items++; 913 913 } … … 948 948 for (i = 0; i < mountlist->entries; i++) { 949 949 fprintf(fout, 950 "%-15s %-15s %-15s %-15lld %-15s %-15s\n",950 "%-15s %-15s %-15s %-15lld %-15s\n", 951 951 mountlist->el[i].device, mountlist->el[i].mountpoint, 952 952 mountlist->el[i].format, mountlist->el[i].size, -
branches/stable/mondo/src/common/libmondo-stream.c
r1904 r1924 695 695 (void) getcwd(old_cwd, MAX_STR_LEN); 696 696 chdir(bkpinfo->tmpdir); 697 mr_asprintf(&tmp, "tar -zxf %s tmp/mondo-restore.cfg 2> /dev/null",697 mr_asprintf(&tmp, "tar -zxf %s ./tmp/mondo-restore.cfg 2> /dev/null", 698 698 outfname); 699 699 paranoid_system(tmp); -
branches/stable/mondo/src/common/libmondo-tools.c
r1903 r1924 21 21 #include "libmondo-fork-EXT.h" 22 22 #include "libmondo-raid-EXT.h" 23 #include "libmondo-devices-EXT.h" 23 24 #include <sys/socket.h> 24 25 #include <netdb.h> … … 78 79 79 80 extern bool am_I_in_disaster_recovery_mode(void); 81 82 /* Return a string containing the date */ 83 char *mr_date(void) { 84 85 time_t tcurr; 86 87 tcurr = time(NULL); 88 return(ctime(&tcurr)); 89 } 90 91 /*-----------------------------------------------------------*/ 80 92 81 93 … … 692 704 strcpy(bkpinfo->tmpdir,p); 693 705 paranoid_free(tmp); 694 695 //sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768)); // for mondorestore696 706 } 697 707 … … 711 721 memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo)); 712 722 713 /* special case for tmpdir as used eveywhere after */ 714 setup_tmpdir(NULL); 723 sensibly_set_tmpdir_and_scratchdir(); 715 724 716 725 bkpinfo->manual_tray = mr_conf->manual_tray; … … 764 773 bkpinfo->prefix = tmp; 765 774 766 bkpinfo->scratchdir[0] = '\0';767 775 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 768 776 bkpinfo->optimal_set_size = 0; … … 823 831 * - make sure afio, cdrecord, bzip2, awk, md5sum, strings, mindi, and buffer exist 824 832 * - make sure CD-ROM is unmounted 825 * - make sure /etc/modules.conf exists826 833 * - make sure user's mountlist is OK by running <tt>mindi --makemountlist</tt> 827 834 * … … 940 947 } 941 948 mr_free(tmp); 942 #ifndef __FreeBSD__943 if (!does_file_exist("/etc/modules.conf")) {944 if (does_file_exist("/etc/conf.modules")) {945 log_it("Linking /etc/modules.conf to /etc/conf.modules");946 run_program_and_log_output947 ("ln -sf /etc/conf.modules /etc/modules.conf", 5);948 } else if (does_file_exist("/etc/modprobe.d")) {949 log_it950 ("Directory /etc/modprobe.d found. mindi will use its contents.");951 } else if (does_file_exist("/etc/modprobe.conf")) {952 log_it("Linking /etc/modules.conf to /etc/modprobe.conf");953 run_program_and_log_output954 ("ln -sf /etc/modprobe.conf /etc/modules.conf", 5);955 } else {956 retval++;957 log_to_screen958 (_("Please find out what happened to /etc/modules.conf"));959 }960 }961 #endif962 949 963 950 run_program_and_log_output("cat /etc/fstab", 5); -
branches/stable/mondo/src/include/my-stuff.h
r1770 r1924 18 18 #define MINDI_CACHE "/var/cache/mindi" 19 19 #define MONDORESTORECFG MONDO_CACHE"/mondo-restore.cfg" 20 20 21 /** 21 22 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked). 22 23 */ 23 #define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg" 24 25 24 #define MONDO_CFG_FILE_STUB "./tmp/mondo-restore.cfg" 26 25 27 26 /** … … 76 75 * The biggielist stub (appended to the directory where all.tar.gz was unpacked). 77 76 */ 78 #define BIGGIELIST_TXT_STUB " tmp/biggielist.txt"77 #define BIGGIELIST_TXT_STUB "./tmp/biggielist.txt" 79 78 80 79 /** 81 80 * The filelist stub (appended to the directory where all.tar.gz was unpacked). 82 81 */ 83 #define FILELIST_FULL_STUB " tmp/filelist.full.gz"82 #define FILELIST_FULL_STUB "./tmp/filelist.full.gz" 84 83 85 84 /** 86 85 * The mountlist stub (appended to the directory where all.tar.gz was unpacked). 87 86 */ 88 #define MOUNTLIST_FNAME_STUB "tmp/mountlist.txt" 87 #define MOUNTLIST_FNAME_STUB "./tmp/mountlist.txt" 88 89 /** 90 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked). 91 */ 92 #define MONDO_CFG_FILE_STUB "./tmp/mondo-restore.cfg" 89 93 90 94 /** -
branches/stable/mondo/src/lib/mr_str.c
r1594 r1924 6 6 */ 7 7 8 #include <stdlib.h> 8 9 #include <stdio.h> 9 10 #include <string.h> -
branches/stable/mondo/src/mondoarchive/Makefile.am
r1560 r1924 7 7 8 8 ## Headers 9 noinst_HEADERS = mondo -cli-EXT.h mondo-cli.h mondoarchive.h9 noinst_HEADERS = mondoarchive.h 10 10 11 11 ## The program 12 12 sbin_PROGRAMS = mondoarchive 13 mondoarchive_SOURCES = mondoarchive.c mondo-cli.c13 mondoarchive_SOURCES = mondoarchive.c 14 14 mondoarchive_LDADD = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a -
branches/stable/mondo/src/mondoarchive/mondoarchive.c
r1842 r1924 59 59 60 60 /****************** subroutines used only here ******************/ 61 62 /** 63 * Whether we're restoring from ISOs. Obviously not, since this is the 64 * backup program. 65 * @note You @b MUST declare this variable somewhere in your program if 66 * you use libmondo. Otherwise the link will fail. 67 * @ingroup globalGroup 68 */ 69 bool g_ISO_restore_mode = FALSE; 70 71 /* Do we use extended attributes and acl ? 72 * * By default no, use --acl & --attr options to force their usage */ 73 char *g_getfacl = NULL; 74 char *g_getfattr = NULL; 61 75 62 76 /* Reference to global bkpinfo */ -
branches/stable/mondo/src/mondoarchive/mondoarchive.h
r1326 r1924 17 17 */ 18 18 char *MONDO_LOGFILE = "/var/log/mondoarchive.log"; 19 char *MONDO_OPTIONS = "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"; 19 20 20 21 /* No restriction on ps options */ -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1903 r1924 1118 1118 BIGGIELIST_TXT_STUB, 1119 1119 FILELIST_FULL_STUB, 1120 " tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);1120 "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1121 1121 mr_msg(1, "tarcommand = %s", command); 1122 1122 run_program_and_log_output(command, 1); … … 1135 1135 BIGGIELIST_TXT_STUB, 1136 1136 FILELIST_FULL_STUB, 1137 " tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);1137 "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB); 1138 1138 mr_msg(1, "tarcommand = %s", command); 1139 1139 run_program_and_log_output(command, 1); … … 1142 1142 if (!does_file_exist(BIGGIELIST_TXT_STUB)) { 1143 1143 fatal_error 1144 ("all.tar.gz did not include tmp/biggielist.txt");1144 ("all.tar.gz did not include ./tmp/biggielist.txt"); 1145 1145 } 1146 1146 if (!does_file_exist(FILELIST_FULL_STUB)) { 1147 1147 fatal_error 1148 ("all.tar.gz did not include tmp/filelist.full.gz");1148 ("all.tar.gz did not include ./tmp/filelist.full.gz"); 1149 1149 } 1150 1150 } … … 2083 2083 1024L * 1024 * 32 / bkpinfo->internal_tape_block_size, 2084 2084 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2085 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, " tmp/i-want-my-lvm");2085 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "./tmp/i-want-my-lvm"); 2086 2086 mr_msg(2, "command = '%s'", command); 2087 2087 res = run_program_and_log_output(command, -1); … … 2113 2113 char *ramdisk_fname = NULL; 2114 2114 char *mountlist_file = NULL; 2115 int res = 0;2116 2115 2117 2116 bool try_plan_B = FALSE; … … 2205 2204 mr_msg(2, 2206 2205 "gcffa --- Plan B, a.k.a. untarring some file from all.tar.gz"); 2207 mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, " tmp/i-want-my-lvm"); // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary2206 mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "./tmp/i-want-my-lvm"); // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary 2208 2207 run_program_and_log_output(command, TRUE); 2209 2208 mr_free(command); -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1904 r1924 924 924 925 925 strcpy(bkpinfo->restore_path, "/"); 926 if (!g_restoring_live_from_cd ) {926 if (!g_restoring_live_from_cd && !g_restoring_live_from_nfs) { 927 927 popup_and_OK 928 928 (_("Please insert tape/CD/USB key, then hit 'OK' to continue.")); 929 929 sleep(1); 930 930 } 931 interactively_obtain_media_parameters_from_user(FALSE); 931 if (!g_restoring_live_from_nfs) { 932 interactively_obtain_media_parameters_from_user(FALSE); 933 } 932 934 if (!bkpinfo->media_device) { 933 935 mr_msg(2, "Warning - failed to find media dev"); … … 948 950 retval = load_mountlist(mountlist, g_mountlist_fname); 949 951 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 950 filelist = process_filelist_and_biggielist(); 951 if ( filelist) {952 953 if (!g_restoring_live_from_nfs && (filelist = process_filelist_and_biggielist())) { 952 954 save_filelist(filelist, "/tmp/selected-files.txt"); 953 955 mr_asprintf(&old_restpath,bkpinfo->restore_path); … … 961 963 strcpy(bkpinfo->restore_path, old_restpath); 962 964 mr_free(old_restpath); 965 } else { 966 retval += restore_everything(NULL); 963 967 } 964 968 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { … … 2706 2710 paranoid_fclose(fout); 2707 2711 sprintf(command, 2708 "tar -zxvf %s tmp/mondo-restore.cfg tmp/mountlist.txt tmp/filelist.fulltmp/biggielist.txt",2712 "tar -zxvf %s ./tmp/mondo-restore.cfg ./tmp/mountlist.txt ./tmp/filelist.full ./tmp/biggielist.txt", 2709 2713 datadisks_fname); 2710 2714 run_program_and_log_output(command, 4); … … 3044 3048 g_restoring_live_from_cd = TRUE; 3045 3049 } 3050 if (bkpinfo->backup_media_type == nfs) { 3051 g_restoring_live_from_nfs = TRUE; 3052 } 3046 3053 if (argc == 5 && strcmp(argv[1], "--monitas-live") == 0) { 3047 3054 retval = -
branches/stable/mondo/src/mondorestore/mr-externs.h
r1663 r1924 108 108 extern bool g_text_mode; 109 109 extern bool g_restoring_live_from_cd; 110 extern bool g_restoring_live_from_nfs; 110 111 extern int fput_string_one_char_at_a_time(FILE *, char *); 111 112
Note:
See TracChangeset
for help on using the changeset viewer.