Changeset 3147 in MondoRescue for branches/3.1/mondo/src/common/libmondo-archive.c
- Timestamp:
- Jun 19, 2013, 8:34:46 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/common/libmondo-archive.c
r2937 r3147 213 213 paranoid_free(tmp); 214 214 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); 216 216 if (bkpinfo->use_lzo) { 217 217 mr_free(command); … … 511 511 char *use_star_sz = NULL; 512 512 char *bootldr_str = NULL; 513 char *bootldr_ver = NULL; 513 514 char *tape_device = NULL; 514 515 char *broken_bios_sz = NULL; … … 682 683 run_program_and_log_output("ln -sf /boot/grub/grub.conf /boot/grub/menu.lst", 5); 683 684 } 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")); 687 689 } else if (bkpinfo->boot_loader == 'E') { 688 690 mr_asprintf(bootldr_str, "ELILO"); … … 719 721 } 720 722 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 } 721 728 722 729 mr_asprintf(tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir); … … 927 934 char *curr_acl_list_fname = NULL; 928 935 929 struct s_bkpinfo *bkpinfo_bis;930 936 char *tmp = NULL; 931 937 int res = 0, retval = 0; … … 940 946 p_next_set_to_archive = (int *) (inbuf + 8); 941 947 p_list_of_fileset_flags = (char *) (inbuf + 12); 942 bkpinfo_bis = (struct s_bkpinfo *) (inbuf + BKPINFO_LOC_OFFSET);943 948 944 949 mr_asprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir, 0L); … … 1474 1479 1475 1480 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); 1477 1482 mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1478 1483 run_program_and_log_output(tmp, FALSE); 1479 1484 mr_free(tmp); 1480 (void)chdir(bkpinfo->scratchdir); 1485 if (chdir(bkpinfo->scratchdir)) { 1486 // FIXME 1487 } 1481 1488 1482 1489 mds = media_descriptor_string(bkpinfo->backup_media_type); … … 1542 1549 } 1543 1550 1544 (void)chdir(old_pwd); 1551 if (chdir(old_pwd)) { 1552 // FIXME 1553 } 1545 1554 if (retval) { 1546 1555 log_msg(1, "WARNING - make_usb_fs returned an error"); … … 1599 1608 1600 1609 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); 1602 1611 mr_asprintf(tmp, "chmod 700 %s", bkpinfo->scratchdir); 1603 1612 run_program_and_log_output(tmp, FALSE); 1604 1613 mr_free(tmp); 1605 1614 1606 chdir(bkpinfo->scratchdir); 1615 if (chdir(bkpinfo->scratchdir)) { 1616 // FIXME 1617 } 1607 1618 1608 1619 if (bkpinfo->call_before_iso) { … … 1813 1824 } 1814 1825 1815 chdir(old_pwd); 1826 if (chdir(old_pwd)) { 1827 // FIXME 1828 } 1816 1829 if (retval) { 1817 1830 log_msg(1, "WARNING - make_iso_fs returned an error"); … … 1866 1879 /*@ pointers ******************************************* */ 1867 1880 FILE *fin = NULL; 1881 char *q; 1868 1882 1869 1883 /*@ buffers ******************************************** */ … … 2411 2425 /*@ long long ****************************************************** */ 2412 2426 off_t length_of_incoming_file = (off_t)0; 2413 t_archtype type;2414 2427 va_list ap; 2415 2428 … … 2433 2446 write_header_block_to_stream(length_of_incoming_file, curr_file, 2434 2447 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 }2442 2448 res = write_file_to_stream_from_file(curr_file); 2443 2449 retval += res; … … 2798 2804 mr_free(tmp); 2799 2805 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 } 2803 2810 log_msg(1, "Opening in %s; slicing it and writing to CD/tape", file_to_openin); 2804 2811 if (!(fin = fopen(file_to_openin, "r"))) { … … 2839 2846 if (blksize > 0) { 2840 2847 totalread = totalread + blksize; 2841 (void)fwrite(tempblock, 1, blksize, fout);2848 res = fwrite(tempblock, 1, blksize, fout); 2842 2849 } else { 2843 2850 break; … … 3131 3138 log_to_screen("Please reboot from the 1st %s in Compare Mode, as a precaution.", mds); 3132 3139 mr_free(mds); 3133 chdir("/"); 3140 if (chdir("/")) { 3141 // FIXME 3142 } 3134 3143 log_it("Before calling verification of image()"); 3135 3144 if (bkpinfo->backup_media_type == usb) { … … 3209 3218 assert(bkpinfo != NULL); 3210 3219 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 3211 chdir("/"); 3220 if (chdir("/")) { 3221 // FIXME 3222 } 3212 3223 mvaddstr_and_log_it(g_currentY, 0, 3213 3224 "Verifying archives against live filesystem"); … … 3232 3243 bkpinfo->media_device = find_cdrom_device(FALSE); // replace 0,0,0 with /dev/cdrom 3233 3244 } 3234 chdir("/"); 3245 if (chdir("/")) { 3246 // FIXME 3247 } 3235 3248 for (cdno = 1; cdno < 99 && bkpinfo->verify_data; cdno++) { 3236 3249 if (cdno != g_current_media_number) { … … 3253 3266 } 3254 3267 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); 3256 3269 mr_free(tmp); 3257 3270 3258 3271 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); 3260 3273 mr_free(tmp); 3261 3274 run_program_and_log_output("umount " MNT_CDROM, FALSE);
Note:
See TracChangeset
for help on using the changeset viewer.