Changeset 2136 in MondoRescue


Ignore:
Timestamp:
Feb 2, 2009, 1:09:01 PM (12 years ago)
Author:
Bruno Cornec
Message:

Fix a bug with Newt where a newtResume was missing after multipath.conf edit

Location:
branches/2.2.8/mondo/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.8/mondo/src/common/newt-specific.c

    r2064 r2136  
    121121
    122122        /*@ buffers ********************************************************** */
    123         char *tmp;
    124123        int i;
    125124
    126          tmp = malloc(MAX_NEWT_COMMENT_LEN);
    127125         assert_string_is_neither_NULL_nor_zerolength(prompt);
    128126
    129127        if (g_text_mode) {
     128
     129            char *tmp;
     130            tmp = malloc(MAX_NEWT_COMMENT_LEN);
     131
    130132            while (1) {
    131133                system("sync");
     
    154156            }
    155157        } else {
    156             paranoid_free(tmp);
    157158            return (popup_with_buttons(prompt, "Yes", "No"));
    158159        }
     
    798799
    799800        /*@ buffers *********************************************************** */
    800         char *prompt, *tmp;
     801        char *prompt;
    801802
    802803        /*@ newt ************************************************************** */
     
    807808        newtComponent text;
    808809
    809         prompt = malloc(MAX_NEWT_COMMENT_LEN);
    810         tmp = malloc(MAX_NEWT_COMMENT_LEN);
    811810        assert_string_is_neither_NULL_nor_zerolength(p);
    812811        assert(button1 != NULL);
    813812        assert(button2 != NULL);
     813        prompt = malloc(MAX_NEWT_COMMENT_LEN);
    814814        if (g_text_mode) {
    815815            if (strlen(button2) == 0) {
     
    818818                printf("%s (%s or %s) --> ", p, button1, button2);
    819819            }
    820             for (tmp[0] = '\0';
    821                  strcmp(tmp, button1) && (strlen(button2) == 0
    822                                           || strcmp(tmp, button2));) {
     820            for (prompt[0] = '\0';
     821                 strcmp(prompt, button1) && (strlen(button2) == 0
     822                                          || strcmp(prompt, button2));) {
    823823                printf("--> ");
    824                 (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin);
    825             }
    826             if (!strcmp(tmp, button1)) {
    827                 paranoid_free(tmp);
     824                (void) fgets(prompt, MAX_NEWT_COMMENT_LEN, stdin);
     825            }
     826            if (!strcmp(prompt, button1)) {
    828827                paranoid_free(prompt);
    829828                return (TRUE);
    830829            } else {
    831                 paranoid_free(tmp);
    832830                paranoid_free(prompt);
    833831                return (FALSE);
     
    861859        newtPopWindow();
    862860        if (b_res == b_1) {
    863             paranoid_free(tmp);
    864861            paranoid_free(prompt);
    865862            return (TRUE);
    866863        } else {
    867             paranoid_free(tmp);
    868864            paranoid_free(prompt);
    869865            return (FALSE);
  • branches/2.2.8/mondo/src/mondorestore/mondo-rstr-tools.c

    r2128 r2136  
    13611361    if (ask_me_yes_or_no
    13621362        ("You will now be able to re-generate your initrd.\nThis is especially useful if you changed of hardware configuration, cloned, made P2V, used multipath...\nDo you need to do it ?")) {
     1363        log_msg(1,"Launching shell for manual initrd recreation");
     1364        popup_and_OK("You'll now be chrooted under your future / partition.\nGo under /boot and rebuild your initrd with\nmkinitrd -f -v initrd-2.x.y.img 2.x.y e.g.\nThen type exit to finish.");
    13631365        mvaddstr_and_log_it(g_currentY, 0, "Modifying initrd...");
    1364         popup_and_OK("You'll now be chrooted under your future / partition.\nGo under /boot and rebuild your initrd with\nmkinitrd -f -v initrd-2.x.y.img 2.x.y e.g.\nThen type exit to finish.");
    13651366        if (!g_text_mode) {
    13661367            newtSuspend();
  • branches/2.2.8/mondo/src/mondorestore/mondorestore.c

    r2132 r2136  
    370370
    371371
    372 static void clean_multiconf() {
     372static void clean_multipathconf() {
    373373
    374374    char *tmp1 = NULL;
     
    389389    }
    390390    paranoid_free(tmp1);
    391     asprintf(&editor, "%s", find_my_editor());
    392     asprintf(&tmp1,"chroot %s %s /etc/multipath.conf", MNT_RESTORING, editor);
    393     popup_and_OK("You will now edit multipath.conf");
    394     if (!g_text_mode) {
    395         newtSuspend();
    396     }
    397     paranoid_system(tmp1);
    398     paranoid_free(tmp1);
    399     paranoid_free(editor);
     391
     392    if (bkpinfo->restore_mode != nuke) {
     393        asprintf(&editor, "%s", find_my_editor());
     394        asprintf(&tmp1,"chroot %s %s /etc/multipath.conf", MNT_RESTORING, editor);
     395        popup_and_OK("You will now edit multipath.conf");
     396        if (!g_text_mode) {
     397            newtSuspend();
     398        }
     399        paranoid_system(tmp1);
     400        if (!g_text_mode) {
     401            newtResume();
     402        }
     403        paranoid_free(tmp1);
     404        paranoid_free(editor);
     405    } else {
     406        log_to_screen("Non-interactive mode: no way to give you the keyboard so that you edit your multipath.conf. Hope it's OK");
     407        log_msg(1,"Non-interactive mode: no way to give you the keyboard so that you edit your multipath.conf. Hope it's OK");
     408    }
    400409}
    401410
     
    634643    }
    635644
    636     clean_multiconf();
     645    clean_multipathconf();
    637646    if (ask_me_yes_or_no("Initialize the boot loader?")) {
    638647        run_boot_loader(TRUE);
     
    871880    iamhere("Restoring everything");
    872881    retval += restore_everything(NULL);
    873     clean_multiconf();
     882    clean_multipathconf();
    874883    if (!run_boot_loader(FALSE)) {
    875884        log_msg(1,
Note: See TracChangeset for help on using the changeset viewer.