Changeset 1574 for branches/stable


Ignore:
Timestamp:
Jul 26, 2007, 12:34:42 PM (12 years ago)
Author:
bruno
Message:

More improvements on tape patch (/dev/st0 has to be the default)

Location:
branches/stable/mondo/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1569 r1574  
    14431443    char *prompt = NULL;
    14441444    int i = 0;
     1445    int res = 0;
    14451446    FILE *fin = NULL;
    14461447
     
    16081609    case tape:
    16091610
    1610         if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) {
     1611        res = find_tape_device_and_size(bkpinfo->media_device, sz_size);
     1612        if ((res != 0) && (! bkpinfo->media_device[0])) {
    16111613            mr_msg(3, "Ok, using vanilla scsi tape.");
    16121614            strcpy(bkpinfo->media_device, VANILLA_SCSI_TAPE);
     
    16141616                paranoid_fclose(fin);
    16151617            } else {
    1616                 strcpy(bkpinfo->media_device, "/dev/osst0");
     1618                mr_msg(2, "Don't know what your tape device is :-(");
    16171619            }
    16181620        }
     
    16301632                    bkpinfo->media_device);
    16311633            if (!ask_me_yes_or_no(tmp)) {
    1632                 bkpinfo->media_device[0] = '\0';
    16331634                if (!popup_and_get_string
    16341635                    ("Device name?",
  • branches/stable/mondo/src/common/libmondo-stream.c

    r1569 r1574  
    290290    if (atoi(tmp) != 1) {
    291291        log_it("Either too few or too many tape streamers for me to detect...");
    292         log_it("Taking %s",VANILLA_SCSI_TAPE);
    293         strcpy(dev, VANILLA_SCSI_TAPE);
    294292        return 1;
    295293    }
     
    311309    strcpy(dev, VANILLA_SCSI_TAPE);
    312310    dev[strlen(dev) - 1] = '\0';
     311    dev[strlen(dev) - 2] = '\0';
    313312    strcat(dev, tmp);           // e.g. '/dev/st0' becomes '/dev/stN'
    314313    res = 0;
     
    319318            strcpy(dev, "/dev/osst0");
    320319            if (!mt_says_tape_exists(dev)) {
     320                // Stay with VANILLA_SCSI_TAPE
     321                strcpy(dev, VANILLA_SCSI_TAPE);
    321322                res++;
    322323            } else {
     
    332333grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | \
    333334awk '{for(i=1; i<NF; i++) { if (index($i, \"GB\")>0) { print $i;};};};'"));
    334 
    335     if (mt_says_tape_exists(dev)) {
    336         res = 0;
    337     } else {
    338         log_it("Turning %s", dev);
    339         strcpy(tmp, (strrchr(dev, '/') != NULL) ? strrchr(dev, '/') : dev);
    340         sprintf(dev, "/dev/os%s", tmp);
    341         log_it("...into %s", dev);
    342         if (mt_says_tape_exists(dev)) {
    343             res = 0;
    344         } else {
    345             res++;
    346         }
    347     }
    348335
    349336    siz[0] = '\0';
  • branches/stable/mondo/src/include/my-stuff.h

    r1559 r1574  
    297297#else
    298298#define VANILLA_SCSI_CDROM  "/dev/scd0"
    299 #define VANILLA_SCSI_TAPE   "/dev/st"
     299#define VANILLA_SCSI_TAPE   "/dev/st0"
    300300#define VANILLA_USB_DEVICE  "/dev/sda"
    301301#define DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE  "/dev/md"
    302302#define RAID_DEVICE_STUB    DONT_KNOW_HOW_TO_EVALUATE_THIS_DEVICE_TYPE
    303303#define SANE_FORMATS        "swap image vfat ext2 ext3 xfs vfs jfs reiserfs dos minix coda nfs ntfs hpfs raid lvm cifs"
    304 #define ALT_TAPE        "/dev/ht"
     304#define ALT_TAPE        "/dev/ht0"
    305305#define MKE2FS_OR_NEWFS "mke2fs"
    306306#define CP_BIN      "cp"
Note: See TracChangeset for help on using the changeset viewer.