Changeset 2451 in MondoRescue for branches/2.2.10/mondo/src/mondorestore


Ignore:
Timestamp:
Oct 6, 2009, 1:34:09 AM (15 years ago)
Author:
Bruno Cornec
Message:
  • Fix a mr_asprintf usage without & causing a seg fault.
  • Adds support for grub2 conf file grub.cfg in addition to menu.lst
  • Fix for #288: only take the first result in SizeOfPartition in case of multiple mounts
  • Improve USB log in case of error by adding the conf file

(Backport from 2.2.9)

File:
1 edited

Legend:

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

    r2405 r2451  
    13871387    backup_crucial_file(MNT_RESTORING, "/etc/fstab");
    13881388    backup_crucial_file(MNT_RESTORING, "/boot/grub/menu.lst");
     1389    backup_crucial_file(MNT_RESTORING, "/boot/grub/grub.cfg");
    13891390    backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf");
    13901391    backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf");
     
    15121513        mvaddstr_and_log_it(g_currentY,
    15131514                            0,
    1514                             "Modifying fstab, mtab, device.map and menu.lst, and running GRUB...                             ");
     1515                            "Modifying fstab, mtab, device.map and menu.lst/grub.cfg, and running GRUB...                             ");
    15151516        for (done = FALSE; !done;) {
    15161517            p = popup_and_get_string("Boot device", "Please confirm/enter the boot device. If in doubt, try /dev/hda", boot_device);
     
    15381539                done = TRUE;
    15391540            }
    1540             popup_and_OK("You will now edit fstab, mtab, device.map and menu.lst");
     1541            popup_and_OK("You will now edit fstab, mtab, device.map and menu.lst/grub.cfg");
    15411542            if (!g_text_mode) {
    15421543                newtSuspend();
     
    15521553            mr_free(tmp);
    15531554
    1554             mr_asprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor);
     1555            if (does_file_exist(MNT_RESTORING"/boot/grub/menu.lst")) {
     1556                mr_asprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor);
     1557            } else if (does_file_exist(MNT_RESTORING"/boot/grub/grub.cfg")) {
     1558                mr_asprintf(tmp, "chroot %s %s /boot/grub/grub.cfg", MNT_RESTORING, editor);
     1559            }
    15551560            paranoid_system(tmp);
    15561561            mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.