Changeset 3147 in MondoRescue for branches/3.1/mondo/src/mondorestore/mondorestore.c
- Timestamp:
- Jun 19, 2013, 8:34:46 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/mondorestore/mondorestore.c
r2937 r3147 63 63 */ 64 64 bool g_ISO_restore_mode = FALSE; /* are we in Iso Mode? */ 65 66 /* Whether we should fail immediately at first error */ 67 bool g_fail_immediately = FALSE; 65 68 66 69 /** … … 618 621 ("Label/Identify your ext2/ext3/ext4 partitions if necessary?")) { 619 622 mvaddstr_and_log_it(g_currentY, 0, 620 "Using tune2fs to identify your ext2,3,4 partitions");623 "Using tune2fs/tune4fs to identify your ext2,3,4 partitions"); 621 624 if (does_file_exist("/tmp/fstab.new")) { 622 625 mr_asprintf(fstab_fname, "/tmp/fstab.new"); … … 710 713 711 714 712 /* MONDO - saving your a$$since Feb 18th, 2000 */715 /* MONDO - saving your systems since Feb 18th, 2000 */ 713 716 714 717 … … 730 733 int retval = 0; 731 734 int res = 0; 732 bool boot_loader_installed = FALSE;733 735 char *tmp = NULL; 734 736 char *tmp1 = NULL; … … 829 831 log_msg(1, 830 832 "Great! Boot loader was installed. No need for msg at end."); 831 boot_loader_installed = TRUE;832 833 } 833 834 clean_blkid(); … … 836 837 mvaddstr_and_log_it(g_currentY, 837 838 0, 838 "Using tune2fs to identify your ext2,3partitions");839 "Using tune2fs/tune4fs to identify your ext2,3,4 partitions"); 839 840 840 841 mr_asprintf(tmp, "label-partitions-as-necessary %s < /tmp/fstab >> %s 2>> %s", MINDI_CACHE"/mountlist.txt", MONDO_LOGFILE, MONDO_LOGFILE); … … 1601 1602 1602 1603 if (use_star) { 1603 mr_asprintf(command, "star -x -force-remove - U " STAR_ACL_SZ " errctl=file=%s", tarball_fname);1604 mr_asprintf(command, "star -x -force-remove -sparse -U " STAR_ACL_SZ " file=%s", tarball_fname); 1604 1605 if (strstr(tarball_fname, ".bz2")) { 1605 1606 mr_strcat(command, " -bz"); … … 1639 1640 } 1640 1641 1641 if (g_getfattr) { 1642 log_msg(1, "Setting fattr list %s", xattr_fname); 1643 if (length_of_file(xattr_fname) > 0) { 1644 res = set_fattr_list(filelist_subset_fname, xattr_fname); 1645 if (res) { 1646 log_to_screen("Errors occurred while setting extended attributes"); 1647 } else { 1648 log_msg(1, "I set xattr OK"); 1642 if (! use_star) { 1643 if (g_getfattr) { 1644 log_msg(1, "Setting fattr list %s", xattr_fname); 1645 if (length_of_file(xattr_fname) > 0) { 1646 res = set_fattr_list(filelist_subset_fname, xattr_fname); 1647 if (res) { 1648 log_to_screen("Errors occurred while setting extended attributes"); 1649 } else { 1650 log_msg(1, "I set xattr OK"); 1651 } 1652 retval += res; 1649 1653 } 1650 retval += res; 1651 } 1652 } 1653 if (g_getfacl) { 1654 log_msg(1, "Setting acl list %s", acl_fname); 1655 if (length_of_file(acl_fname) > 0) { 1656 res = set_acl_list(filelist_subset_fname, acl_fname); 1657 if (res) { 1658 log_to_screen 1659 ("Errors occurred while setting access control lists"); 1660 } else { 1661 log_msg(1, "I set ACL OK"); 1654 } 1655 if (g_getfacl) { 1656 log_msg(1, "Setting acl list %s", acl_fname); 1657 if (length_of_file(acl_fname) > 0) { 1658 res = set_acl_list(filelist_subset_fname, acl_fname); 1659 if (res) { 1660 log_to_screen("Errors occurred while setting access control lists"); 1661 } else { 1662 log_msg(1, "I set ACL OK"); 1663 } 1664 retval += res; 1662 1665 } 1663 retval += res; 1664 } 1665 } 1666 if (retval) { 1666 } 1667 } else { 1668 retval = res; 1669 } 1670 // Be verbose for star 1671 if (retval || use_star) { 1667 1672 mr_asprintf(command, "cat %s >> %s", temp_log, MONDO_LOGFILE); 1668 system(command);1673 paranoid_system(command); 1669 1674 paranoid_free(command); 1670 1675 1671 log_msg(2, "Errors occurred while processing fileset #%d", 1672 current_tarball_number); 1676 if (retval) { 1677 log_msg(2, "Errors occurred while processing fileset #%d", current_tarball_number); 1678 } 1673 1679 } else { 1674 1680 log_msg(2, "Fileset #%d processed OK", current_tarball_number); … … 1782 1788 if (strstr(tarball_fname, ".star.")) { 1783 1789 use_star = TRUE; 1784 mr_asprintf(command, "star - t file=%s %s", afio_fname, executable);1790 mr_asprintf(command, "star -sparse -t file=%s %s", afio_fname, executable); 1785 1791 } else { 1786 1792 use_star = FALSE; … … 1816 1822 if (strstr(tarball_fname, ".star.")) { 1817 1823 // star 1818 mr_asprintf(command, "star - x file=%s %s", afio_fname, executable);1824 mr_asprintf(command, "star -sparse -x file=%s %s", afio_fname, executable); 1819 1825 if (filelist) { 1820 1826 mr_strcat(command, " list=%s", filelist_subset_fname); … … 2216 2222 res = read_header_block_from_stream(&biggie_size, biggie_fname, &ctrl_chr); 2217 2223 if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) { 2218 res = 2219 read_EXAT_files_from_tape(&biggie_size, biggie_fname, &ctrl_chr, xattr_fname, acl_fname); 2224 res = read_EXAT_files_from_tape(&biggie_size, biggie_fname, &ctrl_chr, xattr_fname, acl_fname); 2220 2225 } 2221 2226 … … 2354 2359 mr_free(tmp); 2355 2360 2356 chdir(bkpinfo->restore_path); /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */ 2361 if (chdir(bkpinfo->restore_path)) { /* I don't know why this is needed _here_ but it seems to be. -HR, 02/04/2002 */ 2362 //FIXME 2363 } 2357 2364 2358 2365 run_program_and_log_output("pwd", 5); … … 2470 2477 log_msg(2, "restore_everything() --- starting"); 2471 2478 g_current_media_number = 1; 2472 getcwd(cwd, MAX_STR_LEN - 1); 2479 if (getcwd(cwd, MAX_STR_LEN - 1)) { 2480 // FIXME 2481 } 2473 2482 mr_asprintf(tmp, "mkdir -p %s", bkpinfo->restore_path); 2474 2483 run_program_and_log_output(tmp, FALSE); … … 2476 2485 2477 2486 log_msg(1, "Changing dir to %s", bkpinfo->restore_path); 2478 chdir(bkpinfo->restore_path); 2479 getcwd(newpath, MAX_STR_LEN - 1); 2487 if (chdir(bkpinfo->restore_path)) { 2488 //FIXME 2489 } 2490 if (getcwd(newpath, MAX_STR_LEN - 1)) { 2491 // FIXME 2492 } 2480 2493 log_msg(1, "path is now %s", newpath); 2481 2494 log_msg(1, "restoring everything"); … … 2511 2524 resB = restore_all_biggiefiles_from_CD(filelist); 2512 2525 } 2513 chdir(cwd); 2526 if (chdir(cwd)) { 2527 //FIXME 2528 } 2514 2529 if (resA + resB) { 2515 2530 log_to_screen("Errors occurred while data was being restored."); … … 2654 2669 if (argc == 2 && strcmp(argv[1], "--edit-mountlist") == 0) { 2655 2670 #ifdef __FreeBSD__ 2656 system("mv -f /tmp/raidconf.txt /etc/raidtab");2671 paranoid_system("mv -f /tmp/raidconf.txt /etc/raidtab"); 2657 2672 if (!does_file_exist("/etc/raidtab")) 2658 system("vinum printconfig > /etc/raidtab");2673 paranoid_system("vinum printconfig > /etc/raidtab"); 2659 2674 #endif 2660 2675 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 2661 2676 res = let_user_edit_the_mountlist(mountlist, raidlist); 2662 2677 #ifdef __FreeBSD__ 2663 system("mv -f /etc/raidtab /tmp/raidconf.txt");2678 paranoid_system("mv -f /etc/raidtab /tmp/raidconf.txt"); 2664 2679 #endif 2665 2680 paranoid_MR_finish(res); … … 2734 2749 2735 2750 if (argc == 3 && strcmp(argv[1], "--mdconv") == 0) { 2736 finish(create_raidtab_from_mdstat( argv[2]));2751 finish(create_raidtab_from_mdstat(MDSTAT_FILE,argv[2])); 2737 2752 } 2738 2753 … … 2820 2835 mr_asprintf(tmp, "sshfs -o ro %s /tmp/isodir", bkpinfo->netfs_mount); 2821 2836 } 2822 } else { 2823 if (bkpinfo->netfs_user) { 2824 mr_asprintf(tmp, "mount %s@%s -o nolock,ro /tmp/isodir", bkpinfo->netfs_user,bkpinfo->netfs_mount); 2837 } else { 2838 if (strstr(bkpinfo->netfs_proto, "smbfs")) { 2839 if (bkpinfo->netfs_user) { 2840 mr_asprintf(tmp, "mount -t cifs %s /tmp/isodir -o user=%s,nolock,ro ", bkpinfo->netfs_mount,bkpinfo->netfs_user); 2841 } else { 2842 mr_asprintf(tmp, "mount -t cifs %s /tmp/isodir -o nolock,ro ", bkpinfo->netfs_mount); 2843 } 2825 2844 } else { 2826 mr_asprintf(tmp, "mount %s -o nolock,ro /tmp/isodir", bkpinfo->netfs_mount); 2845 if (bkpinfo->netfs_user) { 2846 mr_asprintf(tmp, "mount %s@%s -o nolock,ro /tmp/isodir", bkpinfo->netfs_user,bkpinfo->netfs_mount); 2847 } else { 2848 mr_asprintf(tmp, "mount %s -o nolock,ro /tmp/isodir", bkpinfo->netfs_mount); 2849 } 2827 2850 } 2828 2851 } … … 2956 2979 if (strstr(bkpinfo->tmpdir,"mondo.tmp.") != NULL) { 2957 2980 mr_asprintf(tmp, "rm -Rf %s", bkpinfo->tmpdir); 2958 system(tmp);2981 paranoid_system(tmp); 2959 2982 mr_free(tmp); 2960 2983 }
Note:
See TracChangeset
for help on using the changeset viewer.