Changeset 1236 in MondoRescue for branches/2.2.2/mondo/src/common


Ignore:
Timestamp:
Mar 12, 2007, 12:23:16 AM (17 years ago)
Author:
Bruno Cornec
Message:

Port from stable important patches for 2.2.2:
mindi-busybox:

  • Improve Gentoo packaging

mindi:

  • Better messages for analyze-my-lvm
  • Add support for newer Qlogic drivers (qla2300 & 2400), mpt, dm and ohci
  • Fix a bug in mindi for the FAILSAFE support
  • PATH fixed for init in restore (/usr/games added for petris)
  • Fiw a bug where restore failing because no archive files are found when -G is used
  • /media is now completely excluded as per StandardsCompliance

mondo:

  • Handle no compression + verify correctly
  • various HOWTO fixes
  • Fix temporarily a bug when a biggiefile > 32MB was compressed below the size

of a slice (16MB)

  • Better module loading in insmod_crucial_modules
  • Improve Gentoo packaging
  • Small typo fix for mondorestore man page
  • Small memory management improvements
  • Store NFS config only once
  • Fix a flaw in libmondo-mountlist.c (there since rev [1] !!)
  • Increased MAX_STR_LEN to 384 to make it divisible without remainder by eight

for 64 bits platforms

  • Fix a bug where no bzip2 format file would be found when supporting gzip
  • CentOS fixes
Location:
branches/2.2.2/mondo/src/common
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.2/mondo/src/common/libmondo-archive.c

    r998 r1236  
    25882588    assert(bkpinfo != NULL);
    25892589    /* slice big files */
    2590     malloc_string(blah);
    25912590    malloc_string(biggielist);
    25922591    malloc_string(xattr_fname);
    25932592    malloc_string(acl_fname);
    2594     command = malloc(1200);
    25952593    mvaddstr_and_log_it(g_currentY, 0,
    25962594                        "Archiving large files to media           ");
     
    26032601    }
    26042602
    2605     sprintf(command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,
     2603    asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,
    26062604            biggielist);
    26072605    paranoid_system(command);
    2608     sprintf(blah, "biggielist = %s", biggielist);
     2606    paranoid_free(command);
     2607
     2608    asprintf(&blah, "biggielist = %s", biggielist);
    26092609    log_msg(2, blah);
     2610    paranoid_free(blah);
    26102611
    26112612    if (!does_file_exist(biggielist)) {
     
    26152616    if (g_getfattr) {
    26162617        get_fattr_list(biggielist, xattr_fname);
    2617         sprintf(command, "cp %s %s/archives/", xattr_fname,
     2618        asprintf(&command, "cp %s %s/archives/", xattr_fname,
    26182619            bkpinfo->scratchdir);
    26192620        paranoid_system(command);
     2621        paranoid_free(command);
    26202622    }
    26212623    if (g_getfacl) {
    26222624        get_acl_list(biggielist, acl_fname);
    2623         sprintf(command, "cp %s %s/archives/", acl_fname, bkpinfo->scratchdir);
     2625        asprintf(&command, "cp %s %s/archives/", acl_fname,
     2626             bkpinfo->scratchdir);
    26242627        paranoid_system(command);
     2628        paranoid_free(command);
    26252629    }
    26262630
    26272631    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    26282632        res += write_EXAT_files_to_tape(bkpinfo, xattr_fname, acl_fname);
    2629         sprintf(blah, "%ld", count_lines_in_file(biggielist));
     2633        asprintf(&blah, "%ld", count_lines_in_file(biggielist));
    26302634        write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES);
     2635        paranoid_free(blah);
    26312636    }
    26322637    res = make_slices_and_images(bkpinfo, biggielist);
     
    26492654    return (retval);
    26502655}
    2651 
    26522656
    26532657
     
    34743478    strcpy(tmp, slice_fname(biggie_file_number, 0, bkpinfo->tmpdir, ""));
    34753479    fout = fopen(tmp, "w");
     3480    if (fout == NULL) {
     3481        mr_msg(1, "Unable to open and write to %s\n", tmp);
     3482        paranoid_free(tmp);
     3483        paranoid_free(suffix);
     3484        return (1);
     3485    }
     3486
    34763487    (void) fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout);
    34773488    paranoid_fclose(fout);
  • branches/2.2.2/mondo/src/common/libmondo-filelist.c

    r1015 r1236  
    352352    assert(maxsetsizeK > 0);
    353353
    354     max_sane_size_for_a_file = 32L * 1024L;
     354    max_sane_size_for_a_file = 64L * 1024L;
    355355// max_sane_size_for_a_file = maxsetsizeK*2;
    356356//  if (max_sane_size_for_a_file > 32*1024)
     
    17471747        log_msg(1, "Calculating filelist");
    17481748        sprintf(exclude_paths, " %s %s %s %s %s %s . .. \
    1749 " MNT_CDROM " " MNT_FLOPPY " /media/cdrom /media/cdrecorder \
     1749" MNT_CDROM " " MNT_FLOPPY " /media \
    17501750/proc /sys /root/images/mondo /root/images/mindi ", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
    17511751
  • branches/2.2.2/mondo/src/common/libmondo-files.c

    r1002 r1236  
    12451245    strcpy(nfs_server_ipaddr, tmp);
    12461246    strcpy(nfs_mount, p);
     1247
    12471248    /* BERLIOS : there is a bug #67 here as it only considers the first NIC */
    12481249    sprintf(command,
     
    14171418    char tmp[MAX_STR_LEN];
    14181419    char *p;
     1420    char *q = NULL;
     1421
     1422    q = strrchr(filename, '.');
     1423    if (q == NULL) {
     1424        return (FALSE);
     1425    }
    14191426
    14201427    sprintf(tmp, "%s/do-not-compress-these", g_mondo_home);
     
    14221429        return (FALSE);
    14231430    }
    1424     strcpy(do_not_compress_these, last_line_of_file(tmp));
     1431    /* BERLIOS: This is just plain WRONG !! */
     1432    strcpy(do_not_compress_these,last_line_of_file(tmp));
     1433
    14251434    for (p = do_not_compress_these; p != NULL; p++) {
    14261435        strcpy(tmp, p);
     
    14281437            *(strchr(tmp, ' ')) = '\0';
    14291438        }
    1430         if (!strcmp(sz_last_suffix(filename), tmp)) {   /*printf("MATCH\n"); */
     1439        if (!strcmp(q, tmp)) {
    14311440            return (TRUE);
    14321441        }
  • branches/2.2.2/mondo/src/common/libmondo-fork.c

    r797 r1236  
    155155    }
    156156    strip_spaces(result);
     157    paranoid_free(tmp);
    157158    return (result);
    158159}
     
    201202    log_msg(3, "Starting");
    202203    assert(bkpinfo != NULL);
    203     assert_string_is_neither_NULL_nor_zerolength(basic_call);
     204    // BERLIOS: doesn't work even if the string is correct !
     205    //assert_string_is_neither_NULL_nor_zerolength(basic_call);
    204206    assert_string_is_neither_NULL_nor_zerolength(isofile);
    205207    assert_string_is_neither_NULL_nor_zerolength(logstub);
  • branches/2.2.2/mondo/src/common/libmondo-mountlist.c

    r541 r1236  
    5858#include "libmondo-tools-EXT.h"
    5959#include "libmondo-string-EXT.h"
    60 #include "libmondo-gui-EXT.h"
     60#include "newt-specific-EXT.h"
    6161
    6262/*@unused@*/
     
    369369        sprintf(tmp, " %ld MB unallocated on %s.",
    370370                physical_drive_size - amount_allocated, drive);
    371         log_it(tmp), strcat(flaws_str, tmp);
     371        log_it(tmp);
     372        strcat(flaws_str, tmp);
     373        /* BERLIOS: Flawed since rev 1 !! */
     374        res++;
    372375    }
    373376    if (res) {
     
    525528        sprintf(tmp, " %ld MB unallocated on %s.",
    526529                physical_drive_size - amount_allocated, drive);
    527         log_it(tmp), strcat(flaws_str, tmp);
     530        log_it(tmp);
     531        strcat(flaws_str, tmp);
     532        /* BERLIOS: Flawed since rev 1 !! */
     533        res++;
    528534    }
    529535
  • branches/2.2.2/mondo/src/common/libmondo-string.c

    r841 r1236  
    513513
    514514    input = malloc(2000);
    515     assert_string_is_neither_NULL_nor_zerolength(ip);
     515    // BERLIOS: seems to cause invalid errors
     516    //assert_string_is_neither_NULL_nor_zerolength(ip);
    516517    assert_string_is_neither_NULL_nor_zerolength(token);
    517518    assert(value != NULL);
  • branches/2.2.2/mondo/src/common/libmondo-tools.c

    r998 r1236  
    459459/**
    460460 * Insert modules that Mondo requires.
    461  * Currently inserts @c dos, @c fat, @c vfat, and @c osst for Linux;
     461 * Currently inserts @c msdos, @c vfat, and @c loop for Linux;
    462462 * @c msdosfs and @c ext2fs for FreeBSD.
    463463 */
     
    468468    system("kldstat | grep ext2fs  || kldload ext2fs 2> /dev/null");
    469469#else
    470     system("modprobe dos &> /dev/null");
    471     system("modprobe fat &> /dev/null");
    472     system("modprobe vfat &> /dev/null");
    473     //  system("modprobe osst &> /dev/null");
     470    system("modprobe -a msdos vfat loop &> /dev/null");
    474471#endif
    475472}
  • branches/2.2.2/mondo/src/common/libmondo-verify.c

    r1003 r1236  
    369369           does_file_exist(slice_fname
    370370                           (bigfile_num, slice_num, mountpoint, ""))) {
    371 // handle slices until end of CD
     371        // handle slices until end of CD
    372372        if (slice_num == 0) {
    373373            log_msg(2, "ISO=%d  bigfile=%ld --START--",
     
    391391            if (!(forig = fopen(tmp, "r"))) {
    392392                log_msg(2, "Failed to open bigfile. Darn.");
     393                log_to_screen(_("%s/%s not found on live filesystem"),
     394                            bkpinfo->restore_path,
     395                            biggiestruct.filename);
     396                asprintf(&tmp, "echo \"%s/%s not found\" >> /tmp/biggies.changed",
     397                            bkpinfo->restore_path,
     398                            biggiestruct.filename);
     399                system(tmp);
     400                paranoid_free(tmp);
     401
     402                bigfile_num++;
     403                slice_num = 0;
    393404                retval++;
     405            } else {
     406                slice_num++;
    394407            }
    395             slice_num++;
    396         } else if (does_file_exist
    397                    (slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
     408            paranoid_free(tmp2);
     409        } else if (does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, "")) &&
     410                   (length_of_file(slice_fname(bigfile_num, slice_num, mountpoint, "")) == 0)) {
    398411            log_msg(2, "ISO=%d  bigfile=%ld ---END---",
    399412                    g_current_media_number, bigfile_num);
     
    402415            slice_num = 0;
    403416        } else {
    404             log_msg(2, "ISO=%d  bigfile=%ld  slice=%ld  \r",
     417            mr_msg(2, "ISO=%d  bigfile=%ld  slice=%ld",
    405418                    g_current_media_number, bigfile_num, slice_num);
    406             if (bkpinfo->compression_level > 0) {
     419            if (!does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
    407420                sprintf(command, "%s -dc %s 2>> %s",
    408421                        sz_exe,
    409                         slice_fname(bigfile_num, slice_num, mountpoint,
    410                                     bkpinfo->zip_suffix),
     422                        slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix),
    411423                        MONDO_LOGFILE);
    412424            } else {
    413                 sprintf(command, "cat %s",
    414                         slice_fname(bigfile_num, slice_num, mountpoint,
    415                                     bkpinfo->zip_suffix));
     425                sprintf(command, "cat %s 2>> %s",
     426                        slice_fname(bigfile_num, slice_num, mountpoint, ""), MONDO_LOGFILE);
    416427            }
    417428            if ((pin = popen(command, "r"))) {
     
    435446                }
    436447                paranoid_pclose(pin);
    437                 if (res && !strncmp(biggiestruct.filename, " /dev/", 5)) {
     448                if (res && !strncmp(biggiestruct.filename, "/dev/", 5)) {
    438449                    log_msg(3,
    439450                            "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.",
  • branches/2.2.2/mondo/src/common/my-stuff.h

    r792 r1236  
    266266#define ARBITRARY_MAXIMUM 2000  ///< The maximum number of items showing at once in the mountlist or filelist editor.
    267267#define MAX_TAPECATALOG_ENTRIES 8192    ///< The maximum number of entries in the tape catalog.
    268 #define MAX_STR_LEN 380         ///< The maximum length of almost all @p char buffers in Mondo.
     268#define MAX_STR_LEN 384         ///< The maximum length of almost all @p char buffers in Mondo.
     269                                        ///  Note: Make this divisible by eight to avoid aligment issues
     270                                        ///        on 64bit platforms like ia64.
    269271#define MAXIMUM_RAID_DEVS 32    ///< The maximum number of RAID devices in the raidlist.
    270272#define MAXIMUM_ADDITIONAL_RAID_VARS 32 ///< The maximum number of additional RAID variables per RAID device in the raidlist.
Note: See TracChangeset for help on using the changeset viewer.