Changeset 3875 in MondoRescue


Ignore:
Timestamp:
Mar 8, 2024, 3:19:14 AM (7 weeks ago)
Author:
Bruno Cornec
Message:

find_dvd|cdrom_device merged into a rewritten find_optical_device - adds find_usb_device and find_device - mount_CDROM_here moved to mount_media (ongoing)

Location:
branches/3.3/mondo/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-archive.c

    r3874 r3875  
    24662466
    24672467    mr_asprintf(bkp, "%s", cd_dev);
    2468     if ((cd_dev = find_dvd_device()) != NULL) {
     2468    if ((cd_dev = find_optical_device()) != NULL) {
    24692469        if (!system("which cdrecord > /dev/null 2> /dev/null")) {
    24702470            mr_asprintf(cdrecord, "cdrecord dev=%s -atip", cd_dev);
     
    25362536    ok_go_ahead_burn_it = TRUE;
    25372537    mr_free(cdrom_dev);
    2538     if ((cdrom_dev = find_cdrom_device()) != NULL) {
     2538    if ((cdrom_dev = find_optical_device()) != NULL) {
    25392539        /* When enabled, it made CD eject-and-retract when wrong CD inserted.. Weird
    25402540        log_msg(2, "paafcd: Retracting CD-ROM drive if possible" );
     
    30963096        if (g_current_media_number == 1 && !res
    30973097            && (bkpinfo->backup_media_type == cdr)) {
    3098             if ((tmp = find_cdrom_device()) == NULL) {  // make sure find_cdrom_device() finds, records CD-R's loc
     3098            if ((tmp = find_optical_device())   == NULL) {  // make sure find_optical_device() finds, records CD-R's loc
    30993099                log_msg(3, "*Sigh* Mike, I hate your computer.");
    31003100                // if it can't be found then force pausing
     
    32083208        if (bkpinfo->backup_media_type != iso) {
    32093209            mr_free(bkpinfo->media_device);
    3210             bkpinfo->media_device = find_cdrom_device();    // replace 0,0,0 with /dev/cdrom
     3210            bkpinfo->media_device = find_optical_device();  // replace 0,0,0 with /dev/cdrom
    32113211        }
    32123212        if (chdir("/")) {
  • branches/3.3/mondo/src/common/libmondo-cli.c

    r3874 r3875  
    349349        }
    350350        if (!flag_set['d']) {
    351             if ((bkpinfo->media_device = find_dvd_device()) != NULL) {
     351            if ((bkpinfo->media_device = find_optical_device()) != NULL) {
    352352                flag_set['d'] = TRUE;
    353353                log_to_screen("I guess DVD drive is at %s", bkpinfo->media_device);
  • branches/3.3/mondo/src/common/libmondo-devices-EXT.h

    r3874 r3875  
    22 * $Id$
    33 */
     4/* Reviewed */
     5extern char *find_optical_device(void);
    46
     7/* TBC */
    58extern bool am_I_in_disaster_recovery_mode(void);
    69extern bool does_device_exist(char *device);
    710extern int does_partition_exist(const char *drive, int partno);
    811extern bool does_string_exist_in_boot_block(char *dev, char *str);
    9 extern int find_and_mount_actual_cd(
    10                                     char *mountpoint);
    11 extern int find_cdrom_device(char *output, bool try_to_mount);
    12 extern char *find_dvd_device(void);
     12extern int find_and_mount_actual_cd(char *mountpoint);
    1313extern long get_phys_size_of_drive(char *drive);
    1414extern bool is_this_a_valid_disk_format(char *format);
     
    1616extern int find_device_in_mountlist(struct mountlist_itself *mountlist,
    1717                                    char *device);
    18 extern int mount_CDROM_here(char *device, const char *mountpoint);
    1918extern long long size_of_specific_device_in_mountlist(struct
    2019                                                      mountlist_itself
  • branches/3.3/mondo/src/common/libmondo-devices.c

    r3874 r3875  
    447447
    448448
    449 
    450 /**
    451  * Try to mount CD-ROM at @p mountpoint. If the CD-ROM is not found or has
    452  * not been specified, call find_cdrom_device() to find it.
     449/**
     450 * Try to mount CD/DVD at @p mountpoint. If the CD/DVD is not found or has
     451 * not been specified, call find_optical_device() to find it.
    453452 * @param mountpoint Where to mount the CD-ROM.
    454  * @return 0 for success, nonzero for failure.
    455  * @see mount_CDROM_here
    456  */
    457 int find_and_mount_actual_cd(char *mountpoint) {
     453 * @return TRUE for success, FALSE for failure.
     454 * @see mount_media
     455 */
     456bool find_and_mount_actual_cd(char *mountpoint) {
    458457
    459458    /*@ buffers ***************************************************** */
    460459
    461460    /*@ int's  ****************************************************** */
    462     int res;
     461    bool res;
    463462
    464463    /*@ end vars **************************************************** */
     
    467466    assert_string_is_neither_NULL_nor_zerolength(mountpoint);
    468467
    469     if (g_backup_media_type == dvd) {
    470         if (bkpinfo->media_device == NULL) {
    471             bkpinfo->media_device = find_dvd_device();
    472         }
    473     } else {
    474         if (bkpinfo->media_device == NULL) {
    475             bkpinfo->media_device = find_cdrom_device();
    476         }
     468    if (bkpinfo->media_device == NULL) {
     469        bkpinfo->media_device = find_optical_device();
    477470    }
    478471
     
    481474    }
    482475
    483     if ((bkpinfo->media_device == NULL) || (res = mount_CDROM_here(bkpinfo->media_device, mountpoint))) {
     476    if ((bkpinfo->media_device == NULL) || (res = mount_media(mountpoint))) {
    484477        mr_free(bkpinfo->media_device);
    485478        if ((bkpinfo->media_device = mr_popup_and_get_string("CD-ROM device", "Please enter your CD-ROM's /dev device", "/dev/cdrom")) == NULL) {
    486             res = 1;
     479            res = TRUE;
    487480        } else {
    488             res = mount_CDROM_here(bkpinfo->media_device, mountpoint);
     481            res = mount_media(mountpoint);
    489482        }
    490483    }
     
    496489    return (res);
    497490}
    498 
    499 
    500 /**
    501  * Attempt to locate a CD-ROM device's /dev entry.
    502  * Several different methods may be used to find the device, including
    503  * calling @c cdrecord, searching @c dmesg, and trial-and-error.
    504  * @param output Where to put the located /dev entry.
    505  * @param try_to_mount Whether to mount the CD as part of the test; if mount
    506  * fails then return failure.
    507  * @return 0 for success, nonzero for failure.
    508  */
    509 int find_cdrom_device(char *output, bool try_to_mount)
    510 {
    511     /*@ pointers **************************************************** */
    512     FILE *fin;
    513     char *p;
    514     char *q;
    515     char *r;
    516     int retval = 0;
    517 
    518     /*@ bool's ****************************************************** */
    519     bool found_it = FALSE;
    520 
    521     /*@ buffers ***************************************************** */
    522     char *tmp = NULL;
     491/*
     492 * This function tries to find a USB media device
     493 * and return it's device file to the caller that needs to free it
     494 */
     495char *find_usb_device(void)
     496{
     497    char *dev = NULL;
    523498    char *tmp1 = NULL;
    524     char *cdr_exe = NULL;
    525     char *phrase_one;
    526     char *phrase_two = NULL;
    527499    char *command = NULL;
    528 #ifndef __FreeBSD__
    529     char *dvd_last_resort = NULL;
    530 #endif
    531     char *mountpoint = NULL;
    532     static char the_last_place_i_found_it[MAX_STR_LEN] = "";
    533 
    534     assert_string_is_neither_NULL_nor_zerolength(output);
    535     output[0] = '\0';
    536 
    537     if (g_cdrom_drive_is_here[0] && !isdigit(g_cdrom_drive_is_here[0])) {
    538         strcpy(output, g_cdrom_drive_is_here);
    539         log_msg(3, "Been there, done that. Returning %s", output);
    540         return(0);
    541     }
    542     if (the_last_place_i_found_it[0] != '\0' && !try_to_mount) {
    543         strcpy(output, the_last_place_i_found_it);
    544         log_msg(3, "find_cdrom_device() --- returning last found location - '%s'", output);
    545         return(0);
    546     }
    547 
    548     if ((cdr_exe = find_home_of_exe("cdrecord")) == NULL) {
    549         if ((cdr_exe = find_home_of_exe("wodim")) == NULL) {
    550             cdr_exe = find_home_of_exe("dvdrecord");
    551         }
    552     }
    553 
    554     if (cdr_exe == NULL) {
    555         strcpy(output, "/dev/cdrom");
    556         log_msg(4, "Can't find cdrecord; assuming %s", output);
    557         if (!does_device_exist(output)) {
    558             log_msg(4, "That didn't work. Sorry.");
    559             return(1);
    560         } else {
    561             return(0);
    562         }
    563     }
    564 
    565     mr_asprintf(command, "%s -scanbus 2> /dev/null", cdr_exe);
    566     fin = popen(command, "r");
    567     if (!fin) {
    568         log_msg(4, "command=%s", command);
    569         log_OS_error("Cannot popen command");
    570         mr_free(cdr_exe);
     500
     501    log_to_screen("I am looking for your USB key. Please wait.");
     502
     503    if (bkpinfo->media_device != NULL) {
     504        log_msg(3, "Been there, done that. Returning %s", bkpinfo->media_device);
     505        return (bkpinfo->media_device);
     506    }
     507
     508    tmp1 = find_home_of_exe("lsscsi");
     509    if (tmp1 != NULL) {
     510        mr_asprintf(command, "%s | grep ' disk' | grep USB | awk '{print $NF}' | head -1", tmp1);
     511        dev = call_program_and_get_last_line_of_output(command);
    571512        mr_free(command);
    572         return(1);
    573     }
    574     mr_free(command);
    575 
    576     /*@ intialize *************************************************** */
    577     malloc_string(tmp);
    578     malloc_string(phrase_one);
    579 
    580     phrase_one[0] = '\0';
    581     tmp[0] = '\0';
    582 
    583     /*@ end vars **************************************************** */
    584 
    585 
    586     for (tmp1 = fgets(tmp, MAX_STR_LEN, fin); !feof(fin) && (tmp1 != NULL);
    587          tmp1 = fgets(tmp, MAX_STR_LEN, fin)) {
    588         p = strchr(tmp, '\'');
    589         if (p) {
    590             q = strchr(++p, '\'');
    591             if (q) {
    592                 for (r = q; *(r - 1) == ' '; r--);
    593                 *r = '\0';
    594                 strcpy(phrase_one, p);
    595                 p = strchr(++q, '\'');
    596                 if (p) {
    597                     q = strchr(++p, '\'');
    598                     if (q) {
    599                         while (*(q - 1) == ' ') {
    600                             q--;
    601                         }
    602                         *q = '\0';
    603                         mr_asprintf(phrase_two, "%s", p);
    604                     }
    605                 }
    606             }
    607         }
    608     }
    609     paranoid_pclose(fin);
    610 
    611 #ifndef __FreeBSD__
    612     if (!phrase_two || strlen(phrase_two) == 0) {
    613         log_msg(4, "Not running phase two. String is empty.");
     513    }
     514    mr_free(tmp1);
     515
     516    if ((dev == NULL) || !does_file_exist(dev)) {
     517        tmp1 = find_home_of_exe("lsblk");
     518        if (tmp1 != NULL) {
     519            mr_asprintf(command, "%s --noheadings --raw --output rm,tran,type,path --sort path | awk '/^1 usb disk/ {d=$4} END {print d}'", tmp1);
     520            dev = call_program_and_get_last_line_of_output(command);
     521            mr_free(command);
     522        }
     523        mr_free(tmp1);
     524        log_it("Unable to find a tape device on this system");
     525    }
     526    if (dev != NULL) {
     527        log_it("find_usb_device found %s manually", dev);
     528    }
     529
     530    if ((dev != NULL) && does_file_exist(dev)) {
     531        log_it("find_usb_device returns %s", dev);
    614532    } else {
    615         mr_asprintf(command, "dmesg | grep \"%s\" 2> /dev/null", phrase_two);
    616         fin = popen(command, "r");
    617         mr_free(command);
    618 
    619         if (!fin) {
    620             log_msg(4, "Cannot run 2nd command - non-fatal, fortunately");
    621         } else {
    622             for (tmp1 = fgets(tmp, MAX_STR_LEN, fin); !feof(fin) && (tmp1 != NULL);
    623                  tmp1 = fgets(tmp, MAX_STR_LEN, fin)) {
    624                 log_msg(5, "--> '%s'", tmp);
    625                 if (tmp[0] != ' ' && tmp[1] != ' ') {
    626                     p = strchr(tmp, ':');
    627                     if (p) {
    628                         *p = '\0';
    629                         if (strstr(tmp, "DVD")) {
    630                             mr_free(dvd_last_resort);
    631                             mr_asprintf(dvd_last_resort, "/dev/%s", tmp);
    632                             log_msg(4, "Ignoring '%s' because it's a DVD drive", tmp);
    633                         } else {
    634                             sprintf(output, "/dev/%s", tmp);
    635                             found_it = TRUE;
    636                         }
    637                     }
    638                 }
    639             }
    640             paranoid_pclose(fin);
    641         }
    642     }
    643 
    644 #endif
    645 #ifdef __FreeBSD__
    646     if (!found_it) {
    647         log_msg(4, "OK, approach 2");
    648         if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/cdrom"))) {
    649             if (!
    650                 (found_it =
    651                  set_dev_to_this_if_rx_OK(output, "/dev/cdrom1"))) {
    652                 if (!
    653                     (found_it =
    654                      set_dev_to_this_if_rx_OK(output, "/dev/dvd"))) {
    655                     if (!
    656                         (found_it =
    657                          set_dev_to_this_if_rx_OK(output, "/dev/acd0"))) {
    658                         if (!
    659                             (found_it =
    660                              set_dev_to_this_if_rx_OK(output,
    661                                                       "/dev/cd01"))) {
    662                             if (!
    663                                 (found_it =
    664                                  set_dev_to_this_if_rx_OK(output,
    665                                                           "/dev/acd1"))) {
    666                                 if (!
    667                                     (found_it =
    668                                      set_dev_to_this_if_rx_OK(output,
    669                                                               "/dev/cd1")))
    670                                 {
    671                                     retval = 1;
    672                                     goto end_of_find_cdrom_device;
    673                                 }
    674                             }
    675                         }
    676                     }
    677                 }
    678             }
    679         }
    680     }
    681 #else
    682     if (!found_it && strlen(dvd_last_resort) > 0) {
    683         log_msg(4, "Well, I'll use the DVD - %s - as a last resort", dvd_last_resort);
    684         strcpy(output, dvd_last_resort);
    685         found_it = TRUE;
    686     }
    687     if (found_it) {
    688         sprintf(tmp, "grep \"%s=ide-scsi\" "CMDLINE" &> /dev/null", strrchr(output, '/') + 1);
    689         if (system(tmp) == 0) {
    690             log_msg(4, "%s is not right. It's being SCSI-emulated. Continuing.", output);
    691             found_it = FALSE;
    692             output[0] = '\0';
    693         }
    694     }
    695 
    696     if (found_it) {
    697         log_msg(4, "(find_cdrom_device) --> '%s'", output);
    698         if (!does_device_exist(output)) {
    699             found_it = FALSE;
    700             log_msg(4, "OK, I was wrong, I haven't found it... yet.");
    701         }
    702     }
    703 
    704     if (!found_it) {
    705         log_msg(4, "OK, approach 2");
    706         if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/scd0"))) {
    707             if (!(found_it = set_dev_to_this_if_rx_OK(output, "/dev/sr0"))) {
    708                 if (!
    709                     (found_it =
    710                      set_dev_to_this_if_rx_OK(output, "/dev/cdrom"))) {
    711                     if (!
    712                         (found_it =
    713                          set_dev_to_this_if_rx_OK(output,
    714                                                   "/dev/cdrom0"))) {
    715                         if (!
    716                             (found_it =
    717                              set_dev_to_this_if_rx_OK(output,
    718                                                       "/dev/cdrom1"))) {
    719                             if (!
    720                                 (found_it =
    721                                  set_dev_to_this_if_rx_OK(output,
    722                                                           "/dev/sr1"))) {
    723                                 if (!
    724                                     (found_it =
    725                                      set_dev_to_this_if_rx_OK(output,
    726                                                               "/dev/dvd")))
    727                                 {
    728                                     if (!
    729                                         (found_it =
    730                                          set_dev_to_this_if_rx_OK(output,
    731                                                                   g_cd_drive_is_here)))
    732                                     {
    733                                         retval = 1;
    734                                         goto end_of_find_cdrom_device;
    735                                     }
    736                                 }
    737                             }
    738                         }
    739                     }
    740                 }
    741             }
    742         }
    743     }
    744 #endif
    745 
    746     mr_asprintf(mountpoint, "%s/cd.mnt", bkpinfo->tmpdir);
    747     make_hole_for_dir(mountpoint);
    748 
    749     if (found_it && try_to_mount) {
    750         if (mount_CDROM_here(output, mountpoint)) {
    751             log_msg(4, "[Cardigans] I've changed my mind");
    752             found_it = FALSE;
    753         } else {
    754             sprintf(tmp, "%s/archives", mountpoint);
    755             if (!does_file_exist(tmp)) {
    756                 log_msg(4, "[Cardigans] I'll take it back");
    757                 found_it = FALSE;
    758             } else {
    759                 mr_asprintf(command, "umount %s", output);
    760                 paranoid_system(command);
    761                 mr_free(command);
    762 
    763                 log_msg(4, "I'm confident the Mondo CD is in %s", output);
    764             }
    765         }
    766     }
    767     unlink(mountpoint);
    768     mr_free(mountpoint);
    769 
    770     if (found_it) {
    771         if (!does_file_exist(output)) {
    772             log_msg(3, "I still haven't found it.");
    773             return (1);
    774         }
    775         log_msg(3, "(find_cdrom_device) --> '%s'", output);
    776         strcpy(the_last_place_i_found_it, output);
    777         strcpy(g_cdrom_drive_is_here, output);
    778         retval = 0;
    779         goto end_of_find_cdrom_device;
    780     }
    781 
    782     mr_asprintf(command, "%s -scanbus | grep \"[0-9],[0-9],[0-9]\" | grep -E \"[D|C][V|D]\" | grep -n \"\" | grep \"%s\" | cut -d':' -f2", cdr_exe, g_cd_drive_is_here);
    783 
    784     log_msg(1, "command=%s", command);
    785     tmp1 = call_program_and_get_last_line_of_output(command);
    786     mr_free(command);
    787 
    788     if (strlen(tmp1) > 0) {
    789         strcpy(output, tmp1);
    790         log_msg(4, "Finally found it at %s", output);
    791         retval = 0;
    792     } else {
    793         log_msg(4, "Still couldn't find it.");
    794         retval = 1;
    795     }
    796     mr_free(tmp1);
    797 
    798   end_of_find_cdrom_device:
    799     mr_free(cdr_exe);
    800     mr_free(phrase_two);
    801     mr_free(dvd_last_resort);
    802 
    803     paranoid_free(tmp);
    804     paranoid_free(phrase_one);
    805     return (retval);
    806 }
     533        mr_free(dev);
     534        log_it("find_usb_device found no USB key on your system returning NULL");
     535    }
     536    return(dev);
     537}
     538
    807539
    808540/*
     
    810542 * and return it's device file to the caller that needs to free it
    811543 */
    812 char *find_dvd_device(void)
     544char *find_optical_device(void)
    813545{
    814546    char *dev = NULL;
     
    828560
    829561    if ((dev != NULL) && does_file_exist(dev)) {
    830         log_msg(2, "find_dvd_device found %s automatically", dev);
     562        log_msg(2, "find_optical_device found %s automatically", dev);
    831563    } else {
    832564        mr_free(dev);
     
    845577                mr_asprintf(dev, "%s", ALT_CDROM);
    846578                if (!does_file_exist(dev)) {
    847                     log_it("Unable to find a tape device on this system");
     579                    mr_asprintf(dev, "%s", "/dev/cdrom");
     580                    if (!does_file_exist(dev)) {
     581                        mr_asprintf(dev, "%s", "/dev/dvd");
     582                        if (!does_file_exist(dev)) {
     583                            log_it("Unable to find a tape device on this system");
    848584                }
    849585            }
    850586        }
    851587        if (dev != NULL) {
    852             log_it("find_dvd_device found %s manually", dev);
     588            log_it("find_optical_device found %s manually", dev);
    853589        }
    854590    }
    855591
    856592    if ((dev != NULL) && does_file_exist(dev)) {
    857         log_it("find_dvd_device returns %s", dev);
     593        log_it("find_optical_device returns %s", dev);
    858594    } else {
    859595        mr_free(dev);
    860         log_it("find_dvd_device found no optical burner on your system returning NULL");
     596        log_it("find_optical_device found no optical burner on your system returning NULL");
    861597    }
    862598    return(dev);
    863599}
     600
     601/* Generic fund to find a media
     602 * Return a dynamically allocted string that caller needs to free
     603 * @media_type is the type of media to look for
     604 */
     605
     606char *find_device(t_bkptype media_type) {
     607
     608    if (media_type == usb) {
     609        return(find_usb_device());
     610    } else if (media_type == tape) {
     611        return(find_tape_device());
     612    } else if ((media_type == dvd) || (media_type == cdr)) {
     613        return(find_optical_device());
     614    } else {
     615        return(NULL);
     616    }
     617}
     618
     619
    864620
    865621
     
    1215971
    1216972/**
    1217  * Mount the CD-ROM at @p mountpoint.
    1218  * @param device The device (or file if g_ISO_restore_mode) to mount.
    1219  * @param mountpoint The place to mount it.
    1220  * @return 0 for success, nonzero for failure.
    1221  */
    1222 int mount_CDROM_here(char *device, const char *mountpoint)
    1223 {
    1224     /*@ buffer ****************************************************** */
    1225     char *command = NULL;
    1226     int retval;
    1227 #ifdef __FreeBSD__
    1228     char *dev = NULL;
    1229 #else
    1230     char *options = NULL;
    1231 #endif
    1232 
    1233     assert_string_is_neither_NULL_nor_zerolength(device);
    1234     assert_string_is_neither_NULL_nor_zerolength(mountpoint);
    1235 
    1236     make_hole_for_dir(mountpoint);
    1237 
    1238     if (isdigit(device[0])) {
    1239         find_cdrom_device(device, FALSE);
    1240     }
    1241 #ifndef __FreeBSD__
    1242     mr_asprintf(options, "ro");
    1243 #endif
    1244 
    1245     if (g_ISO_restore_mode) {
    1246 
    1247 #ifdef __FreeBSD__
    1248         mr_asprintf(dev, "%s", make_vn(device));
    1249         if (!dev) {
    1250             mr_asprintf(command, "Unable to mount ISO (make_vn(%s) failed)", device);
    1251             fatal_error(command);
    1252         }
    1253         strcpy(device, dev);
    1254         paranoid_free(dev);
    1255 #else
    1256         mr_strcat(options, ",loop");
    1257 #endif
    1258 
    1259     }
    1260     log_msg(4, "(mount_CDROM_here --- device=%s, mountpoint=%s", device, mountpoint);
    1261     /*@ end vars *************************************************** */
    1262 
    1263 #ifdef __FreeBSD__
    1264     mr_asprintf(command, "mount_cd9660 -r %s %s 2>> %s", device, mountpoint, MONDO_LOGFILE);
    1265 
    1266 #else
    1267     mr_asprintf(command, "mount %s -o %s -t iso9660 %s 2>> %s", device, options, mountpoint, MONDO_LOGFILE);
    1268     paranoid_free(options);
    1269 #endif
    1270 
    1271     log_msg(4, command);
    1272     if (strncmp(device, "/dev/", 5) == 0) {
    1273         retract_CD_tray_and_defeat_autorun();
    1274     }
    1275     retval = system(command);
    1276     log_msg(1, "system(%s) returned %d", command, retval);
    1277     mr_free(command);
    1278 
    1279     return (retval);
    1280 }
    1281 
    1282 
    1283 /**
    1284973* Mount the CD-ROM or USB device at /mnt/cdrom.
    1285974* @param bkpinfo The backup information structure. Fields used:
     
    1288977* - @c bkpinfo->isodir
    1289978* - @c bkpinfo->media_device
    1290 * @return 0 for success, nonzero for failure.
     979* @return TRUE for success, FALSE for failure.
    1291980*/
    1292 int mount_media()
    1293 {
    1294 char *mount_cmd = NULL;
    1295 char *mountdir = NULL;
    1296 int i, res;
     981bool mount_media(const char *mountpoint) {
     982
     983    char *mount_cmd = NULL;
     984    char *mountdir = NULL;
     985    char *tmp = NULL;
     986    int i = 0, res = 0;
    1297987#ifdef __FreeBSD__
    1298988    char mdd[32];
    1299989    char *mddev = mdd;
     990    char *dev;
    1300991#endif
    1301992
    1302993    if (bkpinfo->backup_media_type == tape || bkpinfo->backup_media_type == udev) {
    1303994        log_msg(8, "Tape/udev. Therefore, no need to mount a media.");
    1304         return 0;
    1305     }
    1306 
    1307     if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
     995        return(TRUE);
     996    }
     997
     998    assert_string_is_neither_NULL_nor_zerolength(mountpoint);
     999
     1000    mr_asprintf(tmp, "mount | grep -F %s", mountpoint);
     1001    if (!run_program_and_log_output(tmp, FALSE)) {
    13081002        log_msg(2, "mount_media() - media already mounted. Fair enough.");
    1309         return (0);
    1310     }
     1003        mr_free(tmp);
     1004        return (TRUE);
     1005    }
     1006    mr_free(tmp);
     1007
     1008    make_hole_for_dir(mountpoint);
    13111009
    13121010    if (bkpinfo->backup_media_type == netfs) {
     
    13281026        mr_free(mount_cmd);
    13291027
    1330         mr_asprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
     1028        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, mountpoint);
    13311029#else
    13321030        if (bkpinfo->netfs_remote_dir != NULL) {
    13331031            // NETFS
    1334             mr_asprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1032            mr_asprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number, mountpoint);
    13351033        } else {
    13361034            // ISO
    1337             mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1035            mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, mountpoint);
    13381036        }
    13391037#endif
     
    13501048        mr_free(mount_cmd);
    13511049
    1352         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
     1050        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, mountpoint);
    13531051#else
    1354         mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", mountdir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1052        mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", mountdir, bkpinfo->prefix, g_current_media_number, mountpoint);
    13551053#endif
    13561054        mr_free(mountdir);
    13571055    } else if (bkpinfo->backup_media_type == usb) {
    1358         mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, MNT_CDROM);
    1359     } else if (strstr(bkpinfo->media_device, "/dev/")) {
    1360 #ifdef __FreeBSD__
    1361         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
    1362 #else
    1363         mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
    1364 #endif
    1365     } else {
     1056        mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, mountpoint);
     1057    } else {    //  optical
    13661058        if (bkpinfo->disaster_recovery
    13671059            && does_file_exist("/tmp/CDROM-LIVES-HERE")) {
    13681060            mr_asprintf(bkpinfo->media_device, "%s", last_line_of_file("/tmp/CDROM-LIVES-HERE"));
    13691061        } else {
    1370             find_cdrom_device(bkpinfo->media_device, TRUE);
     1062            if (bkpinfo->media_device == NULL) {
     1063                bkpinfo->media_device = find_optical_device();
     1064            }
    13711065        }
    13721066
    13731067#ifdef __FreeBSD__
    1374         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
     1068        if (g_ISO_restore_mode) {
     1069            mr_asprintf(dev, "%s", make_vn(bkpinfo->media_device));
     1070            if (!dev) {
     1071                mr_asprintf(command, "Unable to mount ISO (make_vn(%s) failed)", bkpinfo->media_device);
     1072                fatal_error(command);
     1073            }
     1074            mr_free(bkpinfo->media_device);
     1075            bkpinfo->media_device = dev
     1076        }
     1077
     1078        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s 2>> %s", bkpinfo->media_device, mountpoint, MONDO_LOGFILE);
    13751079#else
    1376         mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
    1377 #endif
    1378     }
    1379 
    1380     log_msg(2, "(mount_media) --- command = %s", mount_cmd);
     1080        mr_asprintf(mount_cmd, "mount %s -o loop,ro -t iso9660 %s 2>> %s", bkpinfo->media_device, mountpoint, MONDO_LOGFILE);
     1081#endif
     1082        log_msg(2, "(mount_media) --- command = %s", mount_cmd);
     1083        // usefull ??
     1084        if (strncmp(device, "/dev/", 5) == 0) {
     1085            retract_CD_tray_and_defeat_autorun();
     1086        }
     1087    }
     1088
    13811089    for (i = 0; i < 2; i++) {
    13821090        res = run_program_and_log_output(mount_cmd, FALSE);
     
    13931101    if (res) {
    13941102        log_msg(2, "Failed, despite %d attempts", i);
     1103        return(FALSE);
    13951104    } else {
    13961105        log_msg(2, "Mounted media drive OK");
    1397     }
    1398     return (res);
     1106        return(TRUE);
     1107    }
    13991108}
    14001109/**************************************************************************
    1401 *END_MOUNT_CDROM                                                         *
     1110*END_MOUNT_MEDIA                                                         *
    14021111**************************************************************************/
    14031112
     
    21571866        finish(1);
    21581867    }
     1868    log_msg(3, "media type = %s", bkptype_to_string(bkpinfo->backup_media_type));
     1869
    21591870    /* Why asking to remove the media with tape ?
    21601871    if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) {
     
    21631874    */
    21641875    if (archiving_to_media) {
     1876        // TODO: Should be common ?
    21651877        setup_tmpdir(NULL);
    21661878        /*
     
    21821894        setup_scratchdir(tmp);
    21831895        mr_free(tmp);
    2184     }
    2185     log_msg(3, "media type = %s", bkptype_to_string(bkpinfo->backup_media_type));
    2186     bkpinfo->cdrw_speed = (bkpinfo->backup_media_type == cdstream) ? 2 : 4;
    2187     bkpinfo->compression_level = (bkpinfo->backup_media_type == cdstream) ? 1 : 5;
    2188     bkpinfo->use_lzo = (bkpinfo->backup_media_type == cdstream) ? TRUE : FALSE;
     1896
     1897        if ((compression_type = which_compression_type()) == NULL) {
     1898            log_to_screen("User has chosen not to backup the machine");
     1899            finish(1);
     1900        }
     1901
     1902        bkpinfo->compression_level = (bkpinfo->backup_media_type == cdstream) ? 1 : 5;
     1903        if ((bkpinfo->compression_level = which_compression_level()) == -1) {
     1904            log_to_screen("User has chosen not to backup the machine");
     1905            finish(1);
     1906        }
     1907        bkpinfo->cdrw_speed = (bkpinfo->backup_media_type == cdstream) ? 2 : 4;
     1908        bkpinfo->use_lzo = (bkpinfo->backup_media_type == cdstream) ? TRUE : FALSE;
     1909    }
    21891910    mvaddstr_and_log_it(2, 0, " ");
    21901911
     
    21981919            bkpinfo->please_dont_eject = TRUE;
    21991920        }
     1921        mds = media_descriptor_string(bkpinfo->backup_media_type);
     1922        if (bkpinfo->backup_media_type != usb) {
     1923            if (ask_me_yes_or_no("Is your computer a laptop type (manual insert of MondoRescue media)?")) {
     1924                bkpinfo->manual_cd_tray = TRUE;
     1925            }
     1926        }
     1927
     1928        if (bkpinfo->media_device == NULL) {
     1929            bkpinfo->media_device = find_device(bkpinfo->backup_media_type);
     1930            if (bkpinfo->media_device != NULL) {
     1931                log_msg(1, "MondoRescue device found automatically for your %s is %s", mds, bkpinfo->media_device);
     1932            } else {
     1933                log_msg(1, "No MondoRescue device found yet for your %s", mds);
     1934            }
     1935        }
     1936
    22001937        if (archiving_to_media) {
    2201             if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    2202                 if (ask_me_yes_or_no("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")) {
    2203                     bkpinfo->manual_cd_tray = TRUE;
    2204                 }
    2205             }
    2206             if ((compression_type = which_compression_type()) == NULL) {
    2207                 log_to_screen("User has chosen not to backup the machine");
    2208                 finish(1);
    2209             }
    2210 
    2211             if ((bkpinfo->compression_level = which_compression_level()) == -1) {
    2212                 log_to_screen("User has chosen not to backup the machine");
    2213                 finish(1);
    2214             }
    2215             mds = media_descriptor_string(bkpinfo->backup_media_type);
    2216             mr_asprintf(comment, "What speed is your %s (re)writer?", mds);
    22171938            if (bkpinfo->backup_media_type == dvd) {
    2218                 bkpinfo->media_device = find_dvd_device();
    2219                 if (bkpinfo->media_device == NULL) {
    2220                     log_msg(1, "No backup device found for your DVD");
    2221                 }
    22221939                strcpy(tmp1, "1");
    22231940                mr_asprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE);  // 4.7 salesman's GB = 4.482 real GB = 4482 MB
    22241941                log_msg(1, "Setting to DVD defaults");
    22251942            } else {
    2226                 mr_asprintf(bkpinfo->media_device, "%s", VANILLA_SCSI_CDROM);
    22271943                strcpy(tmp1, "4");
    22281944                mr_asprintf(sz_size, "%d", 650);
    22291945                log_msg(1, "Setting to CD defaults");
    22301946            }
     1947
     1948            mr_asprintf(comment, "What speed is your %s writer?", mds);
    22311949            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    22321950                if (!popup_and_get_string("Speed", comment, tmp1, 4)) {
     
    22411959            strcpy(tmp1, sz_size);
    22421960            mr_asprintf(comment, "How much data (in Megabytes) will each %s store?", mds);
    2243             mr_free(mds);
    22441961            if (!popup_and_get_string("Size", comment, tmp1, 5)) {
    22451962                log_to_screen("User has chosen not to backup the machine");
     
    22561973        /* No break because we continue even for usb */
    22571974    case cdstream:
    2258         mds = media_descriptor_string(bkpinfo->backup_media_type);
    2259 
    2260         if ((bkpinfo->disaster_recovery) && (bkpinfo->backup_media_type != usb)) {
    2261             mr_asprintf(bkpinfo->media_device, "%s", "/dev/cdrom");
    2262             log_msg(2, "CD-ROM device assumed to be at %s", bkpinfo->media_device);
    2263         } else if ((bkpinfo->restore_data && (bkpinfo->backup_media_type != usb))  || bkpinfo->backup_media_type == dvd) {
    2264             if (bkpinfo->media_device == NULL) {
    2265                 mr_asprintf(bkpinfo->media_device, "%s", "/dev/cdrom");
    2266             }                   // just for the heck of it :)
    2267             log_msg(1, "bkpinfo->media_device = %s", bkpinfo->media_device);
    2268             if (bkpinfo->backup_media_type == dvd || find_cdrom_device(bkpinfo->media_device, FALSE)) {
    2269                 log_msg(1, "bkpinfo->media_device = %s", bkpinfo->media_device);
    2270                 mr_asprintf(comment, "Please specify your %s drive's /dev entry", mds);
    2271                 tmp2 = mr_popup_and_get_string("Device?", comment, bkpinfo->media_device);
    2272                 if (!tmp2) {
    2273                     log_to_screen("User has chosen not to backup the machine");
    2274                     finish(1);
    2275                 } else {
    2276                     mr_free(bkpinfo->media_device);
    2277                     bkpinfo->media_device = tmp2;
    2278                 }
    2279             }
    2280             log_msg(2, "%s device found at %s", mds, bkpinfo->media_device);
    2281         } else {
    2282             if ((find_cdrom_device(bkpinfo->media_device)) && (bkpinfo->backup_media_type != usb)) {
     1975
     1976        // If media_device not found ask
     1977        if (bkpinfo->media_device == NULL) {
     1978            mr_asprintf(comment, "Please specify your Mondorescue %s media /dev entry", mds);
     1979            tmp2 = mr_popup_and_get_string("/dev entry?", comment, bkpinfo->media_device);
     1980            if (!tmp2) {
     1981                log_to_screen("User has chosen not to backup the machine");
     1982                finish(1);
     1983            } else {
    22831984                mr_free(bkpinfo->media_device);
    2284             }
    2285             if (bkpinfo->media_device != NULL) {
    2286                 if (bkpinfo->backup_media_type == usb) {
    2287                     mr_asprintf(tmp, "I think your %s media corresponds to %s. Is this correct?", mds, bkpinfo->media_device);
    2288                 } else {
    2289                     mr_asprintf(tmp, "I think I've found your %s burner at SCSI node %s. Is this correct? (Say no if you have an IDE burner and you are running a 2.6 kernel. You will then be prompted for further details.)", mds, bkpinfo->media_device);
    2290                 }
    2291                 if (!ask_me_yes_or_no(tmp)) {
    2292                     mr_free(bkpinfo->media_device);
    2293                 }
    2294                 mr_free(tmp);
    2295             }
    2296             if (bkpinfo->media_device != NULL) {
    2297                 if (bkpinfo->backup_media_type == usb) {
    2298                     tmp2 = mr_popup_and_get_string("/dev entry?", "What is the /dev entry of your USB Disk/Key, please?", bkpinfo->media_device);
    2299                 } else {
    2300                     if (g_kernel_version < 2.6) {
    2301                         tmp2 = mr_popup_and_get_string("Device node?", "What is the SCSI node of your CD (re)writer, please?", bkpinfo->media_device);
    2302                     } else {
    2303                         tmp2 = mr_popup_and_get_string("/dev entry?", "What is the /dev entry of your CD (re)writer, please?", bkpinfo->media_device);
    2304                     }
    2305                 }
    2306                 if (tmp2 == NULL) {
    2307                     log_to_screen("User has chosen not to backup the machine");
    2308                     finish(1);
    2309                 } else {
    2310                     mr_free(bkpinfo->media_device);
    2311                     bkpinfo->media_device = tmp2;
    2312                 }
     1985                bkpinfo->media_device = tmp2;
     1986            }
     1987        }
     1988        log_msg(2, "%s device found at %s", mds, bkpinfo->media_device);
     1989        mr_asprintf(tmp, "MondoRescue thinks your %s media corresponds to %s. Is this correct?", mds, bkpinfo->media_device);
     1990        if (!ask_me_yes_or_no(tmp)) {
     1991            mr_free(bkpinfo->media_device);
     1992        }
     1993        mr_free(tmp);
     1994
     1995        if (bkpinfo->media_device == NULL) {
     1996            mr_asprintf(tmp, "Please then specify your Mondorescue %s media /dev entry", mds);
     1997            tmp2 = mr_popup_and_get_string("/dev entry?", tmp, bkpinfo->media_device);
     1998            mr_free(tmp);
     1999            if (tmp2 == NULL) {
     2000                log_to_screen("User has chosen not to backup the machine");
     2001                finish(1);
     2002            } else {
     2003                mr_free(bkpinfo->media_device);
     2004                bkpinfo->media_device = tmp2;
    23132005            }
    23142006        }
     
    23382030        }
    23392031        if (bkpinfo->media_device != NULL) {
    2340             mr_asprintf(tmp, "I think I've found your tape streamer at %s; am I right on the money?", bkpinfo->media_device);
     2032            mr_asprintf(tmp, "Mondorescue thinks your tape streamer at %s; is that correct?", bkpinfo->media_device);
    23412033            if (!ask_me_yes_or_no(tmp)) {
    23422034                mr_free(bkpinfo->media_device);
     
    23812073        log_msg(4, "media_size = %ld", bkpinfo->media_size);
    23822074
    2383         bkpinfo->use_obdr = ask_me_yes_or_no("Do you want to activate OBDR support for your tapes ?");
    2384         if (bkpinfo->use_obdr) {
    2385             log_msg(4, "obdr mode = TRUE");
    2386         } else {
    2387             log_msg(4, "obdr mode = FALSE");
    2388         }
    23892075        if (archiving_to_media) {
    2390             if ((compression_type = which_compression_type()) == NULL) {
    2391                 log_to_screen("User has chosen not to backup the machine");
    2392                 finish(1);
    2393             }
    2394             if ((bkpinfo->compression_level = which_compression_level()) == -1) {
    2395                 log_to_screen("User has chosen not to backup the machine");
    2396                 finish(1);
     2076            bkpinfo->use_obdr = ask_me_yes_or_no("Do you want to activate OBDR support for your tapes ?");
     2077            if (bkpinfo->use_obdr) {
     2078                log_msg(4, "obdr mode = TRUE");
     2079            } else {
     2080                log_msg(4, "obdr mode = FALSE");
    23972081            }
    23982082        }
    23992083        break;
    2400 
    2401 
    24022084
    24032085    case netfs:
     
    24272109            // surrounding spaces and trailing '/' for this
    24282110            bkpinfo->netfs_mount = mr_strip_spaces(p);
    2429             if (!bkpinfo->restore_data) {
    2430                 if ((compression_type = which_compression_type()) == NULL) {
    2431                     log_to_screen("User has chosen not to backup the machine");
    2432                     finish(1);
    2433                 }
    2434 
    2435                 if ((bkpinfo->compression_level = which_compression_level()) == -1) {
    2436                     log_to_screen("User has chosen not to backup the machine");
    2437                     finish(1);
    2438                 }
    2439             }
    24402111            if (bkpinfo->netfs_mount[strlen(bkpinfo->netfs_mount) - 1] == '/')
    24412112                bkpinfo->netfs_mount[strlen(bkpinfo->netfs_mount) - 1] = '\0';
     
    25972268            }
    25982269            if (archiving_to_media) {
    2599                 if ((compression_type = which_compression_type()) == NULL) {
    2600                     log_to_screen("User has chosen not to backup the machine");
    2601                     finish(1);
    2602                 }
    2603                 if ((bkpinfo->compression_level = which_compression_level()) == -1) {
    2604                     log_to_screen("User has chosen not to backup the machine");
    2605                     finish(1);
    2606                 }
    26072270                sprintf(tmp1, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4482 MB
    26082271                if (!popup_and_get_string("ISO size.", "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s (700) or DVD's (4480) you plan to backup to.", tmp1, 16)) {
     
    27912454            mr_free(bkpinfo->zip_suffix);
    27922455        }
     2456        mr_free(compression_type);
     2457
    27932458#if __FreeBSD__ == 5
    27942459        mr_asprintf(bkpinfo->kernel_path, "%s", "/boot/kernel/kernel");
     
    28162481        bkpinfo->restore_data = TRUE;   // probably...
    28172482    }
    2818     mr_free(compression_type);
    28192483
    28202484    if (bkpinfo->backup_media_type == iso
     
    29772641 * (and remain mounted after this function returns).
    29782642 */
    2979 int what_number_cd_is_this()
    2980 {
     2643int what_number_cd_is_this(void) {
     2644
    29812645    int cd_number = -1;
    29822646    char *mountdev = NULL;
     
    29912655        cd_number = atoi(last_line_of_file(mountdev));
    29922656        mr_free(mountdev);
    2993 
    29942657        return (cd_number);
    29952658    }
    29962659
    2997     if (bkpinfo->media_device == NULL) {
    2998         log_it("ERROR: bkpinfo->media_device shoulnd't be empty here\n");
    2999         return(0);
    3000     }
    3001     mr_asprintf(mountdev, "%s", bkpinfo->media_device);
    3002     if (!mountdev[0]) {
    3003         log_it("(what_number_cd_is_this) Warning - media_device unknown. Finding out...");
    3004         find_cdrom_device(bkpinfo->media_device, FALSE);
    3005     }
    3006     if (!is_this_device_mounted(MNT_CDROM)) {
    3007         if (bkpinfo->backup_media_type == usb) {
    3008             mount_USB_here(mountdev, MNT_CDROM);
    3009         } else {
    3010             mount_CDROM_here(mountdev, MNT_CDROM);
    3011         }
    3012     }
    3013     mr_free(mountdev);
     2660    if ((bkpinfo->media_device == NULL) || !does_file_exist(bkpinfo->media_device)) {
     2661        log_it("ERROR: bkpinfo->media_device shoulnd't be unaccessible here\n");
     2662        /* trying again ! */
     2663        bkpinfo->media_device = find_optical_device();
     2664    }
     2665    if ((bkpinfo->media_device == NULL) || !does_file_exist(bkpinfo->media_device)) {
     2666        fatal_error("ERROR: bkpinfo->media_device shoulnd't really be unaccessible here\n");
     2667    }
     2668    if (!is_this_device_mounted(bkpinfo->media_device, MNT_CDROM)) {
     2669        mount_media(MNT_CDROM);
     2670    }
    30142671
    30152672    cd_number = atoi(last_line_of_file(MNT_CDROM "/archives/THIS-CD-NUMBER"));
    3016     return (cd_number);
     2673    return(cd_number);
    30172674}
    30182675
  • branches/3.3/mondo/src/common/mondostructures.h

    r3874 r3875  
    174174    cdr,                        ///< Back up to recordable CDs (do not erase them).
    175175    dvd,                        ///< Back up to DVD+R[W] or DVD-R[W] disks.
     176    // To be removed
    176177    cdstream,                   ///< Back up to recordable CDs but treat them like a tape streamer.
    177178    netfs,                      ///< Back up to an NETFS mount on the local subnet.
  • branches/3.3/mondo/src/mondoarchive/mondoarchive.c

    r3874 r3875  
    281281        g_loglevel = 10;
    282282        setup_newt_stuff();
    283         if ((tmp = find_cdrom_device()) == NULL) {
    284             printf("Failed to find CDR-RW drive\n");
    285         } else {
    286             printf("CD-RW is at %s\n", tmp);
     283        if ((tmp = find_optical_device()) == NULL) {
     284            printf("Failed to find optical drive\n");
     285        } else {
     286            printf("Optical drive is at %s\n", tmp);
    287287        }
    288288        mr_free(tmp);
     
    293293        g_loglevel = 10;
    294294        setup_newt_stuff();
    295         if (tmp = find_dvd_device()) {
     295        if (tmp = find_optical_device()) {
    296296            printf("Failed to find DVD drive\n");
    297297        } else {
  • branches/3.3/mondo/src/mondorestore/mondo-rstr-compare.c

    r3866 r3875  
    655655        mr_asprintf(bkpinfo->media_device, "%s", last_line_of_file("/tmp/CDROM-LIVES-HERE"));
    656656    } else {
    657         find_cdrom_device(bkpinfo->media_device, FALSE);
     657        bkpinfo->media_device = find_optical_device();
    658658    }
    659659    res = verify_tape_backups();
Note: See TracChangeset for help on using the changeset viewer.