Changeset 1845 in MondoRescue for branches


Ignore:
Timestamp:
Dec 18, 2007, 1:05:57 AM (16 years ago)
Author:
Bruno Cornec
Message:

Attempt to fix #224

File:
1 edited

Legend:

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

    r1843 r1845  
    14731473    char *tmp;
    14741474    char *name;
     1475    char *cmd = NULL;
    14751476
    14761477    malloc_string(device);
    14771478    malloc_string(tmp);
    14781479    malloc_string(name);
     1480
     1481    /* In order to have a working bootloader, we need to have all devices
     1482     * ready in the chroot. If they are not there (udev) then copy them from
     1483     * the current /dev location
     1484     */
     1485    asprintf(&cmd,"tar cf - /dev | ( cd %s ; tar xf - )",MNT_RESTORING);
     1486    run_program_and_log_output(cmd, 3);
     1487
    14791488    backup_crucial_file(MNT_RESTORING, "/etc/fstab");
    14801489    backup_crucial_file(MNT_RESTORING, "/etc/grub.conf");
    14811490    backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf");
    14821491    backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf");
     1492    backup_crucial_file(MNT_RESTORING, "/boot/grub/device.map");
     1493    backup_crucial_file(MNT_RESTORING, "/etc/mtab");
    14831494    read_cfg_var(g_mondo_cfg_file, "bootloader.device", device);
    14841495    read_cfg_var(g_mondo_cfg_file, "bootloader.name", name);
     
    14911502        res = run_elilo(offer_to_hack_scripts);
    14921503    } else if (!strcmp(name, "GRUB")) {
    1493 //      if ( does_file_exist(DO_MBR_PLEASE) || (offer_to_hack_scripts && ask_me_yes_or_no("Because of bugs in GRUB, you're much better off running mondorestore --mbr after this program terminates. Are you sure you want to install GRUB right now?")))
    1494 //        {
    14951504        res = run_grub(offer_to_hack_scripts, device);
    1496 //    unlink(DO_MBR_PLEASE);
    1497 //  }
    1498 //      else
    1499 //        {
    1500 //    log_msg(1, "Not running run_grub(). Was a bad idea anyway.");
    1501 //    res = 1;
    1502 //  }
    15031505    } else if (!strcmp(name, "RAW")) {
    15041506        res = run_raw_mbr(offer_to_hack_scripts, device);
     
    17331735                    newtSuspend();
    17341736                }
    1735                 sprintf(tmp, "%s " MNT_RESTORING "/etc/fstab", editor);
     1737                sprintf(tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor);
    17361738                paranoid_system(tmp);
    1737                 sprintf(tmp, "%s " MNT_RESTORING "/etc/elilo.conf",
    1738                         editor);
     1739                sprintf(tmp, "chroot %s %s /etc/elilo.conf", MNT_RESTORING, editor);
    17391740                paranoid_system(tmp);
    17401741                if (!g_text_mode) {
Note: See TracChangeset for help on using the changeset viewer.