Ignore:
Timestamp:
Apr 10, 2008, 1:13:58 AM (11 years ago)
Author:
bruno
Message:

merge -r 1842:1889 2.2.5

File:
1 edited

Legend:

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

    r1842 r1903  
    5656char *g_getfacl = NULL;
    5757
     58extern void kill_anything_like_this(char *str);
     59
    5860/**
    5961 * @addtogroup restoreUtilityGroup
     
    387389
    388390    char *command = NULL;
     391    char *tmp = NULL;
    389392    char *mountdir = NULL;
    390393    char *mountpoint = NULL;
     
    439442        mr_msg(2, "command='%s'", command);
    440443    }
     444
    441445    res = run_program_and_log_output(command, TRUE);
     446    if (res && (strstr(command, "xattr") || strstr(command, "acl"))) {
     447        mr_msg(1, "Re-trying without the fancy extra parameters");
     448        mr_asprintf(&tmp, "mount -t %s %s %s 2>> %s", format, device,
     449            mountdir, MONDO_LOGFILE);
     450        res = run_program_and_log_output(tmp, TRUE);
     451        mr_free(tmp);
     452    }
    442453    if (res) {
    443454        mr_msg(1, "Unable to mount device %s (type %s) at %s", device,
     
    449460        } else {
    450461            mr_msg(2, "Retrying w/o the '-t' switch");
    451             mr_free(command);
    452 
    453             mr_asprintf(&command, "mount %s %s 2>> %s", device, mountdir,
     462            mr_asprintf(&tmp, "mount %s %s 2>> %s", device, mountdir,
    454463                    MONDO_LOGFILE);
    455             mr_msg(2, "2nd command = '%s'", command);
    456             res = run_program_and_log_output(command, TRUE);
     464            mr_msg(2, "2nd command = '%s'", tmp);
     465            res = run_program_and_log_output(tmp, TRUE);
     466            mr_free(tmp);
    457467            if (res == 0) {
    458468                mr_msg(1,
     
    473483    }
    474484    mr_free(mountpoint);
    475 
    476485    return (res);
    477486}
     
    623632            mr_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    624633        }
     634
    625635#ifdef __FreeBSD__
    626636        mr_asprintf(&mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
     
    687697            break;
    688698        } else {
    689             mr_msg(2, "Failed to mount CD-ROM drive.");
     699            mr_msg(2, "Failed to mount device.");
    690700            sleep(5);
    691701            run_program_and_log_output("sync", FALSE);
     
    806816        } else if (!strcmp(value, "nfs")) {
    807817            bkpinfo->backup_media_type = nfs;
     818            bkpinfo->please_dont_eject = TRUE;
    808819            if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) {
    809820                mr_allocstr(bkpinfo->prefix,value);
     
    842853        fatal_error("backup-media-type not specified!");
    843854    }
     855
    844856    if (bkpinfo->disaster_recovery) {
    845857        if (bkpinfo->backup_media_type == cdstream) {
     
    12861298#endif
    12871299    char *name = NULL;
     1300    char *cmd = NULL;
    12881301
    12891302    malloc_string(device);
    12901303    malloc_string(name);
     1304
     1305    /* In order to have a working bootloader, we need to have all devices
     1306     * ready in the chroot. If they are not there (udev) then copy them from
     1307     * the current /dev location
     1308     */
     1309    asprintf(&cmd,"tar cf - /dev | ( cd %s ; tar xf - )",MNT_RESTORING);
     1310    run_program_and_log_output(cmd, 3);
     1311    paranoid_free(cmd);
     1312
    12911313    backup_crucial_file(MNT_RESTORING, "/etc/fstab");
    12921314    backup_crucial_file(MNT_RESTORING, "/etc/grub.conf");
    12931315    backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf");
    12941316    backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf");
     1317    backup_crucial_file(MNT_RESTORING, "/boot/grub/device.map");
     1318    backup_crucial_file(MNT_RESTORING, "/etc/mtab");
    12951319    read_cfg_var(g_mondo_cfg_file, "bootloader.device", device);
    12961320    read_cfg_var(g_mondo_cfg_file, "bootloader.name", name);
     
    13121336        mr_free(tmp);
    13131337    } else {
    1314         mr_asprintf(&tmp, "ls /dev | grep -Eq '^%ss[1-4].*$'", device);
     1338        mr_asprintf(&tmp, "ls /dev | grep -Eq '^%ss[1-4].*'", device);
    13151339        if (!system(tmp)) {
    13161340            mr_free(tmp);
     
    15341558                    newtSuspend();
    15351559                }
    1536                 mr_asprintf(&tmp, "%s " MNT_RESTORING "/etc/fstab", editor);
     1560                mr_asprintf(&tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor);
    15371561                paranoid_system(tmp);
    15381562                mr_free(tmp);
    15391563
    1540                 mr_asprintf(&tmp, "%s " MNT_RESTORING "/etc/elilo.conf", editor);
     1564                mr_asprintf(&tmp, "chroot %s %s /etc/elilo.conf", MNT_RESTORING, editor);
    15411565                paranoid_system(tmp);
    15421566                mr_free(tmp);
     
    21732197            if (!does_file_exist("tmp/mondo-restore.cfg")) {
    21742198                log_to_screen(_
    2175                               ("Cannot find config info on tape/CD"));
     2199                              ("Cannot find config info on media"));
    21762200                return (1);
    21772201            }
Note: See TracChangeset for help on using the changeset viewer.