Changeset 1547 in MondoRescue for branches/2.2.5


Ignore:
Timestamp:
Jul 24, 2007, 1:20:40 AM (17 years ago)
Author:
Bruno Cornec
Message:
  • Add the possibiilty to edit in interactive mode mtab and device.map for grub
  • Remove blkid cache files after restore to avoid problems in cloning mode
Location:
branches/2.2.5/mondo/src/mondorestore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/mondorestore/mondo-restore.c

    r1453 r1547  
    357357 *END_FIND_PATHNAME_OF_EXECUTABLE_PREFERABLY_IN_RESTORING                 *
    358358 **************************************************************************/
     359
     360static void clean_blkid(struct s_bkpinfo *bkpinfo) {
     361
     362    char *tmp1 = NULL;
     363
     364    /* Clean up blkid cache file if they exist */
     365    asprintf(&tmp1,"%s/etc/blkid.tab",bkpinfo->restore_path);
     366    (void)unlink(tmp1);
     367    paranoid_free(tmp1);
     368    asprintf(&tmp1,"%s/etc/blkid.tab.old",bkpinfo->restore_path);
     369    (void)unlink(tmp1);
     370    paranoid_free(tmp1);
     371}
    359372
    360373
     
    599612    }
    600613
    601 //  run_program_and_log_output("cp -af /etc/lvm " MNT_RESTORING "/etc/", 1);
     614    clean_blkid(bkpinfo);
    602615    protect_against_braindead_sysadmins();
    603616    //  modify_rclocal_one_time( MNT_RESTORING "/etc" );
     
    838851        boot_loader_installed = TRUE;
    839852    }
     853    clean_blkid(bkpinfo);
    840854    protect_against_braindead_sysadmins();
    841 //  run_program_and_log_output("cp -af /etc/lvm " MNT_RESTORING "/etc/", 1);
    842855    //  modify_rclocal_one_time( MNT_RESTORING "/etc" );
    843856    retval += unmount_all_devices(mountlist);
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c

    r1541 r1547  
    16791679        mvaddstr_and_log_it(g_currentY,
    16801680                            0,
    1681                             "Modifying fstab and grub.conf, and running GRUB...                             ");
     1681                            "Modifying fstab, mtab, device.map and grub.conf, and running GRUB...                             ");
    16821682        for (done = FALSE; !done;) {
    16831683            popup_and_get_string("Boot device",
     
    16961696                done = TRUE;
    16971697            }
    1698             popup_and_OK("You will now edit fstab and grub.conf");
     1698            popup_and_OK("You will now edit fstab, mtab, device.map and grub.conf");
    16991699            if (!g_text_mode) {
    17001700                newtSuspend();
     
    17021702            sprintf(tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor);
    17031703            paranoid_system(tmp);
     1704            sprintf(tmp, "chroot %s %s /etc/mtab", MNT_RESTORING, editor);
     1705            paranoid_system(tmp);
    17041706            sprintf(tmp, "chroot %s %s /etc/grub.conf", MNT_RESTORING, editor);
     1707            paranoid_system(tmp);
     1708            sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor);
    17051709            paranoid_system(tmp);
    17061710            if (!g_text_mode) {
Note: See TracChangeset for help on using the changeset viewer.