Changeset 300 in MondoRescue for trunk/mondo/mondo/common/libmondo-archive.c
- Timestamp:
- Jan 11, 2006, 2:20:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/common/libmondo-archive.c
r262 r300 1968 1968 char *bigfile_fname = NULL; 1969 1969 char *sz_devfile; 1970 char * partimagehack_fifo = NULL;1970 char *ntfsprog_fifo = NULL; 1971 1971 /*@ long *********************************************** */ 1972 1972 long biggie_file_number = 0; … … 1981 1981 FILE *ftmp = NULL; 1982 1982 bool delete_when_done; 1983 bool use_ partimagehack;1983 bool use_ntfsprog; 1984 1984 /*@ long long ****************************************** */ 1985 1985 long long biggie_fsize; … … 2015 2015 for (getline(&bigfile_fname, &n, fin); !feof(fin); 2016 2016 getline(&bigfile_fname, &n, fin), biggie_file_number++) { 2017 use_ partimagehack= FALSE;2017 use_ntfsprog = FALSE; 2018 2018 if (bigfile_fname[strlen(bigfile_fname) - 1] < 32) { 2019 2019 bigfile_fname[strlen(bigfile_fname) - 1] = '\0'; … … 2029 2029 delete_when_done = TRUE; 2030 2030 } else { 2031 // Call partimagehackif it's a /dev entry (i.e. a partition to be imaged)2031 // Call ntfsclone (formerly partimagehack) if it's a /dev entry (i.e. a partition to be imaged) 2032 2032 log_msg(2, "bigfile_fname = %s", bigfile_fname); 2033 use_ partimagehack= FALSE;2033 use_ntfsprog = FALSE; 2034 2034 if (!strncmp(bigfile_fname, "/dev/", 5) 2035 2035 && is_dev_an_NTFS_dev(bigfile_fname)) { 2036 use_ partimagehack= TRUE;2036 use_ntfsprog = TRUE; 2037 2037 log_msg(2, 2038 "Calling partimagehackin background because %s is an NTFS partition",2038 "Calling ntfsclone in background because %s is an NTFS partition", 2039 2039 bigfile_fname); 2040 2040 asprintf(&sz_devfile, "/tmp/%d.%d.000", … … 2042 2042 (int) (random() % 32768)); 2043 2043 mkfifo(sz_devfile, 0x770); 2044 partimagehack_fifo = sz_devfile;2044 ntfsprog_fifo = sz_devfile; 2045 2045 switch (pid = fork()) { 2046 2046 case -1: … … 2048 2048 case 0: 2049 2049 log_msg(2, 2050 "CHILD - fip - calling feed_into_ partimage(%s, %s)",2050 "CHILD - fip - calling feed_into_ntfsprog(%s, %s)", 2051 2051 bigfile_fname, sz_devfile); 2052 res = feed_into_ partimage(bigfile_fname, sz_devfile);2052 res = feed_into_ntfsprog(bigfile_fname, sz_devfile); 2053 2053 exit(res); 2054 2054 break; 2055 2055 default: 2056 2056 log_msg(2, 2057 "feed_into_ partimage() called in background --- pid=%ld",2057 "feed_into_ntfsprog() called in background --- pid=%ld", 2058 2058 (long int) (pid)); 2059 2059 … … 2063 2063 // Otherwise, use good old 'dd' and 'bzip2' 2064 2064 else { 2065 partimagehack_fifo = NULL;2065 ntfsprog_fifo = NULL; 2066 2066 } 2067 2067 … … 2072 2072 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2073 2073 write_header_block_to_stream(biggie_fsize, bigfile_fname, 2074 use_ partimagehack?2074 use_ntfsprog ? 2075 2075 BLK_START_A_PIHBIGGIE : 2076 2076 BLK_START_A_NORMBIGGIE); 2077 2077 } 2078 res = slice_up_file_etc(bkpinfo, bigfile_fname, 2079 partimagehack_fifo, biggie_file_number, 2080 noof_biggie_files, use_partimagehack); 2078 res = 2079 slice_up_file_etc(bkpinfo, bigfile_fname, 2080 ntfsprog_fifo, biggie_file_number, 2081 noof_biggie_files, use_ntfsprog); 2081 2082 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2082 2083 tmp = calc_checksum_of_file(bigfile_fname); … … 2996 2997 * 2997 2998 * @param biggie_filename The file to chop up. 2998 * @param partimagehack_fifo The FIFO to partimagehackif this is an imagedev, NULL otherwise.2999 * @param ntfsprog_fifo The FIFO to ntfsclone if this is an imagedev, NULL otherwise. 2999 3000 * @param biggie_file_number The sequence number of this biggie file (starting from 0). 3000 3001 * @param noof_biggie_files The number of biggie files there are total. … … 3005 3006 int 3006 3007 slice_up_file_etc(struct s_bkpinfo *bkpinfo, char *biggie_filename, 3007 char * partimagehack_fifo, long biggie_file_number,3008 long noof_biggie_files, bool use_ partimagehack)3008 char *ntfsprog_fifo, long biggie_file_number, 3009 long noof_biggie_files, bool use_ntfsprog) 3009 3010 { 3010 3011 … … 3049 3050 3050 3051 biggiestruct.for_backward_compatibility = '\n'; 3051 biggiestruct.use_ partimagehack = use_partimagehack;3052 biggiestruct.use_ntfsprog = use_ntfsprog; 3052 3053 optimal_set_size = bkpinfo->optimal_set_size; 3053 3054 if (is_this_file_compressed(biggie_filename) … … 3064 3065 fatal_error("bkpinfo->optimal_set_size is insanely small"); 3065 3066 } 3066 if ( partimagehack_fifo) {3067 file_to_openin = partimagehack_fifo;3067 if (ntfsprog_fifo) { 3068 file_to_openin = ntfsprog_fifo; 3068 3069 asprintf(&checksum_line, "IGNORE"); 3069 3070 log_msg(2, 3070 3071 "Not calculating checksum for %s: it would take too long", 3071 3072 biggie_filename); 3072 totallength = get_phys_size_of_drive(biggie_filename)*1024*1024LL; 3073 if ( !find_home_of_exe("ntfsresize")) { 3074 fatal_error("ntfsresize not found"); 3075 } 3076 sprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", biggie_filename); 3077 log_it("command = %s", command); 3078 strcpy (tmp, call_program_and_get_last_line_of_output(command)); 3079 log_it("res of it = %s", tmp); 3080 totallength = atoll(tmp); 3073 3081 } else { 3074 3082 file_to_openin = biggie_filename;
Note:
See TracChangeset
for help on using the changeset viewer.