Changeset 2769 in MondoRescue


Ignore:
Timestamp:
Apr 21, 2011, 1:48:52 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Introduce a new bkpinfo member (subdir) to support storing the subdir under which ISO images are stored on an external HDD. Should fix mostly #433.
Location:
branches/2.2.9/mondo/src
Files:
7 edited

Legend:

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

    r2745 r2769  
    13551355{
    13561356char *mount_cmd;
     1357char *mountdir = NULL;
    13571358int i, res;
    13581359#ifdef __FreeBSD__
     
    13971398
    13981399    } else if (bkpinfo->backup_media_type == iso) {
     1400        if (bkpinfo->subdir) {
     1401            mr_asprintf(&mountdir, "%s/%s", bkpinfo->isodir, bkpinfo->subdir);
     1402        } else {
     1403            mr_asprintf(&mountdir, "%s", bkpinfo->isodir);
     1404        }
    13991405#ifdef __FreeBSD__
    1400         sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir,
     1406        sprintf(mount_cmd, "%s/%s-%d.iso", mountdir,
    14011407            bkpinfo->prefix, g_current_media_number);
    14021408        mddev = make_vn(mount_cmd);
     
    14041410#else
    14051411        sprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s",
    1406             bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1412            mountdir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    14071413#endif
    14081414    } else if (bkpinfo->backup_media_type == usb) {
  • branches/2.2.9/mondo/src/common/libmondo-tools.c

    r2751 r2769  
    799799    bkpinfo->netfs_remote_dir[0] = '\0';
    800800    bkpinfo->exclude_paths = NULL;
     801    bkpinfo->subdir = NULL;
    801802    bkpinfo->postnuke_tarball[0] = '\0';
    802803    bkpinfo->wipe_media_first = FALSE;
  • branches/2.2.9/mondo/src/common/mondostructures.h

    r2697 r2769  
    581581   */
    582582    char *netfs_user;
     583
     584  /**
     585   * The potential subdirectory under which are located ISO images on HDD (restore mode only)
     586   */
     587    char *subdir;
    583588
    584589  /**
  • branches/2.2.9/mondo/src/common/newt-specific.c

    r2700 r2769  
    449449        mr_free(bkpinfo->exclude_devs);
    450450        mr_free(bkpinfo->exclude_paths);
     451        mr_free(bkpinfo->subdir);
    451452
    452453        /* Then free the structure */
  • branches/2.2.9/mondo/src/include/mr_conf.h

    r2208 r2769  
    5959    /* Default compression level */
    6060    int compression_level;
     61    /* Subdir for ISO images on HDD */
     62    char *subdir;
    6163    /* Paths to exclude from backup */
    6264    char *exclude_paths;
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-newt.c

    r2767 r2769  
    22812281{
    22822282
     2283    bool HDD = FALSE;
     2284    char *subdir_path;
    22832285    /** initialize ********************************************************/
    22842286
     
    23112313             "What is the disk format of the device? (Hit ENTER if you don't know.)",
    23122314             isodir_format, 16)) {
     2315            if (popup_with_button("Are you restoring from an external hard drive ?", "Yes", "No")) {
     2316                HDD = TRUE;
     2317            }
    23132318            if (popup_and_get_string
    23142319                ("ISO Mode - path",
    2315                  "At what path on this device can the ISO files be found ? (Use /tmp/isodir if restoring from HDD)",
    2316                  isodir_path, MAX_STR_LEN / 4)) {
     2320                "At what path on this device can the ISO files be found ?",
     2321                isodir_path, MAX_STR_LEN / 4)) {
    23172322                strip_spaces(isodir_device);
    23182323                strip_spaces(isodir_format);
    23192324                strip_spaces(isodir_path);
    23202325                log_it("isodir_device = %s - isodir_format = %s - isodir_path = %s", isodir_device, isodir_format, isodir_path);
     2326                if (HDD) {
     2327                    /*  We need an additional param */
     2328                    mr_asprintf(&subdir_path, "%s", isodir_path);
     2329                    bkpinfo->subdir = subdir_path;
     2330                    strcpy(isodir_path, "/tmp/isodir");
     2331                }
    23212332                return (TRUE);
    23222333            }
  • branches/2.2.9/mondo/src/mondorestore/mondo-rstr-tools.c

    r2758 r2769  
    900900        if (strcmp(old_isodir, bkpinfo->isodir)) {
    901901            log_it
    902                 ("user nominated isodir differs from archive, keeping user's choice: %s %s\n",
     902                ("user nominated isodir %s differs from archive %s, keeping user's choice\n",
    903903                old_isodir, bkpinfo->isodir);
    904904            strcpy(bkpinfo->isodir, old_isodir);
Note: See TracChangeset for help on using the changeset viewer.