Changeset 3301 in MondoRescue
- Timestamp:
- Jun 17, 2014, 9:10:18 PM (11 years ago)
- Location:
- branches/3.2/mondo/src/mondorestore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/mondorestore/mondo-prep.c
r3300 r3301 2119 2119 char *which_format_command_do_i_need(char *format) { 2120 2120 2121 char *program = NULL; 2122 2121 2123 assert_string_is_neither_NULL_nor_zerolength(format); 2122 2124 -
branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c
r3299 r3301 587 587 * up correctly on the first boot. 588 588 */ 589 void protect_against_braindead_sysadmins() 590 { 591 run_program_and_log_output("touch " MNT_RESTORING "/var/log/pacct", 592 FALSE); 593 run_program_and_log_output("touch " MNT_RESTORING "/var/account/pacct", 594 FALSE); 589 void protect_against_braindead_sysadmins() { 590 591 run_program_and_log_output("touch " MNT_RESTORING "/var/log/pacct", FALSE); 592 run_program_and_log_output("touch " MNT_RESTORING "/var/account/pacct", FALSE); 595 593 if (run_program_and_log_output("ls " MNT_RESTORING " /tmp", FALSE)) { 596 run_program_and_log_output("chmod 1777 " MNT_RESTORING "/tmp", 597 FALSE); 598 } 599 run_program_and_log_output("mkdir -p " MNT_RESTORING 600 "/var/run/console", FALSE); 601 run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null", 602 FALSE); 603 run_program_and_log_output("cd " MNT_RESTORING 604 "; for i in `ls home/`; do echo \"Moving $i's spurious files to $i/.disabled\"; mkdir \"$i\"/.disabled ; mv -f \"$i\"/.DCOP* \"$i\"/.MCOP* \"$i\"/.*authority \"$i\"/.kde/tmp* \"$i\"/.kde/socket* \"$i\"/.disabled/ ; done", 605 TRUE); 606 run_program_and_log_output("rm -f " MNT_RESTORING "/var/run/*.pid", 607 TRUE); 608 run_program_and_log_output("rm -f " MNT_RESTORING "/var/lock/subsys/*", 609 TRUE); 594 run_program_and_log_output("chmod 1777 " MNT_RESTORING "/tmp", FALSE); 595 } 596 run_program_and_log_output("mkdir -p " MNT_RESTORING "/var/run/console", FALSE); 597 run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null", FALSE); 598 run_program_and_log_output("cd " MNT_RESTORING "; for i in `ls home/`; do echo \"Moving $i's spurious files to $i/.disabled\"; mkdir \"$i\"/.disabled ; mv -f \"$i\"/.DCOP* \"$i\"/.MCOP* \"$i\"/.*authority \"$i\"/.kde/tmp* \"$i\"/.kde/socket* \"$i\"/.disabled/ ; done", TRUE); 599 run_program_and_log_output("rm -f " MNT_RESTORING "/var/run/*.pid", TRUE); 600 run_program_and_log_output("rm -f " MNT_RESTORING "/var/lock/subsys/*", TRUE); 610 601 } 611 602 … … 1903 1894 1904 1895 mountlist = malloc(sizeof(struct mountlist_itself)); 1905 memcpy((void *) mountlist, (void *) p_external_copy_of_mountlist, 1906 sizeof(struct mountlist_itself)); 1896 memcpy((void *) mountlist, (void *) p_external_copy_of_mountlist, sizeof(struct mountlist_itself)); 1907 1897 sort_mountlist_by_mountpoint(mountlist, 0); 1908 1898 1909 1899 run_program_and_log_output("df -m -P", 3); 1910 1900 mvaddstr_and_log_it(g_currentY, 0, "Unmounting devices "); 1911 open_progress_form("Unmounting devices", 1912 "Unmounting all devices that were mounted,", 1913 "in preparation for the post-restoration reboot.", 1914 "", mountlist->entries); 1901 open_progress_form("Unmounting devices", "Unmounting all devices that were mounted,", "in preparation for the post-restoration reboot.", "", mountlist->entries); 1915 1902 if (chdir("/")) { 1916 1903 // FIXME 1917 1904 } 1918 for (i = 0; 1919 i < 10 1920 && 1921 run_program_and_log_output 1922 ("ps | grep buffer | grep -v \"grep buffer\"", TRUE) == 0; 1923 i++) { 1905 for (i = 0; i < 10 && run_program_and_log_output("ps | grep buffer | grep -v \"grep buffer\"", TRUE) == 0; i++) { 1924 1906 sleep(1); 1925 1907 log_msg(2, "Waiting for buffer() to finish"); … … 1930 1912 mr_asprintf(tmp, "cp -f %s " MNT_RESTORING "/var/log", MONDO_LOGFILE); 1931 1913 if (run_program_and_log_output(tmp, FALSE)) { 1932 log_msg(1, 1933 "Error. Failed to copy log to PC's /var/log dir. (Mounted read-only?)"); 1914 log_msg(1, "Error. Failed to copy log to PC's /var/log dir. (Mounted read-only?)"); 1934 1915 } 1935 1916 paranoid_free(tmp); 1936 1917 if (does_file_exist("/tmp/DUMBASS-GENTOO")) { 1937 run_program_and_log_output("mkdir -p " MNT_RESTORING 1938 "/mnt/.boot.d", 5); 1918 run_program_and_log_output("mkdir -p " MNT_RESTORING "/mnt/.boot.d", 5); 1939 1919 } 1940 1920 -
branches/3.2/mondo/src/mondorestore/mondorestore.c
r3278 r3301 634 634 mr_free(tmp1); 635 635 if (res) { 636 log_to_screen 637 ("label-partitions-as-necessary returned an error"); 636 log_to_screen("label-partitions-as-necessary returned an error"); 638 637 mvaddstr_and_log_it(g_currentY++, 74, "Failed."); 639 638 } else { … … 727 726 * @warning <b><i>THIS WILL ERASE ALL EXISTING DATA!</i></b> 728 727 */ 729 int 730 nuke_mode(struct mountlist_itself *mountlist, 731 struct raidlist_itself *raidlist) 728 int nuke_mode(struct mountlist_itself *mountlist, struct raidlist_itself *raidlist) 732 729 { 733 730 int retval = 0; … … 807 804 retval += res; 808 805 if (res) { 809 mvaddstr_and_log_it(g_currentY++, 810 0, 811 "Failed to partition and/or format your hard drives."); 806 mvaddstr_and_log_it(g_currentY++, 0, "Failed to partition and/or format your hard drives."); 812 807 813 808 if (ask_me_yes_or_no("Try in interactive mode instead?")) { … … 815 810 goto after_the_nuke; 816 811 } else 817 if (!ask_me_yes_or_no 818 ("Would you like to try to proceed anyway?")) { 812 if (!ask_me_yes_or_no("Would you like to try to proceed anyway?")) { 819 813 return (retval); 820 814 } … … 823 817 if (retval) { 824 818 unmount_all_devices(mountlist); 825 log_to_screen 826 ("Unable to mount all partitions. Sorry, I cannot proceed."); 819 log_to_screen("Unable to mount all partitions. Sorry, I cannot proceed."); 827 820 return (retval); 828 821 } … … 831 824 clean_multipathconf(); 832 825 if (!run_boot_loader(FALSE)) { 833 log_msg(1, 834 "Great! Boot loader was installed. No need for msg at end."); 826 log_msg(1, "Great! Boot loader was installed. No need for msg at end."); 835 827 } 836 828 clean_blkid(); 837 829 protect_against_braindead_sysadmins(); 838 830 retval += unmount_all_devices(mountlist); 839 mvaddstr_and_log_it(g_currentY, 840 0, 841 "Using tune2fs/tune4fs to identify your ext2,3,4 partitions"); 842 843 mr_asprintf(tmp1, "label-partitions-as-necessary %s < /tmp/fstab >> %s 2>> %s", MINDI_CACHE"/mountlist.txt", MONDO_LOGFILE, MONDO_LOGFILE); 831 mvaddstr_and_log_it(g_currentY, 0, "Using tune2fs/tune4fs to identify your ext2,3,4 partitions"); 832 833 mr_asprintf(tmp1, "label-partitions-as-necessary %s < /tmp/fstab >> %s 2>> %s", "/tmp/mountlist.txt", MONDO_LOGFILE, MONDO_LOGFILE); 844 834 res = run_program_and_log_output(tmp1, TRUE); 845 835 mr_free(tmp1);
Note:
See TracChangeset
for help on using the changeset viewer.