Changeset 1687


Ignore:
Timestamp:
Oct 20, 2007, 2:47:12 PM (12 years ago)
Author:
bruno
Message:

First attempt to integrate USB support in mondoarchive (may not compile)

Location:
branches/2.2.5/mondo/src
Files:
5 edited

Legend:

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

    r1668 r1687  
    695695    char *tmp;
    696696    char *tmp1 = NULL;
     697    char *tmp2 = NULL;
    697698    char *scratchdir;
    698699    char *command;
     
    965966        strcpy(value, "dvd");
    966967        break;
     968    case usb:
     969        strcpy(value, "usb");
     970        break;
    967971    default:
    968972        fatal_error("Unknown backup_media_type");
    969973    }
     974    if (bkpinfo->backup_media_type == usb) {
     975           asprintf(&tmp2, "--usb %s", bkpinfo->media_device);
     976   } else {
     977           asprintf(&tmp2,"");
     978   }
     979-
     980
    970981    sprintf(tmp, "%s/BACKUP-MEDIA-TYPE", bkpinfo->tmpdir);
    971982    if (write_one_liner_data_file(tmp, value)) {
     
    102710386=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \
    1028103911=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/
    1029             "mindi --custom %s %s/images '%s' '%s' \
     1040            "mindi %s --custom %s %s/images '%s' '%s' \
    10301041'%s' %ld '%s' '%s' '%s' \
    1031 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", bkpinfo->tmpdir,  // parameter #2
     1042'%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", tmp2, bkpinfo->tmpdir,    // parameter #2
    10321043            bkpinfo->scratchdir,    // parameter #3
    10331044            bkpinfo->kernel_path,   // parameter #4
     
    13231334        closeout_tape();
    13241335    } else
    1325         /* write final ISO */
     1336        /* write final ISO/USB */
    13261337    {
    13271338        res = write_final_iso_if_necessary();
  • branches/2.2.5/mondo/src/common/libmondo-devices.c

    r1659 r1687  
    407407    case udev:
    408408        strcpy(output, "udev");
     409        break;
     410    case usb:
     411        strcpy(output, "usb");
    409412        break;
    410413    default:
     
    18671870    case cdrw:
    18681871    case dvd:
     1872    case usb:
    18691873        if (archiving_to_media) {
    1870             if (bkpinfo->backup_media_type != dvd) {
     1874            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    18711875                if (ask_me_yes_or_no
    18721876                    ("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?"))
     
    18931897                log_msg(1, "Setting to CD defaults");
    18941898            }
    1895             if (bkpinfo->backup_media_type != dvd) {
     1899            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    18961900                if (!popup_and_get_string("Speed", comment, tmp, 4)) {
    18971901                    log_to_screen("User has chosen not to backup the PC");
  • branches/2.2.5/mondo/src/common/libmondo-string.c

    r1645 r1687  
    11601160        strcpy(type_of_backup, "nfs");
    11611161        break;
     1162    case usb:
     1163        strcpy(type_of_backup, "USB");
     1164        break;
    11621165    default:
    11631166        strcpy(type_of_backup, "ISO");
  • branches/2.2.5/mondo/src/common/mondostructures.h

    r1295 r1687  
    189189    nfs,                        ///< Back up to an NFS mount on the local subnet.
    190190    tape,                       ///< Back up to tapes.
     191    usb,                        ///< Back up to USB devices.
    191192    udev                        ///< Back up to another unsupported device; just send a stream of bytes.
    192193} t_bkptype;
     
    328329   * The device we're backing up to.
    329330   * If backup_media_type is @b cdr, @b cdrw, or @b cdstream, this should be the SCSI node (e.g. 0,1,0).
    330    * If backup_media_type is @b dvd, @b tape, or @b udev, this should be a /dev entry.
     331   * If backup_media_type is @b dvd, @b tape, @b usb or @b udev, this should be a /dev entry.
    331332   * If backup_media_type is anything else, this should be blank.
    332333   */
  • branches/2.2.5/mondo/src/mondoarchive/mondo-cli.c

    r1659 r1687  
    551551    }
    552552
     553    if (flag_set['U'])          // USB
     554    {
     555        if (! flag_set['d']) {
     556            fatal_error
     557                ("You need to specify a device file with -d for bootable USB device creation");
     558        }
     559        if (!flag_set['s']) {
     560            fatal_error("You did not specify a size (-s) for your USB device. Aborting");
     561        }
     562    }
     563
    553564    if (flag_set['r'])          // DVD
    554565    {
     
    613624            }
    614625        }
    615     } else {                    /* CD size */
     626    } else {                    /* CD|USB size */
    616627        if (flag_set['s']) {
    617628            if (process_the_s_switch(flag_val['s'])) {
     
    663674    if (flag_set['w']) {
    664675        bkpinfo->backup_media_type = cdrw;
     676    }
     677    if (flag_set['U']) {
     678        bkpinfo->backup_media_type = usb;
    665679    }
    666680    if (flag_set['z']) {
     
    10271041    while ((opt =
    10281042            getopt(argc, argv,
    1029                    "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
     1043                   "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
    10301044           != -1) {
    10311045        if (opt == '?') {
Note: See TracChangeset for help on using the changeset viewer.