Changeset 2833 in MondoRescue
- Timestamp:
- Jun 19, 2011, 2:13:48 AM (14 years ago)
- Location:
- branches/2.2.8
- Files:
-
- 1 deleted
- 13 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) { -
branches/2.2.8/mondo/src/mondorestore/mondo-prep.c
r2808 r2833 288 288 log_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff..."); 289 289 rewind(fin); 290 for (fgets(incoming, MAX_STR_LEN - 1, fin); !feof(fin); fgets(incoming, MAX_STR_LEN - 1, fin)) {290 for (fgets(incoming, 512, fin); !feof(fin); fgets(incoming, 512, fin)) { 291 291 fgetpos(fin, &orig_pos); 292 292 if (incoming[0] != '#') { … … 301 301 if ((p = strstr(incoming, "vgcreate"))) { 302 302 // include next line(s) if they end in /dev (cos we've got a broken i-want-my-lvm) 303 for (fgets(tmp, MAX_STR_LEN - 1, fin); !feof(fin); fgets(tmp, MAX_STR_LEN - 1, fin)) {303 for (fgets(tmp, 512, fin); !feof(fin); fgets(tmp, 512, fin)) { 304 304 if (tmp[0] == '#') { 305 305 fsetpos(fin, &orig_pos); … … 1784 1784 MONDO_LOGFILE); 1785 1785 1786 /* BERLIOS: sho uld not be called each time */1786 /* BERLIOS: shoould not be called each time */ 1787 1787 part_table_fmt = which_partition_format(drive); 1788 1788 output[0] = '\0'; … … 2406 2406 } else if (strcmp(format, "vmfs") == 0) { 2407 2407 strcpy(program, "mkfs -t vmfs"); 2408 } else if (strcmp(format, "ntfs") == 0) {2409 /*2410 * mkfs.ntfs treats the '-c' switch as 'specify cluster size'2411 * so the default "mkfs -t %s -c" command structure fails2412 */2413 strcpy(program, "mkfs -t ntfs");2414 2408 } else if (strcmp(format, "ocfs2") == 0) { 2415 2409 /* -
branches/2.2.8/mondo/src/mondorestore/mondo-rstr-tools.c
r2776 r2833 721 721 run_program_and_log_output("mkdir -p " MNT_RESTORING 722 722 "/var/run/console", FALSE); 723 /* To support latest Ubuntu where /var is a separate FS Cf: http://linux.derkeiler.com/Mailing-Lists/Ubuntu/2007-04/msg01319.html */ 724 run_program_and_log_output("mkdir -p " MNT_RESTORING 725 "/var/lock /var/run", FALSE); 723 726 run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null", 724 727 FALSE); … … 2086 2089 sprintf(command, "umount " MNT_RESTORING "%s", 2087 2090 mountlist->el[lino].mountpoint); 2088 2089 /* To support latest Ubuntu where /var is a separate FS2090 * Cf: http://linux.derkeiler.com/Mailing-Lists/Ubuntu/2007-04/msg01319.html2091 * we need to create some dirs under the real / before unmounting it */2092 if (!strcmp(mountlist->el[lino].mountpoint, "/")) {2093 run_program_and_log_output("mkdir -p " MNT_RESTORING "/var/lock", FALSE);2094 run_program_and_log_output("mkdir -p " MNT_RESTORING "/var/run", FALSE);2095 }2096 2091 } 2097 2092 } -
branches/2.2.8/mondo/src/mondorestore/mondorestore.c
r2776 r2833 655 655 protect_against_braindead_sysadmins(); 656 656 retval += unmount_all_devices(mountlist); 657 658 657 /* if (restore_some || restore_all || */ 659 658 if (ask_me_yes_or_no -
branches/2.2.8/mondo/src/restore-scripts/mondo/Makefile.am
r2788 r2833 4 4 make-me-bootable mount-me mount-subroutine-me raw-MR \ 5 5 stabgrub-me stablilo-me stabelilo-me \ 6 stabraw-me unmount-me unmount-subroutine-me \6 stabraw-me unmount-me unmount-subroutine-me 7 7 format-and-kludge-vfat -
branches/2.2.8/mondo/src/restore-scripts/mondo/format-and-kludge-vfat
r2815 r2833 63 63 64 64 device=$1 65 echo $device | grep -Eq "/cciss/|/mapper/|/ida/" 66 if [ $? -eq "0" ]; then 67 drive=`echo $device | sed s/[0-9p]*[0-9]//` 68 else 69 drive=`echo $drive | sed s/[0-9]*[0-9]//` 70 fi 65 drive=`echo $device | sed s/[0-9]*[0-9]//` 71 66 partition=`echo $device | sed s\%$drive\%\%` 72 67 -
branches/2.2.8/mondo/src/restore-scripts/mondo/grub-MR
r2814 r2833 115 115 partno=`basename $bootpart | cut -d'p' -f2` 116 116 elif echo $bootpart | grep "/mapper/mpath" > /dev/null ; then 117 partno=`basename $bootpart | cut -d'p' -f 3`117 partno=`basename $bootpart | cut -d'p' -f2` 118 118 else 119 119 partno=`basename $bootpart | sed s/[a-z]*//` … … 128 128 line=`grep $base /proc/mdstat | head -n1` 129 129 echo "mbrpart was $mbrpart" 130 mbrpart=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' | cut -d' ' -f2` 130 mbrpart=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' \ 131 | cut -d' ' -f2` 131 132 echo "mbrpart is $mbrpart" 132 133 partno="0"; # cheating - FIXME -
branches/2.2.8/mondo/src/restore-scripts/mondo/label-partitions-as-necessary
r2801 r2833 61 61 noof_blank_lines=0 62 62 read line 63 # We end after 50 empty lines, which hopefully means we reach the end of the file 64 while [ "$noof_blank_lines" -le "50" ] ; do 63 while [ "$line" != "" ] && [ "$noof_blank_lines" -le "5" ] ; do 65 64 if [ "$line" = "" ] ; then 66 65 noof_blank_lines=$(($noof_blank_lines+1))
Note:
See TracChangeset
for help on using the changeset viewer.