Ignore:
Timestamp:
Jun 19, 2013, 8:34:46 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • First pass on svn merge -r 2935:3146 ../3.0
File:
1 edited

Legend:

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

    r2937 r3147  
    213213    paranoid_free(tmp);
    214214
    215     mr_asprintf(command, "star H=exustar list=%s -c " STAR_ACL_SZ " file=%s", filelist, fname);
     215    mr_asprintf(command, "star H=exustar list=%s -c -sparse " STAR_ACL_SZ " file=%s", filelist, fname);
    216216    if (bkpinfo->use_lzo) {
    217217        mr_free(command);
     
    511511    char *use_star_sz = NULL;
    512512    char *bootldr_str = NULL;
     513    char *bootldr_ver = NULL;
    513514    char *tape_device = NULL;
    514515    char *broken_bios_sz = NULL;
     
    682683            run_program_and_log_output("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5);
    683684        }
    684         if ((!does_file_exist("/boot/grub/menu.lst")) && (!does_file_exist("/boot/grub/grub.cfg"))) {
    685             fatal_error("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst or /boot/grub/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?");
    686         }
     685        if ((!does_file_exist("/boot/grub/menu.lst")) && (!does_file_exist("/boot/grub/grub.cfg")) && (!does_file_exist("/boot/grub2/grub.cfg"))) {
     686            fatal_error("The de facto standard location for your boot loader's config file is /boot/grub/menu.lst, /boot/grub/grub.cfg, or /boot/grub2/grub.cfg but I cannot find it there. What is wrong with your Linux distribution?");
     687        }
     688        mr_asprintf(&bootldr_ver, "%s", call_program_and_get_last_line_of_output("grub --version"));
    687689    } else if (bkpinfo->boot_loader == 'E') {
    688690        mr_asprintf(bootldr_str, "ELILO");
     
    719721    }
    720722    log_to_screen("Your boot loader is %s and it boots from %s", bootldr_str, bkpinfo->boot_device);
     723    if (bootldr_ver != NULL) {
     724        mr_asprintf(&tmp, "Boot loader version string: %s", bootldr_ver);
     725        log_to_screen(tmp);
     726        mr_free(tmp);
     727    }
    721728
    722729    mr_asprintf(tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir);
     
    927934    char *curr_acl_list_fname = NULL;
    928935
    929     struct s_bkpinfo *bkpinfo_bis;
    930936    char *tmp = NULL;
    931937    int res = 0, retval = 0;
     
    940946    p_next_set_to_archive = (int *) (inbuf + 8);
    941947    p_list_of_fileset_flags = (char *) (inbuf + 12);
    942     bkpinfo_bis = (struct s_bkpinfo *) (inbuf + BKPINFO_LOC_OFFSET);
    943948
    944949    mr_asprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir, 0L);
     
    14741479
    14751480    log_msg(2, "make_usb_fs --- scratchdir=%s", bkpinfo->scratchdir);
    1476     (void) getcwd(old_pwd, MAX_STR_LEN - 1);
     1481    tmp1 = getcwd(old_pwd, MAX_STR_LEN - 1);
    14771482    mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir);
    14781483    run_program_and_log_output(tmp, FALSE);
    14791484    mr_free(tmp);
    1480     (void)chdir(bkpinfo->scratchdir);
     1485    if (chdir(bkpinfo->scratchdir)) {
     1486        // FIXME
     1487    }
    14811488
    14821489    mds = media_descriptor_string(bkpinfo->backup_media_type);
     
    15421549    }
    15431550
    1544     (void)chdir(old_pwd);
     1551    if (chdir(old_pwd)) {
     1552        // FIXME
     1553    }
    15451554    if (retval) {
    15461555        log_msg(1, "WARNING - make_usb_fs returned an error");
     
    15991608
    16001609    log_msg(2, "make_iso_fs --- scratchdir=%s --- destfile=%s", bkpinfo->scratchdir, destfile);
    1601     (void) getcwd(old_pwd, MAX_STR_LEN - 1);
     1610    tmp2 = getcwd(old_pwd, MAX_STR_LEN - 1);
    16021611    mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir);
    16031612    run_program_and_log_output(tmp, FALSE);
    16041613    mr_free(tmp);
    16051614
    1606     chdir(bkpinfo->scratchdir);
     1615    if (chdir(bkpinfo->scratchdir)) {
     1616        // FIXME
     1617    }
    16071618
    16081619    if (bkpinfo->call_before_iso) {
     
    18131824    }
    18141825
    1815     chdir(old_pwd);
     1826    if (chdir(old_pwd)) {
     1827        // FIXME
     1828    }
    18161829    if (retval) {
    18171830        log_msg(1, "WARNING - make_iso_fs returned an error");
     
    18661879    /*@ pointers ******************************************* */
    18671880    FILE *fin = NULL;
     1881    char *q;
    18681882
    18691883    /*@ buffers ******************************************** */
     
    24112425    /*@ long long ****************************************************** */
    24122426    off_t length_of_incoming_file = (off_t)0;
    2413     t_archtype type;
    24142427    va_list ap;
    24152428
     
    24332446        write_header_block_to_stream(length_of_incoming_file, curr_file,
    24342447                                     start_chr);
    2435         if (strstr(curr_file, ".afio.") || strstr(curr_file, ".star.")) {
    2436             type = fileset;
    2437         } else if (strstr(curr_file, "slice")) {
    2438             type = biggieslice;
    2439         } else {
    2440             type = other;
    2441         }
    24422448        res = write_file_to_stream_from_file(curr_file);
    24432449        retval += res;
     
    27982804    mr_free(tmp);
    27992805
    2800     (void) fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout);
    2801     fclose(fout);
    2802 
     2806    res = fwrite((void *) &biggiestruct, 1, sizeof(biggiestruct), fout);
     2807    if (fout != NULL) {
     2808        paranoid_fclose(fout);
     2809    }
    28032810    log_msg(1, "Opening in %s; slicing it and writing to CD/tape", file_to_openin);
    28042811    if (!(fin = fopen(file_to_openin, "r"))) {
     
    28392846                if (blksize > 0) {
    28402847                    totalread = totalread + blksize;
    2841                     (void) fwrite(tempblock, 1, blksize, fout);
     2848                    res = fwrite(tempblock, 1, blksize, fout);
    28422849                } else {
    28432850                    break;
     
    31313138            log_to_screen("Please reboot from the 1st %s in Compare Mode, as a precaution.", mds);
    31323139            mr_free(mds);
    3133             chdir("/");
     3140            if (chdir("/")) {
     3141                // FIXME
     3142            }
    31343143            log_it("Before calling verification of image()");
    31353144            if (bkpinfo->backup_media_type == usb) {
     
    32093218    assert(bkpinfo != NULL);
    32103219    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    3211         chdir("/");
     3220        if (chdir("/")) {
     3221            // FIXME
     3222        }
    32123223        mvaddstr_and_log_it(g_currentY, 0,
    32133224                            "Verifying archives against live filesystem");
     
    32323243            bkpinfo->media_device = find_cdrom_device(FALSE);   // replace 0,0,0 with /dev/cdrom
    32333244        }
    3234         chdir("/");
     3245        if (chdir("/")) {
     3246            // FIXME
     3247        }
    32353248        for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) {
    32363249            if (cdno != g_current_media_number) {
     
    32533266        }
    32543267        mr_asprintf(tmp, "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE);
    3255         (void)system(tmp);
     3268        res = system(tmp);
    32563269        mr_free(tmp);
    32573270
    32583271        mr_asprintf(tmp, "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files", MONDO_LOGFILE, MONDO_CACHE);
    3259         (void)system(tmp);
     3272        res = system(tmp);
    32603273        mr_free(tmp);
    32613274        run_program_and_log_output("umount " MNT_CDROM, FALSE);
Note: See TracChangeset for help on using the changeset viewer.