Ignore:
Timestamp:
May 20, 2006, 5:51:21 PM (18 years ago)
Author:
bcornec
Message:

merge -r 542:560 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r507 r561  
    1 /***************************************************************************
    2 mondo-rstr-tools.c  -  description
    3 -----------------
    4 
    5 begin: Sun Sep 21 16:40:35 EDT 2003
    6 copyright : (C) 2002 Mondo  Hugo Rabson
    7 email     : Hugo Rabson <hugorabson@msn.com>
    8 edited by : by Stan Benoit ?/2003
    9 email     : troff@nakedsoul.org
    10 cvsid     : $Id: mondo-rstr-tools.c
    11 ***************************************************************************/
    12 
    13 /***************************************************************************
    14  *                                                                         *
    15  *   This program is free software; you can redistribute it and/or modify  *
    16  *   it under the terms of the GNU General Public License as published by  *
    17  *   the Free Software Foundation; either version 2 of the License, or     *
    18  *   (at your option) any later version.                                   *
    19  *                                                                         *
    20  ***************************************************************************/
    21 /* mondo-rstr-tools.c               Hugo Rabson
    22 
    23 
    24 07/27
    25 - if the user is foolish enough to use /dev/md0 as boot device,
    26   call lilo -M /dev/hda to make sure lilo does its job properly
    27 - better NFS+nuke support
    28 
    29 07/20
    30 - use backup's i-want-my-lvm file
    31 - be sure to use archives' raidtab when restoring
    32 
    33 07/18
    34 - use /tmp/isodir for NFS if DR mode
    35 - better support of users who boot from LVM CD and nuke-restore non-LVM backups
    36 
    37 07/12
    38 - bugfix to allow user to burn ISOs to CDs and restore from CDs (not original src)
    39 
    40 06/29
    41 - mount ext3 partitions as ext2, just in case :)
    42 
    43 06/26
    44 - delete make_relevant_partition_bootable()
    45 
    46 06/19
    47 - futzed with the call to mount floppy, to stop it from locking up on my AMD64 system
    48 
    49 06/14
    50 - shell out to /mnt/RESTORING chroot in order to let user install GRUB
    51   manually if automatic GRUB installation fails
    52 
    53 06/15
    54 - Added check for different 'isodir' chosen by user than stored in the archive
    55   Conor Daly <conor.daly@met.ie>
    56 
    57 04/17
    58 - replaced INTERNAL_TAPE_BLK_SIZE with bkpinfo->internal_tape_block_size
    59 
    60 04/09
    61 - don't try to mount CD if tape bkp
    62 
    63 04/03
    64 - trying to copy tmp/mondo-restore.cfg to itself - silly! - fixed
    65 
    66 04/02
    67 - when extracting cfg file and mountlist from all.tar.gz (tape copy),
    68   use block size of INTERNAL_TAPE_BLK_SIZE, not TAPE_BLOCK_SIZE
    69 
    70 02/21
    71 - don't use 'mv -v' cos Busybox won't support it
    72 
    73 02/09
    74 - make hole for cfg file before moving it (line 2094 or so)
    75 
    76 02/03
    77 - changed a couple of refs to filelist.full, to filelist.full.gz
    78 
    79 01/16/2004
    80 - instead of copying filelist, use 'ln -sf' to link to original;
    81   saves space
    82 
    83 11/20/2003
    84 - also retrieve /tmp/mountlist.txt if user wants
    85 
    86 11/16
    87 - fixed NFS path bug affecting the extractions of filelist/biggielist
    88   during selective restore
    89 
    90 11/02
    91 - fixed mount_cdrom() to run properly w/ nfs restores
    92 - mount_device() returns 0 if swap mount fails cos swap isn't crucial
    93 
    94 10/17
    95 - run_grub() uses MNT_RESTORING instead of "/mnt/RESTORING"
    96 
    97 10/26
    98 - cleaned up run_grub()
    99 
    100 10/25
    101 - fixed mount_cdrom() to run properly w/ nfs restores
    102 
    103 10/21
    104 - mount_device() returns 0 if swap mount fails cos swap isn't crucial
    105 
    106 10/15
    107 - run_grub() now uses its initiative instead
    108   of calling grub-install
    109 
    110 10/10
    111 - don't leave copies of filelist.full lying around, clogging up
    112   the ramdisk, there's a good fellow :-)
    113 
    114 10/02
    115 - added 'dvd' to the range of media types I'll understand
    116 - fixed iso->cdr problem (thanks, Stan Benoit & Fred Beondo)
    117 
    118 09/24
    119 - try lots of tape devs if /dev/st0 fails
    120 
    121 09/23/2003
    122 - first incarnation
     1/*
     2 * $Id$
    1233*/
    1244
     
    25692449                                           int wait_for_percentage)
    25702450{
    2571     struct s_mdstat *mdstat;
     2451    struct raidlist_itself *raidlist;
    25722452    int unfinished_mdstat_devices = 9999, i;
    25732453    char *screen_message;
    25742454
    25752455    malloc_string(screen_message);
    2576     mdstat = malloc(sizeof(struct s_mdstat));
     2456    raidlist = malloc(sizeof(struct raidlist_itself));
    25772457
    25782458    assert(wait_for_percentage <= 100);
    25792459    iamhere("Help, my boat is sync'ing. (Get it? Urp! Urp!)");
    25802460    while (unfinished_mdstat_devices > 0) {
    2581         if (read_mdstat(mdstat, mdstat_file)) {
    2582             log_to_screen(_("Sorry, cannot read %s"), mdstat_file);
     2461        if (parse_mdstat(raidlist, "/dev/")) {
     2462            log_to_screen("Sorry, cannot read %s", MDSTAT_FILE);
     2463            log_msg(1,"Sorry, cannot read %s", MDSTAT_FILE);
    25832464            return;
    25842465        }
    2585         for (unfinished_mdstat_devices = i = 0; i < mdstat->entries; i++) {
    2586             if (mdstat->el[i].progress < wait_for_percentage) {
     2466        for (unfinished_mdstat_devices = i = 0; i <= raidlist->entries; i++) {
     2467            if (raidlist->el[i].progress < wait_for_percentage) {
    25872468                unfinished_mdstat_devices++;
    2588                 sprintf(screen_message, _("Sync'ing /dev/md%d"),
    2589                         mdstat->el[i].md);
     2469                log_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i);
     2470                sprintf(screen_message, "Sync'ing %s",
     2471                        raidlist->el[i].raid_device);
    25902472                open_evalcall_form(screen_message);
    2591                 if (mdstat->el[i].progress == -1)   // delayed while another partition inits
     2473                if (raidlist->el[i].progress == -1) // delayed while another partition inits
    25922474                {
    25932475                    continue;
    25942476                }
    2595                 while (mdstat->el[i].progress < wait_for_percentage) {
    2596                     update_evalcall_form(mdstat->el[i].progress);
     2477                while (raidlist->el[i].progress < wait_for_percentage) {
     2478                    log_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress);
     2479                    update_evalcall_form(raidlist->el[i].progress);
    25972480                    sleep(2);
    2598                     if (read_mdstat(mdstat, mdstat_file)) {
     2481                    // FIXME: Prefix '/dev/' should really be dynamic!
     2482                    if (parse_mdstat(raidlist, "/dev/")) {
    25992483                        break;
    26002484                    }
     
    26052489    }
    26062490    paranoid_free(screen_message);
    2607     paranoid_free(mdstat);
    2608 }
     2491    paranoid_free(raidlist);
     2492}
Note: See TracChangeset for help on using the changeset viewer.