Changeset 2833 in MondoRescue


Ignore:
Timestamp:
Jun 19, 2011, 2:13:48 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Revert bad changes made accidentaly on the 2.2.8 branch
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  
    378378    }
    379379
     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    */
    380397    paranoid_free(command);
    381398    paranoid_free(zipparams);
  • branches/2.2.8/mondo/src/common/libmondo-devices.c

    r2806 r2833  
    10681068    } else {
    10691069        strcpy(good_formats, " ");
    1070         (void) fgets(good_formats + 1, MAX_STR_LEN - 1, pin);
     1070        (void) fgets(good_formats + 1, MAX_STR_LEN, pin);
    10711071        if (pclose(pin)) {
    10721072            log_OS_error("Cannot pclose good formats");
  • branches/2.2.8/mondo/src/common/libmondo-filelist.c

    r2813 r2833  
    14051405        // 2.6 has /sys as a proc-type thing -- must be excluded
    14061406        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",
    14081408             dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
    14091409#else
  • branches/2.2.8/mondo/src/common/libmondo-fork.c

    r2807 r2833  
    33
    44- subroutines for handling forking/pthreads/etc.
     5
     6
     701/20/2006
     8- replaced partimagehack with ntfsclone
     9
     1006/20/2004
     11- create fifo /var/log/partimagehack-debug.log and empty it
     12  to keep ramdisk from filling up
     13
     1404/13/2004
     15- >= should be <= g_loglevel
     16
     1711/15/2003
     18- changed a few []s to char*s
     19 
     2010/12
     21- rewrote partimagehack handling (multiple fifos, chunks, etc.)
     22
     2310/11
     24- partimagehack now has debug level of N (set in my-stuff.h)
     25
     2610/08
     27- call to partimagehack when restoring will now log errors to /var/log/....log
     28
     2910/06
     30- cleaned up logging a bit
     31
     3209/30
     33- line 735 - missing char* cmd in sprintf()
     34
     3509/28
     36- added run_external_binary_with_percentage_indicator()
     37- rewritten eval_call_to_make_ISO()
     38
     3909/18
     40- call mkstemp instead of mktemp
     41
     4209/13
     43- major NTFS hackage
     44
     4509/12
     46- paranoid_system("rm -f /tmp/ *PARTIMAGE*") before calling partimagehack
     47
     4809/11
     49- forward-ported unbroken feed_*_partimage() subroutines
     50  from early August 2003
     51
     5209/08
     53- detect & use partimagehack if it exists
     54
     5509/05
     56- finally finished partimagehack hack :)
     57
     5807/04
     59- added subroutines to wrap around partimagehack
     60
     6104/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
     6704/24
     68- added some assert()'s and log_OS_error()'s
     69
     7004/09
     71- cleaned up run_program_and_log_output()
     72
     7304/07
     74- cleaned up code a bit
     75- let run_program_and_log_output() accept -1 (only log if _no error_)
     76
     7701/02/2003
     78- in eval_call_to_make_ISO(), append output to MONDO_LOGFILE
     79  instead of a temporary stderr text file
     80
     8112/10
     82- patch by Heiko Schlittermann to handle % chars in issue.net
     83
     8411/18
     85- if mkisofs in eval_call_to_make_ISO() returns an error then return it,
     86  whether ISO was created or not
     87
     8810/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
     9208/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
     9907/24
     100- created
    5101*/
    6102
     
    458554    FILE *fout;
    459555    FILE *ftmp;
    460     int tmpcap = 512;
    461556
    462557    log_msg(5, "Opening.");
    463     if (!(tmp = malloc(tmpcap))) {
    464         fatal_error("Failed to malloc() tmp");
    465     }
     558    malloc_string(tmp);
    466559    tmp[0] = '\0';
    467560    bufcap = 256L * 1024L;
     
    563656                sprintf(tmp, "I am here - %lld", (long long)ftello(fin));
    564657//    log_msg(0, tmp);
    565                 fread(tmp, 1, tmpcap, fin);
     658                fread(tmp, 1, 512, fin);
    566659                log_msg(0, "tmp = '%s'", tmp);
    567                 fwrite(tmp, 1, tmpcap, ftmp);
     660                fwrite(tmp, 1, 512, ftmp);
    568661                fclose(ftmp);
    569662                fatal_error("Missing terminating block");
  • branches/2.2.8/mondo/src/common/libmondo-stream.c

    r2805 r2833  
    12321232{
    12331233    int last;
    1234     char fname[MAX_TAPECAT_FNAME_LEN+1];
     1234    char fname[MAX_TAPECAT_FNAME_LEN];
    12351235    char *p;
    12361236
  • branches/2.2.8/mondo/src/common/libmondo-tools.c

    r2791 r2833  
    473473    run_program_and_log_output("cat /etc/*-release", 5);
    474474    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    */
    475481#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            */
    476494#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            */
    477503    run_program_and_log_output("cat /proc/cpuinfo", 5);
    478504    run_program_and_log_output
     
    480506         5);
    481507#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    */
    482521
    483522    if (bkpinfo->use_lzo) {
  • branches/2.2.8/mondo/src/mondorestore/mondo-prep.c

    r2808 r2833  
    288288    log_msg(1, "OK, rewound i-want-my-lvm. Doing funky stuff...");
    289289    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)) {
    291291        fgetpos(fin, &orig_pos);
    292292        if (incoming[0] != '#') {
     
    301301        if ((p = strstr(incoming, "vgcreate"))) {
    302302// 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)) {
    304304                if (tmp[0] == '#') {
    305305                    fsetpos(fin, &orig_pos);
     
    17841784            MONDO_LOGFILE);
    17851785
    1786     /* BERLIOS: should not be called each time */
     1786    /* BERLIOS: shoould not be called each time */
    17871787    part_table_fmt = which_partition_format(drive);
    17881788    output[0] = '\0';
     
    24062406    } else if (strcmp(format, "vmfs") == 0) {
    24072407        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 fails
    2412          */
    2413         strcpy(program, "mkfs -t ntfs");
    24142408    } else if (strcmp(format, "ocfs2") == 0) {
    24152409        /*
  • branches/2.2.8/mondo/src/mondorestore/mondo-rstr-tools.c

    r2776 r2833  
    721721run_program_and_log_output("mkdir -p " MNT_RESTORING
    722722                       "/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 */
     724run_program_and_log_output("mkdir -p " MNT_RESTORING
     725                       "/var/lock /var/run", FALSE);
    723726run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null",
    724727                       FALSE);
     
    20862089                    sprintf(command, "umount " MNT_RESTORING "%s",
    20872090                            mountlist->el[lino].mountpoint);
    2088 
    2089                     /* To support latest Ubuntu where /var is a separate FS
    2090                      * Cf: http://linux.derkeiler.com/Mailing-Lists/Ubuntu/2007-04/msg01319.html
    2091                      * 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                     }
    20962091                }
    20972092            }
  • branches/2.2.8/mondo/src/mondorestore/mondorestore.c

    r2776 r2833  
    655655    protect_against_braindead_sysadmins();
    656656    retval += unmount_all_devices(mountlist);
    657 
    658657    /*  if (restore_some || restore_all || */
    659658    if (ask_me_yes_or_no
  • branches/2.2.8/mondo/src/restore-scripts/mondo/Makefile.am

    r2788 r2833  
    44                        make-me-bootable mount-me mount-subroutine-me raw-MR \
    55                        stabgrub-me stablilo-me stabelilo-me \
    6                         stabraw-me unmount-me unmount-subroutine-me \
     6                        stabraw-me unmount-me unmount-subroutine-me
    77                        format-and-kludge-vfat
  • branches/2.2.8/mondo/src/restore-scripts/mondo/format-and-kludge-vfat

    r2815 r2833  
    6363
    6464device=$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
     65drive=`echo $device | sed s/[0-9]*[0-9]//`
    7166partition=`echo $device | sed s\%$drive\%\%`
    7267
  • branches/2.2.8/mondo/src/restore-scripts/mondo/grub-MR

    r2814 r2833  
    115115    partno=`basename $bootpart | cut -d'p' -f2`
    116116elif echo $bootpart | grep "/mapper/mpath" > /dev/null ; then
    117     partno=`basename $bootpart | cut -d'p' -f3`
     117    partno=`basename $bootpart | cut -d'p' -f2`
    118118else
    119119    partno=`basename $bootpart | sed s/[a-z]*//`
     
    128128    line=`grep $base /proc/mdstat | head -n1`
    129129    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`
    131132    echo "mbrpart is $mbrpart"
    132133    partno="0"; # cheating - FIXME   
  • branches/2.2.8/mondo/src/restore-scripts/mondo/label-partitions-as-necessary

    r2801 r2833  
    6161noof_blank_lines=0
    6262read 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
     63while [ "$line" != "" ] && [ "$noof_blank_lines" -le "5" ] ; do
    6564    if [ "$line" = "" ] ; then
    6665        noof_blank_lines=$(($noof_blank_lines+1))
Note: See TracChangeset for help on using the changeset viewer.