Changeset 296 in MondoRescue for branches/2.06/mondo/mondo/common/libmondo-archive.c
- Timestamp:
- Jan 11, 2006, 10:10:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.06/mondo/mondo/common/libmondo-archive.c
r260 r296 2162 2162 char *bigfile_fname; 2163 2163 char *sz_devfile; 2164 char * partimagehack_fifo = NULL;2164 char *ntfsprog_fifo = NULL; 2165 2165 /*@ long *********************************************** */ 2166 2166 long biggie_file_number = 0; … … 2174 2174 FILE *ftmp = NULL; 2175 2175 bool delete_when_done; 2176 bool use_ partimagehack;2176 bool use_ntfsprog; 2177 2177 /*@ long long ****************************************** */ 2178 2178 long long biggie_fsize; … … 2209 2209 for (fgets(bigfile_fname, MAX_STR_LEN, fin); !feof(fin); 2210 2210 fgets(bigfile_fname, MAX_STR_LEN, fin), biggie_file_number++) { 2211 use_ partimagehack= FALSE;2211 use_ntfsprog = FALSE; 2212 2212 if (bigfile_fname[strlen(bigfile_fname) - 1] < 32) { 2213 2213 bigfile_fname[strlen(bigfile_fname) - 1] = '\0'; … … 2223 2223 delete_when_done = TRUE; 2224 2224 } else { 2225 // Call partimagehackif it's a /dev entry (i.e. a partition to be imaged)2225 // Call ntfsclone (formerly partimagehack) if it's a /dev entry (i.e. a partition to be imaged) 2226 2226 log_msg(2, "bigfile_fname = %s", bigfile_fname); 2227 use_ partimagehack= FALSE;2227 use_ntfsprog = FALSE; 2228 2228 if (!strncmp(bigfile_fname, "/dev/", 5) 2229 2229 && is_dev_an_NTFS_dev(bigfile_fname)) { 2230 use_ partimagehack= TRUE;2230 use_ntfsprog = TRUE; 2231 2231 log_msg(2, 2232 "Calling partimagehackin background because %s is an NTFS partition",2232 "Calling ntfsclone in background because %s is an NTFS partition", 2233 2233 bigfile_fname); 2234 2234 sprintf(sz_devfile, "/tmp/%d.%d.000", … … 2236 2236 (int) (random() % 32768)); 2237 2237 mkfifo(sz_devfile, 0x770); 2238 partimagehack_fifo = sz_devfile;2238 ntfsprog_fifo = sz_devfile; 2239 2239 switch (pid = fork()) { 2240 2240 case -1: … … 2242 2242 case 0: 2243 2243 log_msg(2, 2244 "CHILD - fip - calling feed_into_ partimage(%s, %s)",2244 "CHILD - fip - calling feed_into_ntfsprog(%s, %s)", 2245 2245 bigfile_fname, sz_devfile); 2246 res = feed_into_ partimage(bigfile_fname, sz_devfile);2246 res = feed_into_ntfsprog(bigfile_fname, sz_devfile); 2247 2247 exit(res); 2248 2248 break; 2249 2249 default: 2250 2250 log_msg(2, 2251 "feed_into_ partimage() called in background --- pid=%ld",2251 "feed_into_ntfsprog() called in background --- pid=%ld", 2252 2252 (long int) (pid)); 2253 2253 } … … 2256 2256 else { 2257 2257 sz_devfile[0] = '\0'; 2258 partimagehack_fifo = NULL;2258 ntfsprog_fifo = NULL; 2259 2259 } 2260 2260 … … 2265 2265 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2266 2266 write_header_block_to_stream(biggie_fsize, bigfile_fname, 2267 use_ partimagehack?2267 use_ntfsprog ? 2268 2268 BLK_START_A_PIHBIGGIE : 2269 2269 BLK_START_A_NORMBIGGIE); … … 2271 2271 res = 2272 2272 slice_up_file_etc(bkpinfo, bigfile_fname, 2273 partimagehack_fifo, biggie_file_number,2274 noof_biggie_files, use_ partimagehack);2273 ntfsprog_fifo, biggie_file_number, 2274 noof_biggie_files, use_ntfsprog); 2275 2275 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2276 2276 write_header_block_to_stream(0, … … 3270 3270 * 3271 3271 * @param biggie_filename The file to chop up. 3272 * @param partimagehack_fifo The FIFO to partimagehackif this is an imagedev, NULL otherwise.3272 * @param ntfsprog_fifo The FIFO to ntfsclone if this is an imagedev, NULL otherwise. 3273 3273 * @param biggie_file_number The sequence number of this biggie file (starting from 0). 3274 3274 * @param noof_biggie_files The number of biggie files there are total. … … 3279 3279 int 3280 3280 slice_up_file_etc(struct s_bkpinfo *bkpinfo, char *biggie_filename, 3281 char * partimagehack_fifo, long biggie_file_number,3282 long noof_biggie_files, bool use_ partimagehack)3281 char *ntfsprog_fifo, long biggie_file_number, 3282 long noof_biggie_files, bool use_ntfsprog) 3283 3283 { 3284 3284 … … 3329 3329 3330 3330 biggiestruct.for_backward_compatibility = '\n'; 3331 biggiestruct.use_ partimagehack = use_partimagehack;3331 biggiestruct.use_ntfsprog = use_ntfsprog; 3332 3332 if (!(tempblock = (char *) malloc(256 * 1024))) { 3333 3333 fatal_error("malloc error 256*1024"); … … 3347 3347 fatal_error("bkpinfo->optimal_set_size is insanely small"); 3348 3348 } 3349 if ( partimagehack_fifo) {3350 file_to_openin = partimagehack_fifo;3349 if (ntfsprog_fifo) { 3350 file_to_openin = ntfsprog_fifo; 3351 3351 strcpy(checksum_line, "IGNORE"); 3352 3352 log_msg(2, 3353 3353 "Not calculating checksum for %s: it would take too long", 3354 3354 biggie_filename); 3355 totallength = get_phys_size_of_drive(biggie_filename)*1024*1024LL; 3355 if ( !find_home_of_exe("ntfsresize")) { 3356 fatal_error("ntfsresize not found"); 3357 } 3358 sprintf(command, "ntfsresize --force --info %s|grep '^You might resize at '|cut -d' ' -f5", biggie_filename); 3359 log_it("command = %s", command); 3360 strcpy (tmp, call_program_and_get_last_line_of_output(command)); 3361 log_it("res of it = %s", tmp); 3362 totallength = atoll(tmp); 3356 3363 } else { 3357 3364 file_to_openin = biggie_filename;
Note:
See TracChangeset
for help on using the changeset viewer.