Changeset 3301 for branches/3.2


Ignore:
Timestamp:
Jun 17, 2014, 9:10:18 PM (5 years ago)
Author:
bruno
Message:
  • Fix a usage of mountlist.txt still with MINDI_CACHE, incorrect for now.
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  
    21192119char *which_format_command_do_i_need(char *format) {
    21202120
     2121char *program = NULL;
     2122
    21212123assert_string_is_neither_NULL_nor_zerolength(format);
    21222124
  • branches/3.2/mondo/src/mondorestore/mondo-rstr-tools.c

    r3299 r3301  
    587587* up correctly on the first boot.
    588588*/
    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);
     589void protect_against_braindead_sysadmins() {
     590
     591run_program_and_log_output("touch " MNT_RESTORING "/var/log/pacct", FALSE);
     592run_program_and_log_output("touch " MNT_RESTORING "/var/account/pacct", FALSE);
    595593if (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}
     596run_program_and_log_output("mkdir -p " MNT_RESTORING "/var/run/console", FALSE);
     597run_program_and_log_output("chmod 777 " MNT_RESTORING "/dev/null", FALSE);
     598run_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);
     599run_program_and_log_output("rm -f " MNT_RESTORING "/var/run/*.pid", TRUE);
     600run_program_and_log_output("rm -f " MNT_RESTORING "/var/lock/subsys/*", TRUE);
    610601}
    611602
     
    19031894
    19041895    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));
    19071897    sort_mountlist_by_mountpoint(mountlist, 0);
    19081898
    19091899    run_program_and_log_output("df -m -P", 3);
    19101900    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);
    19151902    if (chdir("/")) {
    19161903        // FIXME
    19171904    }
    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++) {
    19241906        sleep(1);
    19251907        log_msg(2, "Waiting for buffer() to finish");
     
    19301912    mr_asprintf(tmp, "cp -f %s " MNT_RESTORING "/var/log", MONDO_LOGFILE);
    19311913    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?)");
    19341915    }
    19351916    paranoid_free(tmp);
    19361917    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);
    19391919    }
    19401920
  • branches/3.2/mondo/src/mondorestore/mondorestore.c

    r3278 r3301  
    634634        mr_free(tmp1);
    635635        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");
    638637            mvaddstr_and_log_it(g_currentY++, 74, "Failed.");
    639638        } else {
     
    727726 * @warning <b><i>THIS WILL ERASE ALL EXISTING DATA!</i></b>
    728727 */
    729 int
    730 nuke_mode(struct mountlist_itself *mountlist,
    731           struct raidlist_itself *raidlist)
     728int nuke_mode(struct mountlist_itself *mountlist, struct raidlist_itself *raidlist)
    732729{
    733730    int retval = 0;
     
    807804    retval += res;
    808805    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.");
    812807
    813808        if (ask_me_yes_or_no("Try in interactive mode instead?")) {
     
    815810            goto after_the_nuke;
    816811        } 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?")) {
    819813            return (retval);
    820814        }
     
    823817    if (retval) {
    824818        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.");
    827820        return (retval);
    828821    }
     
    831824    clean_multipathconf();
    832825    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.");
    835827    }
    836828    clean_blkid();
    837829    protect_against_braindead_sysadmins();
    838830    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);
    844834    res = run_program_and_log_output(tmp1, TRUE);
    845835    mr_free(tmp1);
Note: See TracChangeset for help on using the changeset viewer.