Ignore:
Timestamp:
Sep 10, 2009, 2:07:16 AM (15 years ago)
Author:
Bruno Cornec
Message:
  • Change NFS support into a NetFS support to allow for multiple protocol in addition to NFS (NEEDS TESTING)

(Backport from 2.2.9)

File:
1 edited

Legend:

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

    r2376 r2382  
    919919    mr_free(bkpinfo->restore_path);
    920920    mr_asprintf(bkpinfo->restore_path, "/");
    921     if (!g_restoring_live_from_cd && !g_restoring_live_from_nfs) {
     921    if (!g_restoring_live_from_cd && !g_restoring_live_from_netfs) {
    922922        popup_and_OK
    923923            ("Please insert tape/CD/USB Key, then hit 'OK' to continue.");
    924924        sleep(1);
    925925    }
    926     if (!g_restoring_live_from_nfs) {
     926    if (!g_restoring_live_from_netfs) {
    927927        interactively_obtain_media_parameters_from_user(FALSE);
    928928    }
     
    946946    load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    947947
    948     if (!g_restoring_live_from_nfs && (filelist = process_filelist_and_biggielist())) {
     948    if (!g_restoring_live_from_netfs && (filelist = process_filelist_and_biggielist())) {
    949949        save_filelist(filelist, "/tmp/selected-files.txt");
    950950        mr_asprintf(old_restpath, "%s", bkpinfo->restore_path);
     
    28282828        mount_boot_if_necessary();  /* for Gentoo users */
    28292829        log_msg(2, "Still here.");
    2830         if (bkpinfo->backup_media_type == nfs) {
    2831             g_restoring_live_from_nfs = TRUE;
     2830        if (bkpinfo->backup_media_type == netfs) {
     2831            g_restoring_live_from_netfs = TRUE;
    28322832        }
    28332833        /* Adding an initialisation in order to avoid to hndle NULL pointer later */
     
    28612861        // BCO:To be reviewed
    28622862        if ((bkpinfo->restore_mode == compare) || (bkpinfo->restore_mode == nuke)) {
    2863             if (bkpinfo->backup_media_type == nfs && bkpinfo->nfs_mount && !is_this_device_mounted(bkpinfo->nfs_mount)) {
    2864                 log_msg(1, "Mounting nfs dir");
     2863            if (bkpinfo->backup_media_type == netfs && bkpinfo->netfs_mount && !is_this_device_mounted(bkpinfo->netfs_mount)) {
     2864                log_msg(1, "Mounting remote %s dir", bkpinfo->netfs_proto);
    28652865                mr_free(bkpinfo->isodir);
    28662866                mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
    28672867                run_program_and_log_output("mkdir -p /tmp/isodir", 5);
    2868                 mr_asprintf(tmp, "mount %s -t nfs -o nolock,ro /tmp/isodir", bkpinfo->nfs_mount);
     2868                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
     2869                    mr_asprintf(tmp, "sshfs -o ro %s /tmp/isodir", bkpinfo->netfs_mount);
     2870                } else {
     2871                    mr_asprintf(tmp, "mount %s -o nolock,ro /tmp/isodir", bkpinfo->netfs_mount);
     2872                }
    28692873                run_program_and_log_output(tmp, 1);
    28702874                mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.