Ignore:
Timestamp:
Jan 25, 2011, 10:34:40 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Adds preliminary support for hpacucli. Needs test
  • Fix a compilation issue due to bad fatal_error call (no param allowed)
  • Fix some HTML syntax issues in the docs page + link to Wiki articles
  • Boot size pushed to 20MB
  • A bit more precise for error msg from PBDI
  • Exits if the protocol used is not recognized (error with -n fs:// typo)
  • Adds support for r8169 net driver
  • Fix a cast issue
  • Precise a test case to avoid ambiguity
  • Die and related functions placed before any other code as used early, and ash doesn't support function declaration. So will solve #446 by exiting mindi before doing anything weird in it.
  • Fix #445 with another technical solution to avoid vg with similar names to b wrongly excluded (vgroot and vgroot-san e.g.) (Michael Shapiro)
  • Fix a bug on exclusion of path with common content (/home and /path/home e.g.) which was handled correctly only in a certain order (John Pearson <johnp_at_gtagalenco.com.au>)
  • mount-media function is now placed in libmondo-devices.c as used by more programs.
  • Avoids calling mount_media when it's not mandatory (change the way mondorestore was working up to now but could solve some bugs reported)
  • Add xhci support to mindi.
  • Rewrite Xen kernel support to use TryToFindKernelPath systematically.
  • mindi now copies also the /lib/firmware content in order to have it for drivers needing it (bnx2 reported)
  • Push MAX_STR_LEN to 512 to allow supporting more exclude dir (2.2.10 and dyn allocation is the way to go there)
  • Add virtio driver to mindi
  • Initialize extra_cdrom_params in any case tp avoid passing null to cdrecord later on
  • Also escapes white spaces in gen_aux_list to avoid issues in getfacl call
  • Adds multiple missing drivers to mindi (mega_sr, ide_gd_mod, pata_jmicron, cp210x, dca, raid6_pq, xor async_tx, async_memcpy, async_xor)
  • Fix #434 by really testing thet udevd is not running already (chucky)
  • Adds support of pata_sil680 driver
  • Fix again #412 !! by removing calls to tee which voids the return value of the previous command
  • The way grub.unsupported was called for opensuse 11.2 was wrong. It should be done bfore calling grub-install which also exists. And tested for existence. Now this should fix #412.
  • Try to provide a workaround in code to the #401 (over-allocation of space due to rounding errors)
  • Fix a bug when using ACLs and file with spaces in their names by adding double quotes in getfacl invocation (Tom Mortell tomm_at_dslextreme.com). Also adding the same quotes on the touch commands made earlier.
  • Points to the current latest presentation instead of the old one
  • mondo-ref-card added to the docs web page
  • Add the mondoarchive reference card (Lester Wade)
  • Change useless comments for more useful ones
  • mindi is now able to handle compressed kernel with .gz or .bz2 suffix (case of OpenSuSE 11.2)
  • Improves logging for external binary
  • Improve Xen kernel detection and avoid false detection (Michael Shapiro)
  • Updated P2V doc from Lester Wade (lester.wade_at_hp.com)

Baclports from 2.2.9
svn merge -r 2650:2695 svn+ssh://bruno@svn.mondorescue.org/mondo/svn/mondorescue/branches/2.2.9 .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2644 r2696  
    4343extern void kill_anything_like_this(char *str);
    4444extern int skip_obdr(void);
     45extern int mount_media();
    4546extern int set_tape_block_size_with_mt(long internal_tape_block_size);
    4647
     
    460461/**************************************************************************
    461462*END_MOUNT_ALL_DEVICES                                                   *
    462 **************************************************************************/
    463 
    464 
    465 /**
    466 * Mount the CD-ROM or USB device at /mnt/cdrom.
    467 * @param bkpinfo The backup information structure. Fields used:
    468 * - @c bkpinfo->backup_media_type
    469 * - @c bkpinfo->disaster_recovery
    470 * - @c bkpinfo->isodir
    471 * - @c bkpinfo->media_device
    472 * @return 0 for success, nonzero for failure.
    473 */
    474 int mount_media() {
    475 
    476     char *mount_cmd = NULL;
    477     int i, res;
    478 #ifdef __FreeBSD__
    479     char mdd[32];
    480     char *mddev = mdd;
    481 #endif
    482 
    483     if (bkpinfo->backup_media_type == tape || bkpinfo->backup_media_type == udev) {
    484         log_msg(8, "Tape/udev. Therefore, no need to mount a media.");
    485         return 0;
    486     }
    487 
    488     if (!run_program_and_log_output("mount | grep -F "MNT_CDROM, FALSE)) {
    489         log_msg(2, "mount_media() - media already mounted. Fair enough.");
    490         return (0);
    491     }
    492 
    493     if (bkpinfo->media_device == NULL) {
    494         fatal_error("No media device at that point");
    495     }
    496 
    497     if (bkpinfo->backup_media_type == netfs) {
    498         log_msg(2, "Mounting for Network thingy");
    499         log_msg(2, "isodir = %s", bkpinfo->isodir);
    500         if (!strcmp(bkpinfo->isodir, "/") && am_I_in_disaster_recovery_mode()) {
    501             mr_free(bkpinfo->isodir);
    502             mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
    503             log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    504         }
    505         if ((bkpinfo->isodir == NULL) || (bkpinfo->netfs_remote_dir == NULL) || (bkpinfo->prefix == NULL)) {
    506             fatal_error("Unable to prepare the iso filename");
    507         }
    508 #ifdef __FreeBSD__
    509         mr_asprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
    510         mddev = make_vn(mount_cmd);
    511         mr_free(mount_cmd);
    512 
    513         mr_asprintf(mount_cmd, "mount_cd9660 -r %s "MNT_CDROM, mddev);
    514 #else
    515         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);
    516 #endif
    517 
    518     } else if (bkpinfo->backup_media_type == iso) {
    519 #ifdef __FreeBSD__
    520         mr_asprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number);
    521         mddev = make_vn(mount_cmd);
    522         mr_free(mount_cmd);
    523 
    524         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
    525 #else
    526         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);
    527 #endif
    528     } else if (bkpinfo->backup_media_type == usb) {
    529         mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, MNT_CDROM);
    530     } else if (strstr(bkpinfo->media_device, "/dev/")) {
    531 #ifdef __FreeBSD__
    532         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
    533 #else
    534         mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
    535 #endif
    536     } else {
    537         mr_free(bkpinfo->media_device);
    538         if (bkpinfo->disaster_recovery && does_file_exist(MINDI_CACHE"/CDROM-LIVES-HERE")) {
    539             bkpinfo->media_device = last_line_of_file(MINDI_CACHE"/CDROM-LIVES-HERE");
    540         } else {
    541             bkpinfo->media_device = find_cdrom_device(TRUE);
    542         }
    543 
    544 #ifdef __FreeBSD__
    545         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
    546 #else
    547         mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
    548 #endif
    549     }
    550 
    551     log_msg(2, "(mount_media) --- command = %s", mount_cmd);
    552     for (i = 0; i < 2; i++) {
    553         res = run_program_and_log_output(mount_cmd, FALSE);
    554         if (!res) {
    555             break;
    556         } else {
    557             log_msg(2, "Failed to mount device.");
    558             sleep(5);
    559             sync();
    560         }
    561     }
    562     mr_free(mount_cmd);
    563 
    564     if (res) {
    565         log_msg(2, "Failed, despite %d attempts", i);
    566     } else {
    567         log_msg(2, "Mounted media drive OK");
    568     }
    569     return (res);
    570 }
    571 /**************************************************************************
    572 *END_MOUNT_CDROM                                                         *
    573463**************************************************************************/
    574464
Note: See TracChangeset for help on using the changeset viewer.