Changeset 3882 in MondoRescue


Ignore:
Timestamp:
Mar 10, 2024, 12:46:53 AM (3 months ago)
Author:
Bruno Cornec
Message:

More cleanup

  • Remove support for cd stream never really tested/useful/... (-C option removed for mondoarchive)
  • Remove dvdrecord specificities as obsolete
  • Remove types cdr and dvd to keep a single optical
  • Remove cdrw_speed param as obsolete now it's automatically detected
  • mondoarchive -c has no parameter anymore
  • Remove some useless global variables
  • Replaces some remaining /mnt/cdrom values by the define MNT_CDROM
Location:
branches/3.3/mondo/src
Files:
15 edited

Legend:

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

    r3881 r3882  
    3434#include <unistd.h>
    3535
    36 #define DVDRWFORMAT 1
    37 
    3836/**
    3937 * Maximum number of filesets allowed in this function.
     
    496494    if ((cd_dev = find_optical_device()) != NULL) {
    497495        if (!system("which cdrecord > /dev/null 2> /dev/null")) {
    498             mr_asprintf(cdrecord, "cdrecord dev=%s -atip", cd_dev);
    499         } else if (!system("which dvdrecord > /dev/null 2> /dev/null")) {
    500496            mr_asprintf(cdrecord, "cdrecord dev=%s -atip", cd_dev);
    501497        } else {
     
    759755                ("Serious error(s) occurred already. I shan't try to write to media.");
    760756        } else {
    761             res =
    762                 eval_call_to_make_ISO(bkpinfo->call_make_iso, bkpinfo->scratchdir, g_current_media_number, message_to_screen);
     757            res = eval_call_to_make_ISO(bkpinfo->call_make_iso, bkpinfo->scratchdir, g_current_media_number, message_to_screen);
    763758            if (res) {
    764759                log_to_screen("%s...failed to write", message_to_screen);
     
    773768            }
    774769            retval += res;
    775 #ifdef DVDRWFORMAT
    776             mr_asprintf(tmp, "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'", MONDO_LOGFILE);
    777             if (g_backup_media_type == dvd
    778                 && (res || !run_program_and_log_output(tmp, 1))) {
    779                 log_to_screen
    780                     ("Failed to write to disk. I shall blank it and then try again.");
    781                 sleep(5);
    782                 /* reset error counter before trying to blank DVD */
    783                 retval -= res;
    784                 sync();
    785                 pause_for_N_seconds(5, "Letting DVD drive settle");
    786 
    787 // dvd+rw-format --- OPTION 2
    788                 if (!bkpinfo->please_dont_eject) {
    789                     log_to_screen("Ejecting media to clear drive status.");
    790                     eject_device(bkpinfo->media_device);
    791                     inject_device(bkpinfo->media_device);
     770            if (bkpinfo->wipe_media_first) {
     771                mr_asprintf(tmp, "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'", MONDO_LOGFILE);
     772                if (g_backup_media_type == optical && (res || !run_program_and_log_output(tmp, 1))) {
     773                    log_to_screen("Failed to write to disk. I shall blank it and then try again.");
     774                    sleep(5);
     775                    /* reset error counter before trying to blank media */
     776                    retval -= res;
     777                    sync();
     778                    pause_for_N_seconds(5, "Letting DVD drive settle");
     779
     780                    if (!bkpinfo->please_dont_eject) {
     781                        log_to_screen("Ejecting media to clear drive status.");
     782                        eject_device(bkpinfo->media_device);
     783                        inject_device(bkpinfo->media_device);
     784                    }
     785                    pause_for_N_seconds(5, "Letting optical drive settle");
     786
     787                    // dvd+rw-format --- OPTION 2
     788                    if (bkpinfo->media_device) {
     789                        mr_asprintf(sz_blank_disk, "dvd+rw-format -force %s", bkpinfo->media_device);
     790                    } else {
     791                        mr_asprintf(sz_blank_disk, "dvd+rw-format");
     792                    }
     793                    log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
     794                    res = run_external_binary_with_percentage_indicator_NEW("Blanking optical disk", sz_blank_disk);
     795                    if (res) {
     796                        log_to_screen("Warning - format failed. (Was it a DVD-R?) Sleeping for 5 seconds to take a breath...");
     797                        pause_for_N_seconds(5, "Letting optical drive settle... and trying again.");
     798                        res = run_external_binary_with_percentage_indicator_NEW("Blanking optical disk", sz_blank_disk);
     799                        if (res) {
     800                            log_to_screen("Format failed a second time.");
     801                        }
     802                    } else {
     803                        log_to_screen
     804                            ("Format succeeded. Sleeping for 5 seconds to take a breath...");
     805                    }
     806                    mr_free(sz_blank_disk);
     807                    pause_for_N_seconds(5, "Letting optical drive settle");
     808                    if (!bkpinfo->please_dont_eject) {
     809                        log_to_screen("Ejecting media to clear drive status.");
     810                        eject_device(bkpinfo->media_device);
     811                        inject_device(bkpinfo->media_device);
     812                    }
     813                    pause_for_N_seconds(5, "Letting optical drive settle");
     814                    res = eval_call_to_make_ISO(bkpinfo->call_make_iso, bkpinfo->scratchdir, g_current_media_number, message_to_screen);
     815                    retval += res;
     816                    if (!bkpinfo->please_dont_eject) {
     817                        log_to_screen("Ejecting media.");
     818                        eject_device(bkpinfo->media_device);
     819                    }
     820                    if (res) {
     821                        log_to_screen("Dagnabbit. It still failed.");
     822                    } else {
     823                        log_to_screen
     824                            ("OK, this time I successfully backed up to DVD.");
     825                    }
    792826                }
    793                 pause_for_N_seconds(5, "Letting DVD drive settle");
    794                 if (bkpinfo->media_device) {
    795                     mr_asprintf(sz_blank_disk, "dvd+rw-format -force %s", bkpinfo->media_device);
    796                 } else {
    797                     mr_asprintf(sz_blank_disk, "dvd+rw-format");
    798                 }
    799                 log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
    800                 res = run_external_binary_with_percentage_indicator_NEW("Blanking DVD disk", sz_blank_disk);
    801                 if (res) {
    802                     log_to_screen("Warning - format failed. (Was it a DVD-R?) Sleeping for 5 seconds to take a breath...");
    803                     pause_for_N_seconds(5, "Letting DVD drive settle... and trying again.");
    804                     res = run_external_binary_with_percentage_indicator_NEW("Blanking DVD disk", sz_blank_disk);
    805                     if (res) {
    806                         log_to_screen("Format failed a second time.");
    807                     }
    808                 } else {
    809                     log_to_screen
    810                         ("Format succeeded. Sleeping for 5 seconds to take a breath...");
    811                 }
    812                 mr_free(sz_blank_disk);
    813                 pause_for_N_seconds(5, "Letting DVD drive settle");
    814                 if (!bkpinfo->please_dont_eject) {
    815                     log_to_screen("Ejecting media to clear drive status.");
    816                     eject_device(bkpinfo->media_device);
    817                     inject_device(bkpinfo->media_device);
    818                 }
    819                 pause_for_N_seconds(5, "Letting DVD drive settle");
    820                 res = eval_call_to_make_ISO(bkpinfo->call_make_iso, bkpinfo->scratchdir, g_current_media_number, message_to_screen);
    821                 retval += res;
    822                 if (!bkpinfo->please_dont_eject) {
    823                     log_to_screen("Ejecting media.");
    824                     eject_device(bkpinfo->media_device);
    825                 }
    826                 if (res) {
    827                     log_to_screen("Dagnabbit. It still failed.");
    828                 } else {
    829                     log_to_screen
    830                         ("OK, this time I successfully backed up to DVD.");
    831                 }
    832             }
    833             mr_free(tmp);
    834 #endif
    835             if (g_backup_media_type == dvd && !bkpinfo->please_dont_eject) {
     827                mr_free(tmp);
     828            }
     829            if (g_backup_media_type == optical && !bkpinfo->please_dont_eject) {
    836830                eject_device(bkpinfo->media_device);
    837831            }
     
    12211215    log_msg(1, "Closing tape/CD/USB ... ");
    12221216    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    1223         /* write tape/cdstream */
     1217        /* write tape */
    12241218        closeout_tape();
    12251219    } else {
     
    24942488 * @param bkpinfo The backup information structure. Fields used:
    24952489 * - @c backup_media_type
    2496  * - @c cdrw_speed
    24972490 * - @c prefix
    24982491 * - @c isodir
     
    25312524    mvaddstr_and_log_it(g_currentY, 0, "Preparing to archive your data");
    25322525    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2533         if (bkpinfo->backup_media_type == cdstream) {
    2534             openout_cdstream(bkpinfo->media_device, bkpinfo->cdrw_speed);
    2535         } else {
    2536             openout_tape(); /* sets g_tape_stream */
    2537         }
     2526        openout_tape(); /* sets g_tape_stream */
    25382527        if (!g_tape_stream) {
    25392528            fatal_error("Cannot open backup (streaming) device");
     
    25452534            log_msg(1, "Backing up to USB's");
    25462535        } else {
    2547             log_msg(1, "Backing up to CD's");
     2536            log_msg(1, "Backing up to optical drive's");
    25482537        }
    25492538    }
     
    28502839    case optical:
    28512840        mr_asprintf(value, "optical");
    2852         break;
    2853     case cdstream:
    2854         mr_asprintf(value, "cdstream");
    28552841        break;
    28562842    case tape:
     
    30773063    assert(bkpinfo != NULL);
    30783064
    3079     if (bkpinfo->backup_media_type == dvd) {
    3080 #ifdef DVDRWFORMAT
    3081         if ((tmp = find_home_of_exe("dvd+rw-format")) == NULL) {
     3065    if (bkpinfo->backup_media_type == optical) {
     3066        if (bkpinfo->wipe_media_first) {
     3067            if ((tmp = find_home_of_exe("dvd+rw-format")) == NULL) {
     3068                mr_free(tmp);
     3069                fatal_error("Cannot find dvd+rw-format. Please install it or fix your PATH.");
     3070            }
    30823071            mr_free(tmp);
    3083             fatal_error("Cannot find dvd+rw-format. Please install it or fix your PATH.");
    3084         }
    3085         mr_free(tmp);
    3086 #endif
     3072        }
    30873073        if ((tmp = find_home_of_exe("growisofs")) == NULL) {
    30883074            mr_free(tmp);
     
    31583144            // FIXME
    31593145        }
    3160         mvaddstr_and_log_it(g_currentY, 0,
    3161                             "Verifying archives against live filesystem");
    3162         if (bkpinfo->backup_media_type == cdstream) {
    3163             strcpy(bkpinfo->media_device, "/dev/cdrom");
    3164         }
     3146        mvaddstr_and_log_it(g_currentY, 0, "Verifying archives against live filesystem");
    31653147        verify_tape_backups();
    31663148        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
  • branches/3.3/mondo/src/common/libmondo-cli.c

    r3881 r3882  
    310310    }
    311311
    312     if (g_kernel_version >= 2.6 && !flag_set['d'] && flag_set['c'] && (! bkpinfo->restore_data)) {
    313         fatal_error("If you are using the 2.6.x kernel, please specify the CD-R(W) device.");
    314     }
    315 
    316 
    317312    if (flag_set['J']) {
    318313        if (flag_set['I']) {
     
    325320
    326321    if (flag_set['c'] && (! bkpinfo->restore_data)) {
    327         if (system("which cdrecord > /dev/null 2> /dev/null") && system("which dvdrecord > /dev/null 2> /dev/null")) {
    328             fatal_error("Please install dvdrecord/cdrecord and try again.");
    329         } else {
    330             log_msg(3, "flag_val['c'] = %s", flag_val['c']);
    331             if (flag_set['c']) {
    332                 bkpinfo->cdrw_speed = atoi(flag_val['c']);
    333             }
     322        if (system("which cdrecord > /dev/null 2> /dev/null")) {
     323            fatal_error("Please install cdrecord and try again.");
    334324        }
    335325        if (!flag_set['d']) {
     
    516506    if (flag_set['c']) {
    517507        bkpinfo->backup_media_type = optical;
    518     }
    519     if (flag_set['C']) {
    520         bkpinfo->backup_media_type = cdstream;
    521508    }
    522509    if (flag_set['i']) {
     
    707694    }
    708695
    709     if (!flag_set['d'] && (flag_set['c'] || flag_set['C'])) {
    710             tmp1 = mr_popup_and_get_string("Device", "Please specify the device", bkpinfo->media_device);
    711             if (tmp1 == NULL) {
    712                 retval++;
    713                 log_to_screen("User opted to cancel.");
    714             } else {
    715                 mr_free(bkpinfo->media_device);
    716                 bkpinfo->media_device = tmp1;
    717             }
     696    if (!flag_set['d'] && flag_set['c']) {
     697        tmp1 = mr_popup_and_get_string("Device", "Please specify the device", bkpinfo->media_device);
     698        if (tmp1 == NULL) {
     699            retval++;
     700            log_to_screen("User opted to cancel.");
    718701        } else {
    719     }
    720 
    721     if ((!flag_set['d'] && !flag_set['n'] && !flag_set['C']) && (! bkpinfo->restore_data)) {
     702            mr_free(bkpinfo->media_device);
     703            bkpinfo->media_device = tmp1;
     704        }
     705    }
     706
     707    if ((!flag_set['d'] && !flag_set['n']) && (! bkpinfo->restore_data)) {
    722708        retval++;
    723709        log_to_screen("Please specify the backup device/directory.\n");
  • branches/3.3/mondo/src/common/libmondo-devices.c

    r3881 r3882  
    715715        mr_asprintf(output, "%s", "optical");
    716716        break;
    717     case cdstream:
    718         mr_asprintf(output, "%s", "cdstream");
    719         break;
    720717    case netfs:
    721718        mr_asprintf(output, "%s", "netfs");
     
    20582055        }
    20592056
    2060         bkpinfo->compression_level = (bkpinfo->backup_media_type == cdstream) ? 1 : 5;
     2057        bkpinfo->compression_level = 5;
    20612058        if ((bkpinfo->compression_level = which_compression_level()) == -1) {
    20622059            log_to_screen("User has chosen not to backup the machine");
    20632060            finish(1);
    20642061        }
    2065         bkpinfo->cdrw_speed = (bkpinfo->backup_media_type == cdstream) ? 2 : 4;
    2066         bkpinfo->use_lzo = (bkpinfo->backup_media_type == cdstream) ? TRUE : FALSE;
     2062        bkpinfo->use_lzo = FALSE;
    20672063    }
    20682064    mvaddstr_and_log_it(2, 0, " ");
     
    20962092
    20972093        if (archiving_to_media) {
    2098             if (bkpinfo->backup_media_type == dvd) {
    2099                 strcpy(tmp1, "1");
     2094            if (bkpinfo->backup_media_type == optical) {
    21002095                mr_asprintf(sz_size, "%d", DEFAULT_DVD_DISK_SIZE);  // 4.7 salesman's GB = 4.482 real GB = 4482 MB
    2101                 log_msg(1, "Setting to DVD defaults");
     2096                log_msg(1, "Setting to DVD defaults ~4.4GB");
    21022097            } else {
    2103                 strcpy(tmp1, "4");
    2104                 mr_asprintf(sz_size, "%d", 650);
    2105                 log_msg(1, "Setting to CD defaults");
    2106             }
    2107 
    2108             mr_asprintf(comment, "What speed is your %s writer?", mds);
    2109             if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    2110                 if (!popup_and_get_string("Speed", comment, tmp1, 4)) {
    2111                     log_to_screen("User has chosen not to backup the machine");
    2112                     mr_free(comment);
    2113                     finish(1);
    2114                 }
    2115             }
    2116             mr_free(comment);
    2117             bkpinfo->cdrw_speed = atoi(tmp1);   // if DVD then this shouldn't ever be used anyway :)
    2118 
    2119             strcpy(tmp1, sz_size);
     2098                mr_asprintf(sz_size, "%d", 0);  // No value for USB
     2099            }
     2100
    21202101            mr_asprintf(comment, "How much data (in Megabytes) will each %s store?", mds);
    2121             if (!popup_and_get_string("Size", comment, tmp1, 5)) {
     2102            tmp1 = popup_and_get_string("Size", comment, sz_size, 5)) {
     2103            if (!tmp1) {
    21222104                log_to_screen("User has chosen not to backup the machine");
    21232105                finish(1);
    2124             }
    2125             mr_asprintf(sz_size, "%s", tmp1);
    2126             bkpinfo->media_size = atoi(sz_size);
    2127 
     2106            } else {
     2107                bkpinfo->media_size = atoi(tmp1);
     2108            }
     2109            mr_free(tmp1);
    21282110            if (bkpinfo->media_size <= 0) {
    21292111                log_to_screen("User has chosen not to backup the machine");
     
    21312113            }
    21322114        }
    2133         /* No break because we continue even for usb */
    2134     case cdstream:
    21352115
    21362116        // If media_device not found ask
     
    21662146        }
    21672147        mr_free(mds);
    2168 
    2169         if (bkpinfo->backup_media_type == cdstream) {
    2170             bkpinfo->media_size = 650;
    2171         }
    21722148        break;
     2149
    21732150    case udev:
    21742151        if (!ask_me_yes_or_no
  • branches/3.3/mondo/src/common/libmondo-stream-EXT.h

    r3870 r3882  
    1010extern int maintain_collection_of_recent_archives(char *td,
    1111                                                  char *latest_fname);
    12 extern int openin_cdstream();
    1312extern int openin_tape();
    14 extern int openout_cdstream(char *cddev, int speed);
    1513extern int openout_tape();
    1614extern int read_file_from_stream_to_file(
     
    3836extern int write_header_block_to_stream(off_t length_of_incoming_file, const char *filename, int control_char);
    3937extern void wrong_marker(int should_be, int it_is);
    40 extern int closein_cdstream();
    4138extern int read_EXAT_files_from_tape(
    4239                                     long long *ptmp_size, char *tmp_fname,
  • branches/3.3/mondo/src/common/libmondo-stream.c

    r3879 r3882  
    5353/**
    5454 * The file pointer for the opened tape/CD stream.
    55  * Opened and closed by openin_tape(), openin_cdstream(),
    56  * openout_tape(), openout_cdstream(), closein_tape(), closein_cdstream(),
    57  * closeout_tape(), and closeout_cdstream().
     55 * Opened and closed by openin_tape(),
     56 * openout_tape(), closein_tape(),
     57 * closeout_tape().
    5858 */
    5959FILE *g_tape_stream = NULL;
     
    165165 * @return 0 for success, nonzero for failure.
    166166 * @note This should be called by restore processes only.
    167  * @note This function also works for cdstreams for now, but don't count on this behavior.
    168167 * @bug @p bkpinfo parameter is unused.
    169168 */
     
    217216
    218217
    219 
    220 /**
    221  * Close the global output file descriptor which Mondo has used to read
    222  * from the CD stream.
    223  * @param bkpinfo The backup information structure. Passed directly to closein_tape().
    224  * @return 0 for success, nonzero for failure.
    225  * @note This should be called by restore processes only.
    226  */
    227 int closein_cdstream()
    228 {
    229     return (closein_tape());
    230 }
    231218
    232219/**
     
    343330    log_it("New tape requested.");
    344331    insist_on_this_tape_number(g_current_media_number + 1); // will increment g_current_media, too
    345     if (bkpinfo->backup_media_type == cdstream) {
    346         mr_asprintf(command, "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s", bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE, MONDO_LOGFILE);
    347         log_it("Opening OUT to next CD with the command");
    348         log_it(command);
    349         log_it("Let's see what happens, shall we?");
    350         g_tape_stream = popen(command, "w");
    351         mr_free(command);
    352 
    353         if (!g_tape_stream) {
    354             log_to_screen("Failed to openout to cdstream (fifo)");
    355             return (1);
    356         }
    357     } else {
    358         log_it("Opening OUT to next tape");
    359         if (!(g_tape_stream = open_device_via_buffer(bkpinfo->media_device, 'w', bkpinfo->internal_tape_block_size))) {
    360             log_OS_error(g_tape_fifo);
    361             log_to_screen("Cannot openin stream device");
    362             return (1);
    363         }
     332    log_it("Opening OUT to next tape");
     333    if (!(g_tape_stream = open_device_via_buffer(bkpinfo->media_device, 'w', bkpinfo->internal_tape_block_size))) {
     334        log_OS_error(g_tape_fifo);
     335        log_to_screen("Cannot openin stream device");
     336        return (1);
    364337    }
    365338    g_tape_posK = 0;
     
    12411214 * - @c bkpinfo->tmpdir
    12421215 * @return 0 for success, nonzero for failure.
    1243  * @note This will also work with a cdstream for now, but don't count on this behavior.
    12441216 */
    12451217int openin_tape()
     
    13721344
    13731345/**
    1374  * Open the CD stream for input.
    1375  * @param bkpinfo The backup information structure. Passed to openin_tape().
    1376  * @return 0 for success, nonzero for failure.
    1377  * @note Equivalent to openin_tape() for now, but don't count on this behavior.
    1378  */
    1379 int openin_cdstream()
    1380 {
    1381     return (openin_tape());
    1382 }
    1383 
    1384 /**
    13851346 * Return the non-rewinding device when passed the normal one
    13861347 * @param tapedev The tape device to open for writing.
     
    14811442
    14821443    return(res);
    1483 }
    1484 
    1485 
    1486 /**
    1487  * Start writing to a CD stream.
    1488  * @param cddev The CD device to openout via cdrecord.
    1489  * @param speed The speed to write at.
    1490  * @return 0 for success, nonzero for failure.
    1491  * @note This should be called only from backup processes.
    1492  */
    1493 int openout_cdstream(char *cddev, int speed)
    1494 {
    1495     /*@ buffers ***************************************************** */
    1496     char *command = NULL;
    1497 
    1498     /*@ end vars *************************************************** */
    1499 
    1500     if (cddev == NULL) {
    1501         log_to_screen("Failed to openout NULL cddev");
    1502         return (1);
    1503     }
    1504     /*  add 'dummy' if testing */
    1505     mr_asprintf(command, "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s", cddev, speed, MONDO_LOGFILE, MONDO_LOGFILE);
    1506     /*  initialise the catalog */
    1507     g_current_media_number = 1;
    1508     if (!(g_tapecatalog = malloc(sizeof(struct s_tapecatalog)))) {
    1509         fatal_error("Cannot alloc mem for tape catalog");
    1510     }
    1511     g_tapecatalog->entries = 0;
    1512     /* log stuff */
    1513     log_it("Opening OUT cdstream with the command");
    1514     log_it(command);
    1515     /*  log_it("Let's see what happens, shall we?"); */
    1516     g_tape_stream = popen(command, "w");
    1517     mr_free(command);
    1518 
    1519     if (g_tape_stream) {
    1520         return (0);
    1521     } else {
    1522         log_to_screen("Failed to openout to cdstream (fifo)");
    1523         return (1);
    1524     }
    15251444}
    15261445
  • branches/3.3/mondo/src/common/libmondo-string.c

    r3881 r3882  
    982982        mr_asprintf(type_of_backup, "tape");
    983983        break;
    984     case cdstream:
    985         mr_asprintf(type_of_backup, "CDR");
    986         break;
    987984    case udev:
    988985        mr_asprintf(type_of_backup, "udev");
  • branches/3.3/mondo/src/common/libmondo-tools.c

    r3881 r3882  
    344344 * - Used: @c bkpinfo->backup_data
    345345 * - Used: @c bkpinfo->backup_media_type
    346  * - Used: @c bkpinfo->cdrw_speed
    347346 * - Used: @c bkpinfo->compression_level
    348347 * - Used: @c bkpinfo->include_paths
     
    434433    }
    435434
    436 // DVD
    437 
    438     if (bkpinfo->backup_media_type == dvd) {
     435    if (bkpinfo->backup_media_type == optical) {
    439436        if ((cdr_exe = find_home_of_exe("growisofs")) == NULL) {
    440437            fatal_error("Please install growisofs.");
     
    493490        if ((cdr_exe = find_home_of_exe("cdrecord")) == NULL) {
    494491            if ((cdr_exe = find_home_of_exe("wodim")) == NULL) {
    495                 if ((cdr_exe = find_home_of_exe("dvdrecord")) == NULL) {
    496                     fatal_error("Please install either cdrecord, wodim or dvdrecord.");
    497                 }
     492                fatal_error("Please install either cdrecord or wodim.");
    498493            }
    499494        }
     
    543538            }
    544539            log_it("bkpinfo->call_before_iso = %s", bkpinfo->call_before_iso);
    545             mr_asprintf(bkpinfo->call_make_iso, "%s %s -v %s fs=4m dev=%s speed=%d %s/"MONDO_TMPISOS, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device, bkpinfo->cdrw_speed, bkpinfo->tmpdir);
     540            mr_asprintf(bkpinfo->call_make_iso, "%s %s -v %s fs=4m dev=%s %s/"MONDO_TMPISOS, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device, bkpinfo->tmpdir);
    546541        } else {
    547             mr_asprintf(bkpinfo->call_make_iso, "%s . 2>> _ERR_ | %s %s %s fs=4m dev=%s speed=%d -", mondo_mkisofs_sz, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device, bkpinfo->cdrw_speed);
     542            mr_asprintf(bkpinfo->call_make_iso, "%s . 2>> _ERR_ | %s %s %s fs=4m dev=%s -", mondo_mkisofs_sz, cdr_exe, (bkpinfo->please_dont_eject) ? " " : "-eject", extra_cdrom_params, bkpinfo->media_device);
    548543        }
    549544        mr_free(cdr_exe);
     
    994989    bkpinfo->differential = 0;
    995990    bkpinfo->please_dont_eject = FALSE;
    996     bkpinfo->cdrw_speed = 0;
    997991    bkpinfo->manual_cd_tray = FALSE;
    998992    bkpinfo->nonbootable_backup = FALSE;
  • branches/3.3/mondo/src/common/mondostructures.h

    r3881 r3882  
    611611   */
    612612    bool please_dont_eject;
    613 
    614   /**
    615    * The speed of the CD-R[W] drive.
    616    */
    617     int cdrw_speed;
    618613
    619614  /**
  • branches/3.3/mondo/src/common/newt-specific.c

    r3881 r3882  
    12261226 * Ask the user which backup media type they would like to use.
    12271227 * The choices are @p none (exit to shell), @c optical,
    1228  * @c tape, @c cdstream, @c udev (only when @p g_text_mode is TRUE), @c netfs,
     1228 * @c tape, @c udev (only when @p g_text_mode is TRUE), @c netfs,
    12291229 * and @c iso.
    12301230 * @param restoring TRUE if we're restoring, FALSE if we're backing up.
     
    12401240        char *title_sz = NULL;
    12411241        char *minimsg_sz = NULL;
    1242         static t_bkptype possible_bkptypes[] = { none, optical, tape, cdstream, udev, netfs, iso };
    1243         static char *possible_responses[] = { "none", "optical", "tape", "cdstream", "udev", "netfs", "iso", NULL };
     1242        static t_bkptype possible_bkptypes[] = { none, optical, tape, udev, netfs, iso };
     1243        static char *possible_responses[] = { "none", "optical", "tape", "udev", "netfs", "iso", NULL };
    12441244        char *outstr = NULL;
    12451245        char *instr = NULL;
  • branches/3.3/mondo/src/include/my-stuff.h

    r3879 r3882  
    170170 * Determine whether @p x (t_bkptype) is a streaming backup.
    171171 */
    172 #define IS_THIS_A_STREAMING_BACKUP(x) (x == tape || x == udev || x == cdstream)
     172#define IS_THIS_A_STREAMING_BACKUP(x) (x == tape || x == udev)
    173173
    174174
  • branches/3.3/mondo/src/mondoarchive/mondoarchive.c

    r3879 r3882  
    3333extern bool g_text_mode;
    3434extern char *g_boot_mountpt;
    35 extern char *g_cd_drive_is_here;
    36 static char *g_cdrom_drive_is_here = NULL;
    37 static char *g_dvd_drive_is_here = NULL;
    3835extern double g_kernel_version;
    3936
     
    430427    free_libmondo_global_strings();
    431428   
    432 
    433     if (!g_cdrom_drive_is_here) {
    434         log_msg(10, "FYI, g_cdrom_drive_is_here was never used");
    435     }
    436     if (!g_dvd_drive_is_here) {
    437         log_msg(10, "FYI, g_dvd_drive_is_here was never used");
    438     }
    439 
    440429    /* finalize log file with time stamp */
    441430    log_msg(0, "Time finished: %s", mr_date());
  • branches/3.3/mondo/src/mondorestore/mondo-rstr-compare-EXT.h

    r1647 r3882  
    33
    44extern int compare_to_CD();
    5 extern int compare_to_cdstream();
    65extern int compare_to_tape();
    76extern int compare_mode(struct mountlist_itself *mountlist,
  • branches/3.3/mondo/src/mondorestore/mondo-rstr-compare.c

    r3879 r3882  
    555555
    556556/**
    557  * Compare all data on a cdstream-based backup.
    558  * @param bkpinfo The backup information structure. Fields used:
    559  * - @c bkpinfo->disaster_recovery
    560  * - @c bkpinfo->media_device
    561  * - @c bkpinfo->restore_path
    562  * @return 0 for success, nonzero for failure.
    563  */
    564 int compare_to_cdstream()
    565 {
    566     int res;
    567 
    568   /** needs malloc **/
    569     char *dir;
    570     char *command = NULL;
    571 
    572     assert(bkpinfo != NULL);
    573     malloc_string(dir);
    574     if (getcwd(dir, MAX_STR_LEN)) {
    575         // FIXME
    576     }
    577     if (chdir(bkpinfo->restore_path)) {
    578         // FIXME
    579     }
    580 
    581     mr_asprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp", bkpinfo->restore_path);
    582     run_program_and_log_output(command, FALSE);
    583     mr_free(command);
    584     mvaddstr_and_log_it(g_currentY, 0, "Verifying archives against filesystem");
    585 
    586     if (bkpinfo->disaster_recovery
    587         && does_file_exist("/tmp/CDROM-LIVES-HERE")) {
    588         mr_asprintf(bkpinfo->media_device, "%s", last_line_of_file("/tmp/CDROM-LIVES-HERE"));
    589     } else {
    590         bkpinfo->media_device = find_optical_device();
    591     }
    592     res = verify_tape_backups();
    593     if (chdir(dir)) {
    594         // FIXME
    595     }
    596     if (length_of_file(MONDO_CACHE"/changed.txt") > 2
    597         && length_of_file(MONDO_CACHE"/changed.files") > 2) {
    598         log_msg(0,
    599                 "Type 'less "MONDO_CACHE"/changed.files' to see which files don't match the archives");
    600         log_msg(2, "Calling popup_changelist_from_file()");
    601         popup_changelist_from_file(MONDO_CACHE"/changed.files");
    602         log_msg(2, "Returned from popup_changelist_from_file()");
    603     }
    604 
    605     mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    606     paranoid_free(dir);
    607     return (res);
    608 }
    609 
    610 /**************************************************************************
    611  *END_COMPARE_CD_STREAM                                                   *
    612  **************************************************************************/
    613 
    614 
    615 
    616 /**
    617557 * Compare all data in the user's backup.
    618558 * This function will mount filesystems, compare afioballs and biggiefiles,
     
    682622        || bkpinfo->backup_media_type == udev) {
    683623        retval += compare_to_tape();
    684     } else if (bkpinfo->backup_media_type == cdstream) {
    685         retval += compare_to_cdstream();
    686624    } else {
    687625        retval += compare_to_CD();
  • branches/3.3/mondo/src/mondorestore/mondo-rstr-tools.c

    r3881 r3882  
    940940
    941941if (0 == read_cfg_var(cfg_file, "backup-media-type", value)) {
    942     if (!strcmp(value, "cdstream")) {
    943         bkpinfo->backup_media_type = cdstream;
    944     } else if (!strcmp(value, "optical")) {
     942    if (!strcmp(value, "optical")) {
    945943        bkpinfo->backup_media_type = optical;
    946944    } else if (!strcmp(value, "usb")) {
     
    10081006
    10091007if (bkpinfo->disaster_recovery) {
    1010     if (bkpinfo->backup_media_type == cdstream) {
    1011         mr_asprintf(bkpinfo->media_device, "%s", "/dev/cdrom");
    1012         bkpinfo->media_size = 650;  /* good guess */
    1013     } else if (bkpinfo->backup_media_type == usb) {
     1008    if (bkpinfo->backup_media_type == usb) {
    10141009        envtmp1 = getenv("MRUSBDEV");
    10151010        if (envtmp1 == NULL) {
  • branches/3.3/mondo/src/mondorestore/mondorestore.c

    r3879 r3882  
    673673/**
    674674 * Restore @p tarball_fname from CD.
    675  * @param tarball_fname The filename of the tarball to restore (in /mnt/cdrom).
     675 * @param tarball_fname The filename of the tarball to restore (in MNT_CDROM).
    676676 * This will be used unmodified.
    677677 * @param current_tarball_number The number (starting from 0) of the fileset
     
    18001800        mvaddstr_and_log_it(g_currentY++, 0,
    18011801                            "Restoring OS and data from streaming media");
    1802         if (bkpinfo->backup_media_type == cdstream) {
    1803             openin_cdstream();
    1804         } else {
    1805             assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device);
    1806             openin_tape();
    1807         }
     1802        assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device);
     1803        openin_tape();
    18081804        resA = restore_all_tarballs_from_stream(filelist);
    18091805        resB = restore_all_biggiefiles_from_stream(filelist);
    1810         if (bkpinfo->backup_media_type == cdstream) {
    1811             closein_cdstream();
    1812         } else {
    1813             closein_tape();
    1814         }
     1806        closein_tape();
    18151807    } else {
    18161808        mount_media(MNT_CDROM);
     
    23322324    } else {
    23332325        popup_and_OK("No restoring or comparing will take place today.");
    2334         if (is_this_device_mounted("/mnt/cdrom")) {
    2335             run_program_and_log_output("umount -d /mnt/cdrom", FALSE);
     2326        if (is_this_device_mounted(MNT_CDROM)) {
     2327            run_program_and_log_output("umount -d "MNT_CDROM, FALSE);
    23362328        }
    23372329        if (g_ISO_restore_mode) {
     
    29192911
    29202912            if (!bkpinfo->please_dont_eject) {
    2921                 (void)eject_device("/dev/cdrom");
    2922             }
    2923             mvaddstr_and_log_it(g_currentY++,
    2924                                 0,
    2925                                 "Run complete. Please remove media and reboot.");
     2913                (void)eject_device(bkpinfo->backup_media_type);
     2914            }
     2915            mvaddstr_and_log_it(g_currentY++, 0, "Run complete. Please remove media and reboot.");
    29262916        }
    29272917    }
Note: See TracChangeset for help on using the changeset viewer.