Changeset 2950 in MondoRescue for branches/3.0/mondo


Ignore:
Timestamp:
Feb 16, 2012, 1:55:19 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Fix #580 by checking a modification on the mountlist and then asking for conf file adaptation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/mondorestore/mondo-rstr-tools.c

    r2944 r2950  
    14081408    char *editor;
    14091409
    1410     int res;
     1410    int res = 0;        /*  FALSE */
    14111411    int done;
     1412    bool mntlistchg = FALSE;
     1413    FILE *fin = NULL;
    14121414
    14131415    malloc_string(command);
     
    14381440                            0,
    14391441                            "Modifying fstab, mtab, device.map and menu.lst/grub.cfg, and running GRUB...                             ");
     1442        /*  Did we changed the mountlist ? If yes, then force editing conf files */
     1443        if ((fin = fopen(MONDO_MNTLISTCHG, "r")) != NULL) {
     1444            mntlistchg = TRUE;
     1445        }
    14401446        for (done = FALSE; !done;) {
    14411447            popup_and_get_string("Boot device",
    14421448                                 "Please confirm/enter the boot device. If in doubt, try /dev/hda",
    14431449                                 boot_device, MAX_STR_LEN / 4);
    1444             sprintf(command, "stabgrub-me %s", boot_device);
    1445             res = run_program_and_log_output(command, 1);
    1446             if (res) {
    1447                 popup_and_OK
    1448                     ("GRUB installation failed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install");
     1450            /*  Only try to adapt grub here first if the mountlist wasn't changed before */
     1451            if (! mntlistchg) {
     1452                sprintf(command, "stabgrub-me %s", boot_device);
     1453                res = run_program_and_log_output(command, 1);
     1454            }
     1455            if ((res) || (mntlistchg)){
     1456                if (res) {
     1457                    popup_and_OK("GRUB installation failed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install");
     1458                } else {
     1459                    popup_and_OK("The mountlist was changed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install");
     1460                }
    14491461                if (!g_text_mode) {
    14501462                    newtSuspend();
Note: See TracChangeset for help on using the changeset viewer.