Changeset 2696 in MondoRescue for branches/2.2.10/mondo/src


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 .

Location:
branches/2.2.10/mondo/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-cli.c

    r2508 r2696  
    497497            if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    498498                mr_asprintf(tmp1, "sshfs %s", bkpinfo->netfs_mount);
     499            } else if (strstr(bkpinfo->netfs_proto, "nfs")) {
     500                mr_asprintf(tmp1, "mount %s", bkpinfo->netfs_mount);
    499501            } else {
    500                 mr_asprintf(tmp1, "mount %s", bkpinfo->netfs_mount);
     502                log_to_screen("Protocol %s not supported yet for network backups.\n", bkpinfo->netfs_proto);
     503                fatal_error("Bad Protocol\n");
    501504            }
    502505            i = system(tmp1);
  • branches/2.2.10/mondo/src/common/libmondo-devices.c

    r2643 r2696  
    12711271
    12721272
     1273/**
     1274* Mount the CD-ROM or USB device at /mnt/cdrom.
     1275* @param bkpinfo The backup information structure. Fields used:
     1276* - @c bkpinfo->backup_media_type
     1277* - @c bkpinfo->disaster_recovery
     1278* - @c bkpinfo->isodir
     1279* - @c bkpinfo->media_device
     1280* @return 0 for success, nonzero for failure.
     1281*/
     1282int mount_media()
     1283{
     1284char *mount_cmd = NULL;
     1285int i, res;
     1286#ifdef __FreeBSD__
     1287    char mdd[32];
     1288    char *mddev = mdd;
     1289#endif
     1290
     1291    if (bkpinfo->backup_media_type == tape || bkpinfo->backup_media_type == udev) {
     1292        log_msg(8, "Tape/udev. Therefore, no need to mount a media.");
     1293        return 0;
     1294    }
     1295
     1296    if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
     1297        log_msg(2, "mount_media() - media already mounted. Fair enough.");
     1298        return (0);
     1299    }
     1300
     1301    if (bkpinfo->media_device == NULL) {
     1302        fatal_error("No media device at that point");
     1303    }
     1304
     1305    if (bkpinfo->backup_media_type == netfs) {
     1306        log_msg(2, "Mounting for Network thingy");
     1307        log_msg(2, "isodir = %s", bkpinfo->isodir);
     1308        if (!strcmp(bkpinfo->isodir, "/") && am_I_in_disaster_recovery_mode()) {
     1309            mr_free(bkpinfo->isodir);
     1310            mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
     1311            log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
     1312        }
     1313        if ((bkpinfo->isodir == NULL) || (bkpinfo->netfs_remote_dir == NULL) || (bkpinfo->prefix == NULL)) {
     1314            fatal_error("Unable to prepare the iso filename");
     1315        }
     1316#ifdef __FreeBSD__
     1317        mr_asprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
     1318            bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     1319        mddev = make_vn(mount_cmd);
     1320        mr_free(mount_cmd);
     1321
     1322        mr_asprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
     1323#else
     1324        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);
     1325#endif
     1326
     1327    } else if (bkpinfo->backup_media_type == iso) {
     1328#ifdef __FreeBSD__
     1329        mr_sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir,
     1330            bkpinfo->prefix, g_current_media_number);
     1331        mddev = make_vn(mount_cmd);
     1332        mr_free(mount_cmd);
     1333
     1334        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
     1335#else
     1336        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);
     1337#endif
     1338    } else if (bkpinfo->backup_media_type == usb) {
     1339        mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, MNT_CDROM);
     1340    } else if (strstr(bkpinfo->media_device, "/dev/")) {
     1341#ifdef __FreeBSD__
     1342        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
     1343#else
     1344        mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
     1345#endif
     1346    } else {
     1347        mr_free(bkpinfo->media_device);
     1348        if (bkpinfo->disaster_recovery && does_file_exist("/tmp/CDROM-LIVES-HERE")) {
     1349            bkpinfo->media_device = last_line_of_file(MINDI_CACHE"/CDROM-LIVES-HERE");
     1350        } else {
     1351            bkpinfo->media_device = find_cdrom_device(TRUE);
     1352        }
     1353
     1354#ifdef __FreeBSD__
     1355        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
     1356#else
     1357        mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
     1358#endif
     1359    }
     1360
     1361    log_msg(2, "(mount_media) --- command = %s", mount_cmd);
     1362    for (i = 0; i < 2; i++) {
     1363        res = run_program_and_log_output(mount_cmd, FALSE);
     1364        if (!res) {
     1365            break;
     1366        } else {
     1367            log_msg(2, "Failed to mount device.");
     1368            sleep(5);
     1369            sync();
     1370        }
     1371    }
     1372    mr_free(mount_cmd);
     1373
     1374    if (res) {
     1375        log_msg(2, "Failed, despite %d attempts", i);
     1376    } else {
     1377        log_msg(2, "Mounted media drive OK");
     1378    }
     1379    return (res);
     1380}
     1381/**************************************************************************
     1382*END_MOUNT_CDROM                                                         *
     1383**************************************************************************/
    12731384
    12741385
     
    13161427        // BERLIOS --- I'm tempted to do something about this...
    13171428        // Why unmount and remount again and again?
    1318         log_msg(3, "Remounting CD");
    13191429        g_ISO_restore_mode = TRUE;
    1320         if (is_this_device_mounted(MNT_CDROM)) {
    1321             run_program_and_log_output("umount " MNT_CDROM, 5);
    1322         }
    1323         mr_asprintf(tmp, "mkdir -p %s/isodir &> /dev/null", bkpinfo->tmpdir);
    1324         (void)system(tmp);
    1325         mr_free(tmp);
    1326 
    1327         if (((bkpinfo->isodir == NULL) && (bkpinfo->netfs_remote_dir == NULL)) || (bkpinfo->prefix == NULL)) {
    1328             fatal_error("Unable to prepare ISO file name. Please report to dev team");
    1329         }
    1330         if (bkpinfo->netfs_remote_dir) {
    1331             // NETFS
    1332             mr_asprintf(tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, cd_number_i_want);
    1333         } else {
    1334             // ISO
    1335             mr_asprintf(tmp, "%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->prefix, cd_number_i_want);
    1336         }
    1337         if (!does_file_exist(tmp)) {
    1338             mr_free(tmp);
    1339             if (bkpinfo->netfs_remote_dir) {
    1340                 // NETFS
    1341                 mr_asprintf(tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, cd_number_i_want);
    1342             } else {
    1343                 // ISO
    1344                 mr_asprintf(tmp, "%s/isodir/%s-%d.iso", bkpinfo->tmpdir, bkpinfo->prefix, cd_number_i_want);
    1345             }
    1346             if (does_file_exist(tmp)) {
    1347                 log_msg(1, "FIXME - hacking bkpinfo->isodir from '%s' to %s/isodir", bkpinfo->isodir, bkpinfo->tmpdir);
    1348                 mr_free(bkpinfo->isodir);
    1349                 mr_asprintf(bkpinfo->isodir, "%s/isodir", bkpinfo->tmpdir);
    1350             }
    1351         }
    1352         log_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);
    1353         if (mount_CDROM_here(tmp, MNT_CDROM)) {
    1354             mr_free(tmp);
    1355             fatal_error("Mommy!");
    1356         }
    1357         mr_free(tmp);
     1430        if (!is_this_device_mounted(MNT_CDROM)) {
     1431            log_msg(3, "Mounting media");
     1432            g_current_media_number = cd_number_i_want;
     1433            mount_media();
     1434        }
    13581435    }
    13591436    if ((res = what_number_cd_is_this()) != cd_number_i_want) {
     
    19472024    case -1:
    19482025        /* we need to add a space after token to be sure our strstr test works correctly */
    1949         mr_asprintf(tmp1,"%s ",token);
     2026        mr_asprintf(tmp1," %s ",token);
    19502027        if (mode == 'E') {
    19512028            /*  Add the token if not already in the list */
    1952             mr_asprintf(tmp,"%s ",bkpinfo->exclude_paths);
     2029            mr_asprintf(tmp," %s ",bkpinfo->exclude_paths);
    19532030            if (strstr(tmp,tmp1) == NULL) {
    1954                 mr_strcat(bkpinfo->exclude_paths, " %s", tmp1);
     2031                mr_strcat(bkpinfo->exclude_paths, "%s", tmp1);
    19552032            }
    19562033        } else {
    19572034            /*  Add the token if not already in the list */
    1958             mr_asprintf(tmp,"%s ",bkpinfo->include_paths);
     2035            mr_asprintf(tmp," %s ",bkpinfo->include_paths);
    19592036            if (strstr(tmp,tmp1) == NULL) {
    1960                 mr_strcat(bkpinfo->include_paths, " %s", tmp1);
     2037                mr_strcat(bkpinfo->include_paths, "%s", tmp1);
    19612038            }
    19622039        }
  • branches/2.2.10/mondo/src/common/libmondo-filelist.c

    r2651 r2696  
    452452        }
    453453        log_msg(8, "Analyzing %s", file_to_analyze);
    454         tmp = mr_stresc(file_to_analyze, "`$\\\"(){}[]'*?&|!#~", '\\');
     454        tmp = mr_stresc(file_to_analyze, " `$\\\"(){}[]'*?&|!#~", '\\');
    455455        mr_asprintf(strtmp, syscall_sprintf, tmp);
    456456        mr_free(tmp);
     
    477477
    478478    if (g_getfacl != NULL) {
    479         mr_asprintf(command, "touch %s", facl_fname);
     479        mr_asprintf(command, "touch \"%s\"", facl_fname);
    480480        run_program_and_log_output(command, 8);
    481481        mr_free(command);
    482482
    483483        retval =
    484             gen_aux_list(filelist, "getfacl --all-effective -P %s", facl_fname);
     484            gen_aux_list(filelist, "getfacl --all-effective -P \"%s\"", facl_fname);
    485485    }
    486486    return (retval);
     
    494494
    495495    if (g_getfattr != NULL) {
    496         mr_asprintf(command, "touch %s", fattr_fname);
     496        mr_asprintf(command, "touch \"%s\"", fattr_fname);
    497497        run_program_and_log_output(command, 8);
    498498        mr_free(command);
  • branches/2.2.10/mondo/src/common/libmondo-fork.c

    r2607 r2696  
    369369
    370370    if (!does_file_exist(lockfile)) {
    371         log_to_screen("Waiting for external binary to start");
     371        log_to_screen("Waiting for '%s' to start",command);
    372372        for (i = 0; i < 60 && !does_file_exist(lockfile); sleep(1), i++) {
    373373            log_msg(3, "Waiting for lockfile %s to exist", lockfile);
  • branches/2.2.10/mondo/src/common/libmondo-mountlist.c

    r2517 r2696  
    331331        /* OK, continue with main loop */
    332332        amount_allocated += mountlist->el[pos].size / 1024L;
     333
     334        /* This should only happen at the end but not tested now */
     335        if (amount_allocated > physical_drive_size) {
     336            // Used to be +1, but what if you're 1 MB too high?
     337            mr_asprintf(tmp, " %ld MB over-allocated on %s.",amount_allocated - physical_drive_size, drive);
     338            log_it(tmp);
     339
     340            /* Do we have more than 1 MB per partition ? */
     341            if (amount_allocated - physical_drive_size <= curr_part_no) {
     342                /* Probably a rouding error, just passing over
     343                 * by reducing the last partition if possible */
     344                amount_allocated -= mountlist->el[pos].size / 1024L;
     345                mountlist->el[pos].size =  (mountlist->el[pos].size - curr_part_no*1024L);
     346                amount_allocated += mountlist->el[pos].size / 1024L;
     347            } else {
     348                mr_strcat(flaws_str, "%s", tmp);
     349                res++;
     350            }
     351            mr_free(tmp);
     352        }
    333353        prev_part_no = curr_part_no;
    334354    }
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2635 r2696  
    376376    }
    377377
    378     log_msg(1, "Foo");
     378    log_msg(1, "Post-param");
    379379    if (bkpinfo->backup_media_type == tape) {
    380         log_msg(1, "Bar");
     380        log_msg(1, "Tape");
    381381        if (bkpinfo->media_device == NULL) {
    382382            return(1);
     
    498498            mr_asprintf(extra_cdrom_params, "blank=fast ");
    499499        }
    500         tmp = find_home_of_exe("cdrecord");
    501         if (tmp) {
    502             mr_asprintf(cdr_exe, "cdrecord");
     500        if (extra_cdrom_params == NULL) {
     501            // If not initialized earlier, do it now
     502            mr_asprintf(extra_cdrom_params, " ");
     503        }
     504        if (find_home_of_exe("cdrecord")) {
     505            strcpy(cdr_exe, "cdrecord");
     506        } else if (find_home_of_exe("dvdrecord")) {
     507            strcpy(cdr_exe, "dvdrecord");
    503508        } else {
    504509            mr_free(tmp);
     
    11811186
    11821187    if (!strcmp(tmp,"")) {
    1183         if ((strstr(tmp, "LABEL=") || strstr(tmp,"UUID="))) {
     1188        if ((strstr(tmp, "LABEL=") != NULL) || (strstr(tmp,"UUID=")!= NULL)) {
    11841189            if (!run_program_and_log_output("mount /boot", 5)) {
    11851190                strcpy(g_boot_mountpt, "/boot");
  • branches/2.2.10/mondo/src/include/my-stuff.h

    r2635 r2696  
    119119#define MAX_TAPECATALOG_ENTRIES 16384   ///< The maximum number of entries in the tape catalog.
    120120#define MAX_MOUNTLIST_ENTRIES 8192  ///< The maximum number of entries in the mountlist.
    121 #define MAX_STR_LEN 384         ///< The maximum length of almost all @p char buffers in Mondo.
     121#define MAX_STR_LEN 512         ///< The maximum length of almost all @p char buffers in Mondo.
    122122                                        ///  Note: Make this divisible by eight to avoid aligment issues
    123123                                        ///        on 64bit platforms like ia64.
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools-EXT.h

    r2623 r2696  
    77extern int iso_fiddly_bits(bool nuke_me_please);
    88extern void kill_petris(void);
    9 extern int mount_media();
    109extern int mount_all_devices(struct mountlist_itself *, bool);
    1110extern void protect_against_braindead_sysadmins(void);
  • 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
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.h

    r2623 r2696  
    77int iso_fiddly_bits(bool nuke_me_please);
    88void kill_petris(void);
    9 int mount_media();
    109int mount_device(char *, char *, char *, bool);
    1110int mount_all_devices(struct mountlist_itself *, bool);
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2623 r2696  
    5050extern int partition_everything(struct mountlist_itself *mountlist);
    5151extern int handle_incoming_parameters(int argc, char *argv[]);
     52extern int mount_media();
    5253
    5354/**
     
    24852486
    24862487    mvaddstr_and_log_it(g_currentY, 0, "Preparing to read your archives");
     2488    mount_media();
    24872489    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2488         mount_media();
    24892490        mvaddstr_and_log_it(g_currentY++, 0,
    24902491                            "Restoring OS and data from streaming media");
     
    25042505        mvaddstr_and_log_it(g_currentY++, 0,
    25052506                            "Restoring OS and data from CD/USB   ");
    2506         mount_media();
    25072507        resA = restore_all_tarballs_from_CD(filelist);
    25082508        resB = restore_all_biggiefiles_from_CD(filelist);
  • branches/2.2.10/mondo/src/restore-scripts/mondo/grub-MR

    r2635 r2696  
    103103fi
    104104
     105# For some OpenSuSE
     106res=1
     107if [ "$MNT_RESTORING" ] ; then
     108    if [ -x $MNT_RESTORING/usr/sbin/grub-install.unsupported ]; then
     109        echo "Now I'll use grub-install.unsupported in chroot" >> $LOGFILE
     110        chroot $MNT_RESTORING /usr/sbin/grub-install.unsupported $1 >> $LOGFILE 2>> $LOGFILE
     111        res=$?
     112        echo "grub-install.unsupported in chroot returned $res" >> $LOGFILE
     113    fi
     114else
     115    if [ -x /usr/sbin/grub-install.unsupported ]; then
     116        echo "Now I'll use grub-install.unsupported locally" >> $LOGFILE
     117        /usr/sbin/grub-install.unsupported $1 >> $LOGFILE 2>> $LOGFILE
     118        res=$?
     119        echo "grub-install.unsupported returned $res" >> $LOGFILE
     120    fi
     121fi
     122[ "$res" -eq "0" ] && exit 0
     123
    105124echo "Now I'll use grub-install" >> $LOGFILE
    106125if [ "$MNT_RESTORING" ] ; then
    107     chroot $MNT_RESTORING grub-install $1 2>&1 | tee -a $LOGFILE
     126    chroot $MNT_RESTORING grub-install $1 >> $LOGFILE 2>> $LOGFILE
    108127    res=$?
    109128else
    110     grub-install $1 2>&1 | tee -a $LOGFILE
     129    grub-install $1 >> $LOGFILE 2>> $LOGFILE
    111130    res=$?
    112131fi
    113132echo "grub-install returned $res" >> $LOGFILE
    114 [ "$res" -eq "0" ] && exit 0
    115 
    116 # For some OpenSuSE
    117 echo "Now I'll use grub-install.unsupported" >> $LOGFILE
    118 if [ "$MNT_RESTORING" ] ; then
    119     chroot $MNT_RESTORING grub-install.unsupported $1 2>&1 | tee -a $LOGFILE
    120     res=$?
    121 else
    122     grub-install.unsupported $1 2>&1 | tee -a $LOGFILE
    123     res=$?
    124 fi
    125 echo "grub-install.unsupported returned $res" >> $LOGFILE
    126133[ "$res" -eq "0" ] && exit 0
    127134
     
    172179echo "Now I'll use grub-install.patched" >> $LOGFILE
    173180cp -f `which grub-install.patched` /mnt/RESTORING/sbin
    174 chroot /mnt/RESTORING grub-install.patched $1 2>&1 | tee -a $LOGFILE
     181chroot /mnt/RESTORING grub-install.patched $1 >> $LOGFILE 2>> $LOGFILE
    175182res=$?
    176183echo "grub-install.patched returned $res" >> $LOGFILE
Note: See TracChangeset for help on using the changeset viewer.