Changeset 1736


Ignore:
Timestamp:
Oct 30, 2007, 1:45:03 AM (12 years ago)
Author:
bruno
Message:
  • Adds USB support for mondorestore
  • mount_cdrom => mount_media
Location:
branches/2.2.5/mondo/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/mondoarchive/main.c

    r1713 r1736  
    130130extern bool g_text_mode;
    131131extern char *g_boot_mountpt;
    132 extern bool g_remount_cdrom_at_end, g_remount_floppy_at_end;
     132extern bool g_remount_floppy_at_end;
    133133extern char *g_tmpfs_mountpt;
    134134extern char *g_cdrw_drive_is_here;
  • branches/2.2.5/mondo/src/mondorestore/mondo-restore.c

    r1653 r1736  
    430430    read_cfg_file_into_bkpinfo(g_mondo_cfg_file);
    431431    iamhere("Done loading config file; resizing ML");
    432     strcpy(tmp, bkpinfo->prefix);
    433     if (popup_and_get_string
    434         ("Prefix", "Prefix of your ISO images ?", tmp, MAX_STR_LEN / 4)) {
    435         strcpy(bkpinfo->prefix, tmp);
    436         log_msg(1, "Prefix set to %s",bkpinfo->prefix);
     432    if (bkpinfo->backup_media_type != usb) {
     433        strcpy(tmp, bkpinfo->prefix);
     434        if (popup_and_get_string
     435            ("Prefix", "Prefix of your ISO images ?", tmp, MAX_STR_LEN / 4)) {
     436            strcpy(bkpinfo->prefix, tmp);
     437            log_msg(1, "Prefix set to %s",bkpinfo->prefix);
     438        }
    437439    }
    438440   
     
    864866    if (retval) {
    865867        log_to_screen("Errors occurred during the nuke phase.");
    866     } else if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "RESTORE"))    // Bruno's thing
    867     {
     868    } else if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "RESTORE")) {
    868869        log_to_screen
    869870            ("PC was restored successfully. Thank you for using Mondo Rescue.");
     
    927928    if (!g_restoring_live_from_cd) {
    928929        popup_and_OK
    929             ("Please insert tape/CD/boot floppy, then hit 'OK' to continue.");
     930            ("Please insert tape/CD/USB Key/boot floppy, then hit 'OK' to continue.");
    930931        sleep(1);
    931932    }
     
    26582659    mvaddstr_and_log_it(g_currentY, 0, "Preparing to read your archives");
    26592660    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2660         mount_cdrom();
     2661        mount_media();
    26612662        mvaddstr_and_log_it(g_currentY++, 0,
    26622663                            "Restoring OS and data from streaming media");
     
    26762677    } else {
    26772678        mvaddstr_and_log_it(g_currentY++, 0,
    2678                             "Restoring OS and data from CD       ");
    2679         mount_cdrom();
     2679                            "Restoring OS and data from CD/USB   ");
     2680        mount_media();
    26802681        resA = restore_all_tarballs_from_CD(filelist);
    26812682        resB = restore_all_biggiefiles_from_CD(filelist);
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools-EXT.h

    r1649 r1736  
    88extern int iso_fiddly_bits(bool nuke_me_please);
    99extern void kill_petris(void);
    10 extern int mount_cdrom();
     10extern int mount_media();
    1111extern int mount_all_devices(struct mountlist_itself *, bool);
    1212extern void protect_against_braindead_sysadmins(void);
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c

    r1646 r1736  
    488488}
    489489if (!IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    490 mount_cdrom();
    491 }
    492 i = what_number_cd_is_this();   /* has the side-effect of calling mount_cdrom() */
     490    mount_media();
     491}
     492i = what_number_cd_is_this();   /* has the side-effect of calling mount_media() */
    493493sprintf(tmp, "%s #%d has been mounted via loopback mount",
    494494    media_descriptor_string(bkpinfo->backup_media_type), i);
     
    629629
    630630/**
    631 * Mount the CD-ROM device at /mnt/cdrom.
     631* Mount the CD-ROM or USB device at /mnt/cdrom.
    632632* @param bkpinfo The backup information structure. Fields used:
    633633* - @c bkpinfo->backup_media_type
     
    637637* @return 0 for success, nonzero for failure.
    638638*/
    639 int mount_cdrom()
     639int mount_media()
    640640{
    641641char *mount_cmd;
     
    650650
    651651if (bkpinfo->backup_media_type == tape
    652 || bkpinfo->backup_media_type == udev) {
    653 log_msg(8, "Tape/udev. Therefore, no need to mount CDROM.");
    654 paranoid_free(mount_cmd);
    655 return 0;
     652    || bkpinfo->backup_media_type == udev) {
     653    log_msg(8, "Tape/udev. Therefore, no need to mount a media.");
     654    paranoid_free(mount_cmd);
     655    return 0;
    656656}
    657657
    658658if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
    659 log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
    660 paranoid_free(mount_cmd);
    661 return (0);
     659    log_msg(2, "mount_media() - media already mounted. Fair enough.");
     660    paranoid_free(mount_cmd);
     661    return (0);
    662662}
    663663
    664664if (bkpinfo->backup_media_type == nfs) {
    665 log_msg(2, "Mounting for NFS thingy");
    666 log_msg(2, "isodir = %s", bkpinfo->isodir);
    667 if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/"))
    668     && am_I_in_disaster_recovery_mode()) {
    669     strcpy(bkpinfo->isodir, "/tmp/isodir");
    670     log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    671 }
     665    log_msg(2, "Mounting for NFS thingy");
     666    log_msg(2, "isodir = %s", bkpinfo->isodir);
     667    if ((!bkpinfo->isodir[0] || !strcmp(bkpinfo->isodir, "/"))
     668        && am_I_in_disaster_recovery_mode()) {
     669        strcpy(bkpinfo->isodir, "/tmp/isodir");
     670        log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
     671    }
    672672#ifdef __FreeBSD__
    673 sprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
     673    sprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
    674674        bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number);
    675 mddev = make_vn(mount_cmd);
    676 sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
     675    mddev = make_vn(mount_cmd);
     676    sprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
    677677#else
    678 sprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s",
     678    sprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s",
    679679        bkpinfo->isodir, bkpinfo->nfs_remote_dir,
    680680        bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    681681#endif
    682682
    683 } else
    684 if (bkpinfo->backup_media_type == iso) {
     683} else if (bkpinfo->backup_media_type == iso) {
    685684#ifdef __FreeBSD__
    686 sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir,
     685    sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir,
    687686        bkpinfo->prefix, g_current_media_number);
    688 mddev = make_vn(mount_cmd);
    689 sprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
     687    mddev = make_vn(mount_cmd);
     688    sprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
    690689#else
    691 sprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s",
     690    sprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s",
    692691        bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    693692#endif
    694 } else if (strstr(bkpinfo->media_device, "/dev/"))
     693    } else if (strstr(bkpinfo->media_device, "/dev/")) {
    695694#ifdef __FreeBSD__
    696 {
    697 sprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device,
    698         MNT_CDROM);
    699 }
    700 #else
    701 {
    702 sprintf(mount_cmd, "mount %s -t iso9660 -o ro %s",
    703         bkpinfo->media_device, MNT_CDROM);
    704 }
    705 #endif
    706 
    707 else {
    708 if (bkpinfo->disaster_recovery
    709     && does_file_exist("/tmp/CDROM-LIVES-HERE")) {
    710     strcpy(bkpinfo->media_device,
    711            last_line_of_file("/tmp/CDROM-LIVES-HERE"));
    712 } else {
    713     find_cdrom_device(bkpinfo->media_device, TRUE);
    714 }
    715 
    716 #ifdef __FreeBSD__
    717 sprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device,
     695        sprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device,
    718696        MNT_CDROM);
    719697#else
    720 sprintf(mount_cmd, "mount %s -t iso9660 -o ro %s",
     698        sprintf(mount_cmd, "mount %s -t iso9660 -o ro %s",
    721699        bkpinfo->media_device, MNT_CDROM);
    722700#endif
    723 
    724 }
    725 log_msg(2, "(mount_cdrom) --- command = %s", mount_cmd);
     701} else {
     702    if (bkpinfo->disaster_recovery
     703        && does_file_exist("/tmp/CDROM-LIVES-HERE")) {
     704        strcpy(bkpinfo->media_device,
     705            last_line_of_file("/tmp/CDROM-LIVES-HERE"));
     706    } else {
     707        find_cdrom_device(bkpinfo->media_device, TRUE);
     708    }
     709
     710    if (bkpinfo->backup_media_type == usb) {
     711        sprintf(mount_cmd, "mount -r %s %s", bkpinfo->media_device, MNT_CDROM);
     712    } else {
     713#ifdef __FreeBSD__
     714        sprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device,
     715            MNT_CDROM);
     716#else
     717        sprintf(mount_cmd, "mount %s -t iso9660 -o ro %s",
     718            bkpinfo->media_device, MNT_CDROM);
     719#endif
     720    }
     721}
     722
     723log_msg(2, "(mount_media) --- command = %s", mount_cmd);
    726724for (i = 0; i < 2; i++) {
    727725res = run_program_and_log_output(mount_cmd, FALSE);
     
    729727    break;
    730728} else {
    731     log_msg(2, "Failed to mount CD-ROM drive.");
     729    log_msg(2, "Failed to mount device.");
    732730    sleep(5);
    733731    run_program_and_log_output("sync", FALSE);
     
    735733}
    736734if (res) {
    737 log_msg(2, "Failed, despite %d attempts", i);
     735    log_msg(2, "Failed, despite %d attempts", i);
    738736} else {
    739 log_msg(2, "Mounted CD-ROM drive OK");
     737    log_msg(2, "Mounted CD-ROM drive OK");
    740738}
    741739paranoid_free(mount_cmd);
     
    946944} else if (!strcmp(value, "dvd")) {
    947945    bkpinfo->backup_media_type = dvd;
     946} else if (!strcmp(value, "usb")) {
     947    bkpinfo->backup_media_type = usb;
    948948} else if (!strcmp(value, "iso")) {
    949949/*
     
    10041004}
    10051005if (bkpinfo->disaster_recovery) {
    1006 if (bkpinfo->backup_media_type == cdstream) {
    1007     sprintf(bkpinfo->media_device, "/dev/cdrom");
     1006    if (bkpinfo->backup_media_type == cdstream) {
     1007        sprintf(bkpinfo->media_device, "/dev/cdrom");
    10081008//          bkpinfo->media_size[0] = -1;
    1009     bkpinfo->media_size[0] = 1999 * 1024;
    1010     bkpinfo->media_size[1] = 650;   /* good guess */
    1011 } else if (bkpinfo->backup_media_type == tape
    1012            || bkpinfo->backup_media_type == udev) {
    1013     if (read_cfg_var(cfg_file, "media-dev", value)) {
    1014         fatal_error("Cannot get tape device name from cfg file");
    1015     }
    1016     strcpy(bkpinfo->media_device, value);
    1017     read_cfg_var(cfg_file, "media-size", value);
    1018     bkpinfo->media_size[1] = atol(value);
    1019     sprintf(tmp, "Backup medium is TAPE --- dev=%s",
    1020             bkpinfo->media_device);
    1021     log_msg(2, tmp);
     1009        bkpinfo->media_size[0] = 1999 * 1024;
     1010        bkpinfo->media_size[1] = 650;   /* good guess */
     1011    } else if (bkpinfo->backup_media_type == usb) {
     1012        if (read_cfg_var(cfg_file, "usb-dev", value)) {
     1013            fatal_error("Cannot get USB device name from cfg file");
     1014        }
     1015        strcpy(bkpinfo->media_device, value);
     1016        sprintf(tmp, "Backup medium is USB --- dev=%s", bkpinfo->media_device);
     1017        log_msg(2, tmp);
     1018    } else if (bkpinfo->backup_media_type == tape
     1019            || bkpinfo->backup_media_type == udev) {
     1020        if (read_cfg_var(cfg_file, "media-dev", value)) {
     1021            fatal_error("Cannot get tape device name from cfg file");
     1022        }
     1023        strcpy(bkpinfo->media_device, value);
     1024        read_cfg_var(cfg_file, "media-size", value);
     1025        bkpinfo->media_size[1] = atol(value);
     1026        sprintf(tmp, "Backup medium is TAPE --- dev=%s",
     1027                bkpinfo->media_device);
     1028        log_msg(2, tmp);
     1029    } else {
     1030        strcpy(bkpinfo->media_device, "/dev/cdrom");    /* we don't really need this var */
     1031        bkpinfo->media_size[0] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
     1032        bkpinfo->media_size[1] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
     1033        log_msg(2, "Backup medium is CD-R[W]");
     1034    }
    10221035} else {
    1023     strcpy(bkpinfo->media_device, "/dev/cdrom");    /* we don't really need this var */
    1024     bkpinfo->media_size[0] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    1025     bkpinfo->media_size[1] = 1999 * 1024;   /* 650, probably, but we don't need this var anyway */
    1026     log_msg(2, "Backup medium is CD-R[W]");
    1027 }
    1028 } else {
    1029 log_msg(2,
     1036    log_msg(2,
    10301037        "Not in Disaster Recovery Mode. No need to derive device name from config file.");
    10311038}
     
    11131120
    11141121if (bkpinfo->backup_media_type == nfs) {
    1115 if (!cfgf) {
    1116     log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
    1117     log_msg(2, "nfs_remote_dir remains %s",
    1118             bkpinfo->nfs_remote_dir);
    1119     log_msg(2,
    1120             "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
    1121 } else {
    1122     read_cfg_var(g_mondo_cfg_file, "nfs-server-mount",
    1123                  bkpinfo->nfs_mount);
    1124     read_cfg_var(g_mondo_cfg_file, "nfs-server-path",
    1125                  bkpinfo->nfs_remote_dir);
    1126     log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
    1127     log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    1128 }
    1129 if (strstr(call_program_and_get_last_line_of_output
    1130    ("cat /proc/cmdline"), "pxe")) {
    1131     /* We need to override values in PXE mode as it's
    1132     * already done in start-nfs */
    1133     envtmp1 = getenv("nfsmount");
    1134     if (envtmp1 == NULL) {
    1135         fatal_error("no nfsmount variable in environment");
    1136     }
    1137     envtmp2 = getenv("dirimg");
    1138     if (envtmp2 == NULL) {
    1139         fatal_error("no dirimg variable in environment");
    1140     }
    1141     strcpy(bkpinfo->nfs_mount,envtmp1);
    1142     strcpy(bkpinfo->nfs_remote_dir,envtmp2);
    1143 }
     1122    if (!cfgf) {
     1123        log_msg(2, "nfs_mount remains %s", bkpinfo->nfs_mount);
     1124        log_msg(2, "nfs_remote_dir remains %s",
     1125                bkpinfo->nfs_remote_dir);
     1126        log_msg(2,
     1127                "...cos it wouldn't make sense to abandon the values that GOT ME to this config file in the first place");
     1128    } else {
     1129        read_cfg_var(g_mondo_cfg_file, "nfs-server-mount",
     1130                    bkpinfo->nfs_mount);
     1131        read_cfg_var(g_mondo_cfg_file, "nfs-server-path",
     1132                    bkpinfo->nfs_remote_dir);
     1133        log_msg(2, "nfs_mount is %s", bkpinfo->nfs_mount);
     1134        log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
     1135    }
     1136    if (strstr(call_program_and_get_last_line_of_output
     1137        ("cat /proc/cmdline"), "pxe")) {
     1138        /* We need to override values in PXE mode as it's
     1139        * already done in start-nfs */
     1140        envtmp1 = getenv("nfsmount");
     1141        if (envtmp1 == NULL) {
     1142            fatal_error("no nfsmount variable in environment");
     1143        }
     1144        envtmp2 = getenv("dirimg");
     1145        if (envtmp2 == NULL) {
     1146            fatal_error("no dirimg variable in environment");
     1147        }
     1148        strcpy(bkpinfo->nfs_mount,envtmp1);
     1149        strcpy(bkpinfo->nfs_remote_dir,envtmp2);
     1150    }
    11441151} else if (bkpinfo->backup_media_type == iso) {
    1145 /* Patch by Conor Daly 23-june-2004
    1146  * to correctly mount iso-dev and set a sensible
    1147  * isodir in disaster recovery mode
    1148  */
    1149 strcpy(old_isodir, bkpinfo->isodir);
    1150 read_cfg_var(g_mondo_cfg_file, "iso-mnt", iso_mnt);
    1151 read_cfg_var(g_mondo_cfg_file, "isodir", iso_path);
    1152 sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
    1153 if (!bkpinfo->isodir[0]) {
    1154     strcpy(bkpinfo->isodir, old_isodir);
    1155 }
    1156 if (!bkpinfo->disaster_recovery) {
    1157     if (strcmp(old_isodir, bkpinfo->isodir)) {
    1158         log_it
    1159             ("user nominated isodir differs from archive, keeping user's choice: %s %s\n",
    1160              old_isodir, bkpinfo->isodir);
     1152    /* Patch by Conor Daly 23-june-2004
     1153    * to correctly mount iso-dev and set a sensible
     1154    * isodir in disaster recovery mode
     1155    */
     1156    strcpy(old_isodir, bkpinfo->isodir);
     1157    read_cfg_var(g_mondo_cfg_file, "iso-mnt", iso_mnt);
     1158    read_cfg_var(g_mondo_cfg_file, "isodir", iso_path);
     1159    sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
     1160    if (!bkpinfo->isodir[0]) {
    11611161        strcpy(bkpinfo->isodir, old_isodir);
    11621162    }
    1163 }
    1164 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device);
    1165 log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir,
    1166         g_isodir_device);
    1167 if (bkpinfo->disaster_recovery) {
    1168     if (is_this_device_mounted(g_isodir_device)) {
    1169         log_msg(2, "NB: isodir is already mounted");
    1170         /* Find out where it's mounted */
    1171         sprintf(command,
    1172                 "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3",
    1173                 g_isodir_device);
    1174         log_it("command = %s", command);
    1175         log_it("res of it = %s",
    1176                call_program_and_get_last_line_of_output(command));
    1177         sprintf(iso_mnt, "%s",
    1178                 call_program_and_get_last_line_of_output(command));
    1179     } else {
    1180         sprintf(iso_mnt, "/tmp/isodir");
    1181         sprintf(tmp, "mkdir -p %s", iso_mnt);
    1182         run_program_and_log_output(tmp, 5);
    1183         sprintf(tmp, "mount %s %s", g_isodir_device, iso_mnt);
    1184         if (run_program_and_log_output(tmp, 3)) {
    1185             log_msg(1,
    1186                     "Unable to mount isodir. Perhaps this is really a CD backup?");
    1187             bkpinfo->backup_media_type = cdr;
    1188             strcpy(bkpinfo->media_device, "/dev/cdrom");    /* superfluous */
    1189             bkpinfo->isodir[0] = iso_mnt[0] = iso_path[0] = '\0';
    1190             if (mount_cdrom()) {
    1191                 fatal_error
    1192                     ("Unable to mount isodir. Failed to mount CD-ROM as well.");
    1193             } else {
     1163    if (!bkpinfo->disaster_recovery) {
     1164        if (strcmp(old_isodir, bkpinfo->isodir)) {
     1165            log_it
     1166                ("user nominated isodir differs from archive, keeping user's choice: %s %s\n",
     1167                old_isodir, bkpinfo->isodir);
     1168            strcpy(bkpinfo->isodir, old_isodir);
     1169        }
     1170    }
     1171    read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device);
     1172    log_msg(2, "isodir=%s; iso-dev=%s", bkpinfo->isodir,
     1173            g_isodir_device);
     1174    if (bkpinfo->disaster_recovery) {
     1175        if (is_this_device_mounted(g_isodir_device)) {
     1176            log_msg(2, "NB: isodir is already mounted");
     1177            /* Find out where it's mounted */
     1178            sprintf(command,
     1179                    "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3",
     1180                    g_isodir_device);
     1181            log_it("command = %s", command);
     1182            log_it("res of it = %s",
     1183                call_program_and_get_last_line_of_output(command));
     1184            sprintf(iso_mnt, "%s",
     1185                    call_program_and_get_last_line_of_output(command));
     1186        } else {
     1187            sprintf(iso_mnt, "/tmp/isodir");
     1188            sprintf(tmp, "mkdir -p %s", iso_mnt);
     1189            run_program_and_log_output(tmp, 5);
     1190            sprintf(tmp, "mount %s %s", g_isodir_device, iso_mnt);
     1191            if (run_program_and_log_output(tmp, 3)) {
    11941192                log_msg(1,
    1195                         "You backed up to disk, then burned some CDs.");
     1193                        "Unable to mount isodir. Perhaps this is really a CD backup?");
     1194                bkpinfo->backup_media_type = cdr;
     1195                strcpy(bkpinfo->media_device, "/dev/cdrom");    /* superfluous */
     1196                bkpinfo->isodir[0] = iso_mnt[0] = iso_path[0] = '\0';
     1197                if (mount_media()) {
     1198                    fatal_error
     1199                        ("Unable to mount isodir. Failed to mount CD-ROM as well.");
     1200                } else {
     1201                    log_msg(1,
     1202                            "You backed up to disk, then burned some CDs.");
     1203                }
    11961204            }
    11971205        }
    1198     }
    1199     /* bkpinfo->isodir should now be the true path to prefix-1.iso etc... */
    1200     if (bkpinfo->backup_media_type == iso) {
    1201         sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
    1202     }
    1203 }
     1206        /* bkpinfo->isodir should now be the true path to prefix-1.iso etc... */
     1207        if (bkpinfo->backup_media_type == iso) {
     1208            sprintf(bkpinfo->isodir, "%s%s", iso_mnt, iso_path);
     1209        }
     1210    }
    12041211}
    12051212
    12061213if (media_specified_by_user != none) {
    1207 if (g_restoring_live_from_cd) {
    1208     if (bkpinfo->backup_media_type != media_specified_by_user) {
    1209         log_msg(2,
    1210                 "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)");
    1211         interactively_obtain_media_parameters_from_user(FALSE);
    1212         media_specified_by_user = bkpinfo->backup_media_type;
    1213         get_cfg_file_from_archive();
    1214 /*
    1215       if (media_specified_by_user != cdr && media_specified_by_user == cdrw)
    1216         { g_restoring_live_from_cd = FALSE; }
    1217 */
    1218     }
    1219 }
    1220 bkpinfo->backup_media_type = media_specified_by_user;
     1214    if (g_restoring_live_from_cd) {
     1215        if (bkpinfo->backup_media_type != media_specified_by_user) {
     1216            log_msg(2,
     1217                    "bkpinfo->backup_media_type != media_specified_by_user, so I'd better ask :)");
     1218            interactively_obtain_media_parameters_from_user(FALSE);
     1219            media_specified_by_user = bkpinfo->backup_media_type;
     1220            get_cfg_file_from_archive();
     1221    /*
     1222        if (media_specified_by_user != cdr && media_specified_by_user == cdrw)
     1223            { g_restoring_live_from_cd = FALSE; }
     1224    */
     1225        }
     1226    }
     1227    bkpinfo->backup_media_type = media_specified_by_user;
    12211228}
    12221229g_backup_media_type = bkpinfo->backup_media_type;
     
    23912398            try_plan_B = TRUE;
    23922399        } else {
    2393             log_msg(2, "gcffa --- calling mount_cdrom now :)");
    2394             if (!mount_cdrom()) {
     2400            log_msg(2, "gcffa --- calling mount_media now :)");
     2401            if (!mount_media()) {
    23952402                log_msg(2,
    23962403                        "gcffa --- managed to mount CD; so, no need for Plan B");
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.h

    r1649 r1736  
    88int iso_fiddly_bits(bool nuke_me_please);
    99void kill_petris(void);
    10 int mount_cdrom();
     10int mount_media();
    1111int mount_device(char *, char *, char *, bool);
    1212int mount_all_devices(struct mountlist_itself *, bool);
Note: See TracChangeset for help on using the changeset viewer.