Changeset 2833 in MondoRescue for branches/2.2.8/mondo/src/common
- Timestamp:
- Jun 19, 2011, 2:13:48 AM (13 years ago)
- Location:
- branches/2.2.8/mondo/src/common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.8/mondo/src/common/libmondo-archive.c
r2791 r2833 378 378 } 379 379 380 /* 381 if (g_tmpfs_mountpt[0] != '\0') { 382 i = atoi(call_program_and_get_last_line_of_output 383 ("df -m -P | grep dev/shm | grep -v none | tr -s ' ' '\t' | cut -f4")); 384 if (i > 0) { 385 if (free_ramdisk_space > i) { 386 free_ramdisk_space = i; 387 log_msg(2, "min(free_ramdisk_space) is now %d", 388 free_ramdisk_space); 389 if (free_ramdisk_space < 10) { 390 fatal_error 391 ("Please increase PPCFG_RAMDISK_SIZE in my-stuff.h to increase size of ramdisk "); 392 } 393 } 394 } 395 } 396 */ 380 397 paranoid_free(command); 381 398 paranoid_free(zipparams); -
branches/2.2.8/mondo/src/common/libmondo-devices.c
r2806 r2833 1068 1068 } else { 1069 1069 strcpy(good_formats, " "); 1070 (void) fgets(good_formats + 1, MAX_STR_LEN - 1, pin);1070 (void) fgets(good_formats + 1, MAX_STR_LEN, pin); 1071 1071 if (pclose(pin)) { 1072 1072 log_OS_error("Cannot pclose good formats"); -
branches/2.2.8/mondo/src/common/libmondo-filelist.c
r2813 r2833 1405 1405 // 2.6 has /sys as a proc-type thing -- must be excluded 1406 1406 asprintf(&strtmp, 1407 "find %s - fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs-prune -o -fstype proc -prune -o -fstype sysfs -prune -o %s -type d -print > %s 2> /dev/null",1407 "find %s -maxdepth %d -fstype mvfs -prune -o -path /dev/shm -prune -o -fstype proc -prune -o -fstype sysfs -prune -o %s -type d -print > %s 2> /dev/null", 1408 1408 dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist); 1409 1409 #else -
branches/2.2.8/mondo/src/common/libmondo-fork.c
r2807 r2833 3 3 4 4 - subroutines for handling forking/pthreads/etc. 5 6 7 01/20/2006 8 - replaced partimagehack with ntfsclone 9 10 06/20/2004 11 - create fifo /var/log/partimagehack-debug.log and empty it 12 to keep ramdisk from filling up 13 14 04/13/2004 15 - >= should be <= g_loglevel 16 17 11/15/2003 18 - changed a few []s to char*s 19 20 10/12 21 - rewrote partimagehack handling (multiple fifos, chunks, etc.) 22 23 10/11 24 - partimagehack now has debug level of N (set in my-stuff.h) 25 26 10/08 27 - call to partimagehack when restoring will now log errors to /var/log/....log 28 29 10/06 30 - cleaned up logging a bit 31 32 09/30 33 - line 735 - missing char* cmd in sprintf() 34 35 09/28 36 - added run_external_binary_with_percentage_indicator() 37 - rewritten eval_call_to_make_ISO() 38 39 09/18 40 - call mkstemp instead of mktemp 41 42 09/13 43 - major NTFS hackage 44 45 09/12 46 - paranoid_system("rm -f /tmp/ *PARTIMAGE*") before calling partimagehack 47 48 09/11 49 - forward-ported unbroken feed_*_partimage() subroutines 50 from early August 2003 51 52 09/08 53 - detect & use partimagehack if it exists 54 55 09/05 56 - finally finished partimagehack hack :) 57 58 07/04 59 - added subroutines to wrap around partimagehack 60 61 04/27 62 - don't echo (...res=%d...) at end of log_it() 63 unnecessarily 64 - replace newtFinished() and newtInit() with 65 newtSuspend() and newtResume() 66 67 04/24 68 - added some assert()'s and log_OS_error()'s 69 70 04/09 71 - cleaned up run_program_and_log_output() 72 73 04/07 74 - cleaned up code a bit 75 - let run_program_and_log_output() accept -1 (only log if _no error_) 76 77 01/02/2003 78 - in eval_call_to_make_ISO(), append output to MONDO_LOGFILE 79 instead of a temporary stderr text file 80 81 12/10 82 - patch by Heiko Schlittermann to handle % chars in issue.net 83 84 11/18 85 - if mkisofs in eval_call_to_make_ISO() returns an error then return it, 86 whether ISO was created or not 87 88 10/30 89 - if mkisofs in eval_call_to_make_ISO() returns an error then find out if 90 the output (ISO) file has been created; if it has then return 0 anyway 91 92 08/01 - 09/30 93 - run_program_and_log_output() now takes boolean operator to specify 94 whether it will log its activities in the event of _success_ 95 - system() now includes 2>/dev/null 96 - enlarged some tmp[]'s 97 - added run_program_and_log_to_screen() and run_program_and_log_output() 98 99 07/24 100 - created 5 101 */ 6 102 … … 458 554 FILE *fout; 459 555 FILE *ftmp; 460 int tmpcap = 512;461 556 462 557 log_msg(5, "Opening."); 463 if (!(tmp = malloc(tmpcap))) { 464 fatal_error("Failed to malloc() tmp"); 465 } 558 malloc_string(tmp); 466 559 tmp[0] = '\0'; 467 560 bufcap = 256L * 1024L; … … 563 656 sprintf(tmp, "I am here - %lld", (long long)ftello(fin)); 564 657 // log_msg(0, tmp); 565 fread(tmp, 1, tmpcap, fin);658 fread(tmp, 1, 512, fin); 566 659 log_msg(0, "tmp = '%s'", tmp); 567 fwrite(tmp, 1, tmpcap, ftmp);660 fwrite(tmp, 1, 512, ftmp); 568 661 fclose(ftmp); 569 662 fatal_error("Missing terminating block"); -
branches/2.2.8/mondo/src/common/libmondo-stream.c
r2805 r2833 1232 1232 { 1233 1233 int last; 1234 char fname[MAX_TAPECAT_FNAME_LEN +1];1234 char fname[MAX_TAPECAT_FNAME_LEN]; 1235 1235 char *p; 1236 1236 -
branches/2.2.8/mondo/src/common/libmondo-tools.c
r2791 r2833 473 473 run_program_and_log_output("cat /etc/*-release", 5); 474 474 run_program_and_log_output("cat /etc/*issue*", 5); 475 /* 476 sprintf(g_tmpfs_mountpt, "%s/tmpfs", bkpinfo->tmpdir); 477 sprintf(command, "mkdir -p %s", g_tmpfs_mountpt); 478 paranoid_system(command); 479 rdsiz_MB = PPCFG_RAMDISK_SIZE + g_tape_buffer_size_MB; 480 */ 475 481 #ifdef __FreeBSD__ 482 /* 483 strcpy(tmp, 484 call_program_and_get_last_line_of_output 485 ("vmstat | tail -1 | tr -s ' ' | cut -d' ' -f6")); 486 avm += atol(tmp); 487 strcpy(tmp, 488 call_program_and_get_last_line_of_output 489 ("swapinfo | grep -v Device | tr -s ' ' | cut -d' ' -f4 | tr '\n' '+' | sed 's/+$//' | bc")); 490 avm += atol(tmp); 491 sprintf(command, "mdmfs -s %d%c md9 %s", rdsiz_MB, 'm', 492 g_tmpfs_mountpt); 493 */ 476 494 #else 495 /* 496 strcpy(tmp, 497 call_program_and_get_last_line_of_output 498 ("free | grep ':' | tr -s ' ' '\t' | cut -f2 | head -n1")); 499 avm += atol(tmp); 500 sprintf(command, "mount /dev/shm -t tmpfs %s -o size=%d%c", 501 g_tmpfs_mountpt, rdsiz_MB, 'm'); 502 */ 477 503 run_program_and_log_output("cat /proc/cpuinfo", 5); 478 504 run_program_and_log_output … … 480 506 5); 481 507 #endif 508 /* 509 if (avm / 1024 > rdsiz_MB * 3) { 510 if (run_program_and_log_output(command, 5)) { 511 g_tmpfs_mountpt[0] = '\0'; 512 log_it("Failed to mount tmpfs"); 513 } else { 514 log_it("Tmpfs mounted OK - %d MB", rdsiz_MB); 515 } 516 } else { 517 g_tmpfs_mountpt[0] = '\0'; 518 log_it("It doesn't seem you have enough swap to use tmpfs. Fine."); 519 } 520 */ 482 521 483 522 if (bkpinfo->use_lzo) {
Note:
See TracChangeset
for help on using the changeset viewer.