Changeset 561 in MondoRescue


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

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

Location:
trunk
Files:
3 added
9 deleted
32 edited
11 copied

Legend:

Unmodified
Added
Removed
  • trunk/mindi-kernel/VERSION

    r560 r561  
    1 stable
     1trunk
  • trunk/mindi/distributions/gentoo/mindi.ebuild

    r537 r561  
    22# Distributed under the terms of the GNU General Public License v2
    33# $Id$
     4# $Header$
    45
    56DESCRIPTION="A program that creates emergency boot disks/CDs using your kernel, tools and modules."
    67HOMEPAGE="http://www.mondorescue.org"
    7 SRC_URI="ftp://ftp.mondorescue.org/src/${P}.tgz"
     8SRC_URI="ftp://ftp.mondorescue.org/src/${PVR}.tar.gz"
    89
    910LICENSE="GPL-2"
     
    1415DEPEND="virtual/libc"
    1516RDEPEND=">=app-arch/bzip2-0.9
    16         >=sys-apps/mindi-kernel-1.0-r1
    1717        sys-libs/ncurses
    1818        sys-devel/binutils
     
    2727    export PREFIX="/usr"
    2828    export CONFDIR="/etc"
     29    export DONT_RELINK=1
    2930    export RPMBUILDMINDI="true"
    3031    ./install.sh
  • trunk/mindi/distributions/mandriva/spec.m4

    r388 r561  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', `%{name}-%{version}.tar.bz2')dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-%{tag}.tar.bz2')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    6 define(`DDD', `%{addreqb}, which, grep >= 2.5')dnl
     6define(`DDD', `, which, grep >= 2.5')dnl
    77dnl GRP is replaced by the RPM group of apps
    88define(`GRP', `Archiving/Backup')dnl
  • trunk/mindi/distributions/redhat/spec.m4

    r496 r561  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', ftp://ftp.mondorescue.org/src/%{name}-%{version}.tgz)dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-%{tag}.tar.gz')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    6 define(`DDD', %{addreqb}, which, grep >= 2.5)dnl
     6define(`DDD', `, which, grep >= 2.5')dnl
    77dnl GRP is replaced by the RPM group of apps
    8 define(`GRP', Applications/Archiving)dnl
     8define(`GRP', `Applications/Archiving')dnl
  • trunk/mindi/distributions/rpm/mindi.spec

    r496 r561  
    22# $Id$
    33#
    4 %define name    mindi
    5 %define version VVV
    64%define mrel    RRR
    7 %define src     SSS
    8 %define grp     GRP
    9 %define addreqb bzip2 >= 0.9, mkisofs, ncurses, binutils, gawk, dosfstools
    10 %define addreq  DDD
    11 %define rel     %{mrel}
     5%define tag     TTT
    126
    137Summary:    Mindi creates emergency boot disks/CDs using your kernel, tools and modules
    14 Name:       %name
    15 Version:    %version
    16 Release:    %rel
     8Name:       mindi
     9Version:    VVV
     10Release:    %mrel
    1711License:    GPL
    18 Group:      %{grp}
     12Group:      GRP
    1913Url:        http://www.mondorescue.org
    20 Source:     %{src}
     14Source:     SSS
    2115BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
    22 Requires:   %{addreq}
    23 Epoch:      %(echo EEE | cut -d- -f1 | sed "s~M~~")
     16Requires:   bzip2 >= 0.9, mkisofs, ncurses, binutils, gawk, dosfstools DDD
    2417# Not on all systems
    2518#Conflicts: bonnie++
     
    3225
    3326%prep
    34 %setup -n %name-%{version}
     27%setup -n %name-%{version}-%{tag}
    3528
    3629%build
  • trunk/mindi/distributions/suse/spec.m4

    r403 r561  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', %{name}-%{version}.tgz)dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-%{tag}.tar.gz')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    6 define(`DDD', %{addreqb}, syslinux)dnl
     6define(`DDD', `, syslinux')dnl
    77dnl GRP is replaced by the RPM group of apps
    8 define(`GRP', Productivity/Archiving/Backup)dnl
     8define(`GRP', `Productivity/Archiving/Backup')dnl
  • trunk/mindi/mindi

    r539 r561  
    13671367    if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then
    13681368    echo -en "\rAnalyzing LVM...\r"
    1369     all_partitions=`$MINDI_SBIN/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
     1369    all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
    13701370    fi
    13711371    all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`"
     
    21452145    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n"
    21462146    return $retval
     2147}
     2148
     2149
     2150PrepareDataDiskImages() {
     2151    local needlist bigdir minidir_root tardir diskdir imagesdir res i j k old_pwd lines
     2152
     2153    imagesdir=$1
     2154    rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
     2155    needlist=$TMP_ROOT/what-we-need.txt
     2156    bigdir=$TMP_ROOT/bigdir
     2157    minidir_root=$TMP_ROOT/minidir
     2158    mkdir -p $minidir_root
     2159    mkdir -p $bigdir/usr/bin
     2160    tardir=$TMP_ROOT/tardir
     2161
     2162    lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l`
     2163    cat $MINDI_CONF/deplist.txt | GenerateGiantDependencyList $needlist $lines
     2164    res=$?
     2165    if [ "$YOUR_KERNEL_SUCKS" ]; then
     2166    pwd=`pwd`
     2167    cd $TMP_ROOT
     2168        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
     2169        cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
     2170        if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
     2171        cp --parents -pRdf $i $bigdir
     2172        else
     2173        ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
     2174        BIGNO=$(($BIGNO+1))
     2175        fi
     2176    done
     2177    for i in $EXTRA_MODS ; do
     2178        j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null`
     2179        [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE
     2180        for k in $j ; do
     2181        if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
     2182            cp --parents -pRdf $k $bigdir
     2183        else
     2184            ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
     2185            BIGNO=$(($BIGNO+1))
     2186        fi
     2187        echo "Added failsafe module $k to ramdisk" >> $LOGFILE
     2188        done
     2189    done
     2190    cd $pwd
     2191    else
     2192    ListKernelModulePaths >> $needlist
     2193    fi
     2194    if [ "$res" -ne "0" ] ; then
     2195        Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem."
     2196    fi
     2197    FindAndAddUserKeyboardMappingFile
     2198    mkdir -p $bigdir/tmp
     2199    if [ "`DidMondoCallMe`" ] ; then
     2200        MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg
     2201        cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null
     2202        cp -f $TMP_ROOT/mondo-restore.cfg $CACHE_LOC &> /dev/null
     2203    fi
     2204    [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     2205    DropOptimizedLibraries $needlist $bigdir
     2206    echo -en "Assembling dependency files"
     2207    CopyDependenciesToDirectory < $needlist $bigdir
     2208
     2209# also copy io.sys and msdos.sys, if we can find them
     2210    for i in `mount | cut -d' ' -f3` ; do
     2211    for j in io.sys msdos.sys ; do
     2212        [ -e "$i/$j" ] && cp -f $i/$j $bigdir
     2213    done
     2214    done
     2215
     2216# master boot record, too
     2217    i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null`
     2218    if [ "$i" ] ; then
     2219    LogIt "Backing up $i's MBR\n"
     2220    dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
     2221# < < E O F
     2222    sleep 1
     2223    sync
     2224#        [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE
     2225    j=$i
     2226    [ -h "$j" ] && j=`ResolveSoftlink $j`
     2227    LogIt "Creating /dev/boot_device ($j)\n"
     2228    mkdir -p $bigdir/dev
     2229    cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk"
     2230    fi
     2231
     2232# more stuff
     2233#    cp -f $MINDI_LIB/embleer* $bigdir
     2234    old_pwd=`pwd`
     2235    cd $bigdir
     2236
     2237    [ -e "$MINDI_LIB/aux-tools" ] || Die "aux-tools not found in Mindi's home dir. Do you have multiple copies of Mindi lying around? Please delete them. No, don't e-mail me and ask how. ;) Use 'rm'."
     2238    cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
     2239    if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then
     2240    tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
     2241    fi
     2242    if [ -e "$MONDO_SHARE/restore-scripts" ] ; then
     2243        cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
     2244        [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     2245    fi
     2246    [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
     2247    cd $old_pwd
     2248    echo -e "$DONE"
     2249    TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
     2250    SplitDirectoryIntoMinidirs $bigdir $minidir_root
     2251    noof_disks=$?
     2252    [ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
     2253#    if [ "$noof_disks" -ge "8" ] ; then
     2254#        LogIt "You are putting a ludicrously large amount of data on these disks."
     2255#        LogIt "I shall therefore double EXTRA_SPACE, just in case your ramdisk is too small."
     2256#        EXTRA_SPACE=$(($EXTRA_SPACE*2))
     2257#    fi
     2258    MakeMountlist $TMP_ROOT/mountlist.txt
     2259    mkdir -p $minidir_root/$noof_disks/tmp
     2260    cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
     2261    cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC
     2262    [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
     2263    [ -d "/proc/lvm" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     2264    [ -d "/dev/mapper" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     2265    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     2266    ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
     2267    CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks
     2268    FRIENDLY_OUTSTRING="Boot and data disk images were created."
     2269# One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images
     2270    rmdir $tardir $bigdir
     2271    rm -f $needlist
     2272    return $noof_disks
    21472273}
    21482274
  • trunk/mondo/configure.in

    r537 r561  
    11dnl Autoconfigure file for Mondo Rescue v2.0x
    2 dnl Mondo by Hugo Rabson
     2dnl Mondo by Mondo dev team
    33dnl This script by Joshua Oreman
    44dnl
  • trunk/mondo/distributions/gentoo/mondo.ebuild

    r537 r561  
    77DESCRIPTION="The premier GPL disaster recovery solution."
    88HOMEPAGE="http://www.mondorescue.org"
    9 SRC_URI="ftp://ftp.mondorecue.org/src/${PN/-rescue/}-${PV}.tgz"
     9SRC_URI="ftp://ftp.mondorecue.org/src/${PN/-rescue/}-${PV}-${PR}.tgz"
    1010
    1111LICENSE="GPL-2"
     
    2727    >=sys-boot/syslinux-1.52"
    2828
    29 S=${WORKDIR}/${PN/-rescue/}-${PV}
     29S=${WORKDIR}/${PN/-rescue/}-${PV}-${PR}
    3030
    3131src_unpack() {
     
    3838    elibtoolize
    3939    econf || die "Configuration failed"
    40     emake || die "Make failed"
    41     #make VERSION=VVV CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT"
     40    emake VERSION=VVV || die "Make failed"
    4241}
    4342
    4443src_install() {
    45     #make install DESTDIR=${D} || die "make install failed"
    46     einstall || die "Install failed"
     44    make install DESTDIR=${D} || die "make install failed"
     45    #einstall || die "Install failed"
    4746    exeinto /usr/share/mondo
    4847    doexe mondo/autorun
     
    5453    einfo "Or visit the website @ ${HOMEPAGE}"
    5554    echo
    56     ewarn "This package is still in unstable."
     55    ewarn "This package is a new version after a long gap."
    5756    ewarn "Please report bugs to http://bugs.gentoo.org/"
    5857    ewarn "However, please do an advanced query to search for bugs"
  • trunk/mondo/distributions/mandriva/changelog

    r426 r561  
    99- Add -p option
    1010
    11 * Tue May 03 2005 Hugo Rabson <hugorabson@msn.com> 2.04_cvs_20050503
    12 
    13 - made mondo more clever about finding its home. Avoids mondo considering
    14   directories like '/usr/share/doc/momdo' as its home.
    15 
    16 * Wed Aug 04 2004 Hugo Rabson <hugorabson@msn.com> 2.03
    17 
    18 - test sanity of user-specified tempdir
    19 - better SLES8 support
    20 
    21 * Mon Jun 28 2004 Hugo Rabson <hugorabson@msn.com> 2.02
    22 
    23 - instead of using 'dd' to erase partition table, delete existing
    24   partitions w/ the same call to fdisk that is used to create the
    25   new partitions; this should avoids locking up the partition table
    26 - set bootable partition in the above same call to fdisk, for
    27   the same reason (avoids locking up the partition table)
    28 - better software RAID support
    29 - mount ext3 partitions as ext2 when restoring - better for Debian
    30 - better star, ACL support
    31 - added ACL, xattr support for afio users
    32 
    33 * Sat Jun 26 2004 Hugo Rabson <hugorabson@msn.com> 2.01
    34 
    35 - fixed cvs for SuSE systems
    36 - fixed NTFS backup/restore bug relating to partimagehack
    37   log file overflow and NTFS v non-NTFS differentiation
    38 - more reliable extraction of config info from CDs, floppies
    39 - better support of ISO dirs at restore-time (Conor Daly)
    40 - fixed spec file for SuSE users
    41 - added ldconfig to install section
    42 
    43 * Sat Jun 19 2004 Hugo Rabson <hugorabson@msn.com> 2.00
    44 
    45 - first 2.0 release
    46 - updated grub-install.patched to support SuSE and Red Hat
    47 - call 'mt' to set block size to 32K before opening in/out tape
    48 - updated mondo-prep.c to create each disk's partitions all at once
    49   (one call per drive) instead of one call to fdisk per partition
    50 - when extracting cfg file and mountlist from all.tar.gz (tape copy),
    51   use block size of INTERNAL_TAPE_BLK_SIZE, not TAPE_BLOCK_SIZE
    52 - added star and rudimentary SELinux support
    53 - fixed lots of bugs
    54 - all logging now goes to /var/log/mondo-archive.log, with symlink
    55   to /tmp/mondo-restore.log for restore-time log-tracking
    56 - added grub-install.patched
    57 - removed embleer & other binaries
    58 - added '-b' to specify block size
    59 - added '-R' for star support
    60 
    61 * Thu Mar 25 2004 Bruno Cornec <Bruno.Cornec@hp.com> 1.7_cvs-20040325
    62 
    63 - ia64 fixes
    64 
    65 * Fri Nov 07 2003 Joshua Oreman <oremanj@get-linux.org> 1.7_cvs-20031107
    66 
    67 - fixed symbolic links for libraries
    68 - added support for boot/root multi floppies
    69 
    70 - added kdelibs as xmondo dependency
    71 - added xmondo pixmap installation
    72 - better find_cdrom_device(), to cope w/ multiple CD writers
    73 - fixed -m and -Vc flags
    74 - fixed NTFS support!
    75 - bootable CD uses native, not El Torito, support now
    76 - removed mondo-makefilelist
    77 - added 2.6 kernel support
    78 - if 2.6 kernel, insist that the user specify CD device
    79 - drop Embleer; insist on ms-sys and parted if Windows partition
    80 
    81 * Wed Nov 05 2003 Jesse Keating <jkeating@j2solutions.net> 1.7_cvs-20031105.1
    82 
    83 - added -devel package
    84 
    85 * Tue Nov 04 2003 Jesse Keating <jkeating@j2solutions.net> 1.7_cvs-20031104.1
    86 
    87 - made xmondo a second package
    88 - added ability to specify --without xmondo at build time
    89 
    90 * Sun Nov 02 2003 Jesse Keating <jkeating@j2solutions.net> 1.7_cvs-20031102.1
    91 
    92 - Clean up, added spanish translation
    93 - Set prefix to be /usr
    94 - added/fixed Requires
    95 - remove CVS directories prior to building
    96 
    97 * Thu Oct 23 2003 Hugo Rabson <hugorabson@msn.com> 1.75_cvs_20031023
    98 
    99 - nothing yet
    100 
    101 * Wed Oct 22 2003 Hugo Rabson <hugorabson@msn.com> 1.75
    102 
    103 - fixed chmod/chown bug (Jens Richter)
    104 - ask user to confirm NFS mountpoint in Interactive Mode
    105 - rewritten format_everything() to make sure LVMs, RAIDs and
    106   regular partitions are prepped in the correct order
    107 - better magicdev support
    108 - rewritten external binary caller subroutine
    109 - DVD support added
    110 - better backup-time control gui; offer to exclude nfs if appl.
    111 - fixed multi-tape support
    112 - re-implemented -D and -J
    113 - fixed bug in extract_config_file_from_ramdisk() which
    114   affected tape+floppy users
    115 - updated is_incoming_block_valid() to make it
    116   return end-of-tape if >300 flotsam blocks
    117 - unmount CD-ROM before burning (necessary for RH8/9)
    118 - fixed some stray assert()'s
    119 - fixed bug in grub-MR (Christian)
    120 - make user remove floppy/CD before restoring interactively from tape
    121 - fixed bug in am_I_in_disaster_recovery_mode()
    122 - added code to nuke_mode() to make sure NFS
    123   (backup) share is mounted in Nuke Mode
    124 - improved tape device detection code
    125 - better GRUB support
    126 - better logging of changed bigfiles at compare-time
    127 - better NTFS support, thanks to partimagehack-static
    128 - better logging
    129 - rewrote tape-handling code, breaking compatibility w/ previous versions
    130 - fixed ISO/CD biggiefile verification bug in mondoarchive
    131 - fixed bug which stopped boot/compare-time changelist from popping up
    132 - replaced mondo-makefilelist with C code - faster, cleaner
    133 - tweaked GUI - better feedback
    134 
    135 * Wed May 28 2003 Anonymous <root@rohan> 1.74
    136 
    137 - misc fixes (Michael Hanscho's friend)
    138 - added rudimentary support for SME
    139 - added better label support
    140 - fixed biggietime atime/ctime restoration bug 73
    141 - fixed 'default boot loader' detection bug (Joshua Oreman)
    142 - use single-threaded make_afioballs_and_images() if FreeBSD
    143 - fixed mondoarchive -Vi multi-CD verify bug (Tom Mortell)
    144 - superior get_phys_size_of_drive() (Joshua Oreman)
    145 - fixed RAID-related bug in where_is_root_mounted()
    146 - ISO tweaks
    147 - fixed silly bug in load_filelist() which stopped
    148   funny German filenames from being handled properly
    149 - fixed various calls to popup_and_get_string()
    150 - fixed spec file
    151 - reject -E /
    152 - added partimagehack to the mix
    153 
    154 * Tue May 20 2003 Anonymous <root@rohan> 1.73
    155 
    156 - mark devices as bootable _after_ unmounting them
    157 - resolve boot device (-f) if softlink
    158 - post_param_configuration() --- store iso-dev and isodir
    159 - added post-nuke-sample.tgz to package
    160 - Nuke Mode now checks mountlist against hardware; offer user
    161   opportunity to edit mountlist if insane; if user declines, abort
    162 - added lots of assert()'s and other checks
    163 - ran code thru Valgrind to catch & fix some memory leaks
    164 - made mondo-restore.c smaller by moving some subroutines to
    165   common/libmondo-raid.c and mondorestore/mondo-rstr-compare.c
    166 - added '-Q' to let user test mondoarchive's ability to find
    167   their boot loader and type
    168 - improved which_boot_loader()
    169 - when burning or comparing to a CD, defeat autorun if it is
    170   running, to avoid confusing mondoarchive and the user
    171 - if original backup media no longer available at boot-time
    172   then offer user chance to choose another media source
    173 - when booting, type 'nuke noresize' to nuke w/o resizing
    174   mountlist to fill your drives
    175 - add 'textonly' when booting, to avoid using Newt gui
    176 - run nice(20) to prioritize mondoarchive at start
    177 - don't pause and wait for next blank CD at backup-time
    178   unless necessary (e.g. previous CD has not been removed)
    179 - get_phys_size_of_drive() --- better support of older drives
    180 - don't eject if "donteject" is in kernel's command line
    181 - cleaned up segfault-handling
    182 - added Conor's strip_path() to improve file list display
    183 - added Herman Kuster's multi-level bkp patch
    184 - better boot-time screen/message
    185 - added Joshua Oreman's FreeBSD patches x3
    186 - fixed interactive/textonly support
    187 - fixed support for subdir-within-NFS-mount
    188 - fixed "Can't backup if ramdisk not mounted" bug
    189 - try to work around eccentricities of multi-CD drive PCs
    190 - misc clean-ups (Steve Hindle)
    191 
    192 * Tue Apr 08 2003 Hugo Rabson <hugorabson@msn.com> 1.72
    193 
    194 - LVM/RAID bugs fixed (Brian Borgeson)
    195 - major clean-up of code (Stan Benoit)
    196 - make-me-bootable fix (Juraj Ziegler)
    197 - fixed problem w/ multi-ISO verify cycle (Tom Mortell)
    198 - removed duplicate entry from makefile
    199 - if root is /dev/root then assume not a ramdisk
    200 - reject relative paths if -d flag (Alessandro Polverini)
    201 - fixed potentially infinite loop in log_to_screen (Tom Mortell)
    202 - add '/' to custom filelist as workaround for obscure bug
    203 - ask user speed of CDRW if writing to CD
    204 - find_cdrom_device() --- if nonexistent/not found then
    205   make sure to return '' as dev str and 1 as res
    206 - tweaked restore scripts tgz
    207 - cleaned up find_cdrom_device()
    208 - if user creates /usr/share/mondo/payload.tgz then untar
    209   payload to CD at backup-time
    210 - fixed insist_on_this_cd_number()
    211 - fixed am_i_in_disaster_recovery_mode()
    212 - misc clean-up (Tom Mortell)
    213 - made code more legible
    214 - fixed post-nuke support
    215 - added -e support
    216 - fixed nfs support
    217 - fixed iso support
    218 - at restore-time, only sort mountlist internally,
    219   in mount_all_devices() and unmount_all_devices()
    220 - fixed cosmetic bug in label-partitions-as-necessary
    221 - updated documentation
    222 - fixed fstab-hacking scripts
    223 
    224 * Wed Feb 12 2003 Hugo Rabson <hugorabson@msn.com> 1.71
    225 
    226 - log newt, slang, ncurses info
    227 - updated man page
    228 - handle % chars in issue.net properly (Heiko Schlittermann)
    229 - fixed serious NFS restore bug
    230 - cleaned up spec file; it should cause fewer problems now (Jesse Keating)
    231 - changed various strcpy() calls to strncpy() calls
    232 - added mondo-makefilelist to makefile (Mikael Hultgren)
    233 - mount_cdrom() better at handling multiple CD drives
    234 - exclude /media/cdrom,cdrecorder,floppy
    235 - sensibly_set_tmpdir_and_scratchdir() --- exclude smb and smbfs
    236 - better logging by eval_call_to_make_ISO()
    237 - accept -J <fname> to let user provide their own fs catalog
    238   instead of -I <paths> to backup
    239 - if dir excluded with -E or included with -I and dir is actually
    240   a softlink then exclude/include the dir pointed to, as well
    241 - better location for manpage
    242 - adjusted block size of tarball at start of tape, to help
    243   users w/ broken tape driver firmware
    244 - sort -u fstab after modifying it
    245 - if backup type is nfs then don't estimate noof media
    246 - fixed Makefile (Mikael Hultgren)
    247 - updated manpage
    248 
    249 * Sat Dec 07 2002 Hugo Rabson <hugo@firstlinux.net> 1.70
    250 
    251 - new devel branch opened
    252 
    253 * Mon Dec 02 2002 Hugo Rabson <hugo@firstlinux.net> 1.52
    254 
    255 - fixed bug in multithreading
    256 - use new grub-MR instead of grub-install
    257 - wipe only the partition table (not the MBR) when partitioning drives
    258 - ignore lilo.conf.anaconda when looking for lilo.conf file
    259 - accepts '-l RAW' to backup/restore original boot sector instead
    260   of running grub or lilo to init it after restoring
    261 - fixed&updated stabgrub-me script; software RAID + GRUB work now
    262 - mount/unmount /boot partition for Gentoo 1.2 users
    263 - re-enabled extra tape checksums
    264 - disabled spurious warnings
    265 - unmount/remount supermounts at start/end of live restore, if nec.
    266 - cleaned up mondo's tape block handling (now, TAPE_BLOCK_SIZE=128K
    267   and I've added INTERNAL_TAPE_BLK_SIZE=32K variable for buffering)
    268 - added Makefile
    269 - added -l RAW, to backup and restore original MBR
    270 - cleaned up iso_mode() and nfs restoring
    271 - create /mnt/RESTORING/mnt/.boot.d for Gentoo users
    272 - made mondorestore CD bootable for ArkLinux users
    273 - if user runs as 'su' not 'su -' then work around
    274 
    275 * Sun Nov 17 2002 Hugo Rabson <hugo@firstlinux.net> 1.51
    276 
    277 - pop-up list of changed files, at end of verification phase
    278 - better handling of changed.files list at restore-time
    279 - lots of CD-related fixes
    280 - added '-N' flag --- to let user exclude all NFS-related mounts&devices
    281 - better handling of 'kill'
    282 - restructuring of code to ease integration of mondo w/XMondo
    283 - fixed obscure bug in find_and_mount_actual_cd()
    284 - if / or /root has <50MB free then abort & complain
    285 - fixed install.sh
    286 - fixed .spec file
    287 - updated documentation
    288 - commented code
    289 - updated man page
    290 - added -v / --version flag
    291 - replace convoluted grep with wc (KP)
    292 - fixed bug affecting restoration of bigfiles from CD's created w/0 compression
    293 - fixed BurnProof-related bug
    294 - better at figuring out which is the best partition for temp/scratchdir
    295 - added do-not-compress-these (text file) to RPM
    296 - do not compress files of types listed in do-not-compress-these
    297 - dropped -U from call to afio - saves 20-30% runtime (Cosgrove)
    298 - added Cosgrove's do-not-compress-these list
    299 - included various patches from KP
    300 - chmod tmpdir, scratchdir to 700 before using
    301 - restore from specified backup device, even if its own cfg file disagrees
    302 - fixed multi-tape bug
    303 - fixed "Can't find first ISO when verifying nonbootable ISO" bug
    304 - multithreaded make_afioballs_and_images()
    305 - tmpdir and scratchdir are set sensibly whether mondoarchive is called with
    306   command-line parameters or not
    307 - fixed bug in strip_spaces() which stopped it from handling
    308   small strings correctly - affected mountlist editor
    309 - create a repaired copy of grub-install which is RAID-friendly;
    310   use it when initializing boot sector with run_grub()
    311 - fixed bug in mondo-makefilelist
    312 
    313 * Sun Sep 08 2002 Hugo Rabson <hugo@firstlinux.net> 1.50
    314 
    315 - if restoring, don't try to find SCSI node of CD-ROM drive; find /dev entry
    316 - during selective restore, skip filesets which don't contain relevant archives
    317 - set /dev/null's perms to 777, just in case devfs-enabled kernel mangles it
    318 - remove /var/run/*.pid after restoring
    319 - move spurious lockfiles from /home/* to /home/*/.disabled
    320 - ask user to confirm the tape/CD device name
    321 - lots of multitape-related fixes
    322 - added code to autodetect the hardware of the user, if possible
    323 - if isodir does not exist then abort
    324 - more sanity-checking for -d flag
    325 - doubled 'biggiefile' threshold... to 32MB
    326 - exclude /root/images/mindi
    327 - fixed multi-imagedev bug (Emmanuel Druon)
    328 - unmount/remount /mnt/floppy before/after backing up, if Mandrake
    329 - restructured the source files
    330 - fixed serious bug in line 1546 - should have been !=, not ==; stopped
    331   mondorestore from correctly restoring big files
    332 - added '#include <signal.h>' to my-stuff.h
    333 - exclude "incheckentry xwait()" from changed.files
    334 - fixed minor bug in find_cdrom_device()
    335 - fixed bug in friendly_sizestr...
    336 - insist on tape #1 when start verifying
    337 - added internal buffering, replacing the external 'buffer' exe
    338 - if differential backup then don't permit formatting or fdisking,
    339   whether Interactive or Nuke mode
    340 - if mondorestore is run on live filesystem (or from ramdisk) without
    341   parameters then mondorestore will ask which backup media (tape, CD, etc.)
    342   was used; it will read the config file from the media and proceed from there
    343 - if tape streamer is softlink then resolve it first
    344 - incorporate post-nuke tarball
    345 - if user doesn't specify tape size, proceed anyway; behave intelligently
    346   in the event of end-of-tape
    347 - prefix bkpinfo->restore_path to biggiefile fname before generating
    348   checksum & comparing to archived biggiefile
    349 - if /etc/lilo.conf not found not /etc/lilo.conf.anaconda found
    350   then create a softlink from the former to the latter, to work
    351   around RH7.3's b0rken LILO support
    352 - LFS support (mharris, michele, hugo)
    353 - fixed verify bug --- CD#1 was being verified again & again & ...
    354 - differential mode fixed; supported again
    355 - ask user for boot loader + device if not detectible
    356 - list up to 512 files in file selection window at once (was 128)
    357 - better handling of bigfiles' checksums, perms and owns
    358 - delete final filelist if <=2 bytes long
    359 - if kernel not found and mondo in graphics mode then popup and ask
    360   for kernel path+filename
    361 
    362 * Sun Jul 14 2002 Hugo Rabson <hugo@firstlinux.net> 1.45-1
    363 
    364 - 1.5x branch forked off from 1.4x branch
    365 
  • trunk/mondo/distributions/mandriva/spec.m4

    r489 r561  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', `%{name}-%{version}.tar.bz2')dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-%{tag}.tar.bz2')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    6 define(`DDD', `%{addreqb}')dnl
     6define(`DDD', )dnl
    77dnl GRP is replaced by the RPM group of apps
    88define(`GRP', `Archiving/Backup')dnl
    9 dnl OBS is replaced vy what is being obsoleted
     9dnl OBS is replaced with what is being obsoleted
    1010define(`OBS', `Obsoletes:   libmondo <= 2.04
    1111Provides:   libmondo')dnl
  • trunk/mondo/distributions/redhat/spec.m4

    r537 r561  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', ftp://ftp.mondorescue.org/src/%{name}-%{version}.tgz)dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-%{tag}.tar.gz')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    6 define(`DDD', %{addreqb})dnl
     6define(`DDD', )dnl
    77dnl GRP is replaced by the RPM group of apps
    8 define(`GRP', Applications/Archiving)dnl
     8define(`GRP', `Applications/Archiving')dnl
    99dnl OBS is replaced vy what is being obsoleted
    1010define(`OBS', )dnl
  • trunk/mondo/distributions/rpm/mondo.spec

    r537 r561  
    33#
    44
    5 %define name    mondo
    6 %define version VVV
    75%define mrel    RRR
     6%define tag     TTT
    87# if mandriva official build (rpm --with is_official)
    98%{?is_official:%define rel %{mkrel} %{mrel}}%{!?is_official:%define rel %{mrel}}
    10 %define src     SSS
    11 %define grp     GRP
    12 %define addreqb mindi >= 1.0.7, bzip2 >= 0.9, afio, mkisofs, binutils, newt >= 0.50, slang >= 1.4.1
    13 %define rel     %{mrel}
     9%define addreq  mindi >= 1.0.7, bzip2 >= 0.9, afio, mkisofs, binutils, newt >= 0.50, slang >= 1.4.1 DDD
    1410
    1511Summary:    A program which a Linux user can utilize to create a rescue/restore CD/tape
     
    1814Summary(sp):    Un programa para los usuarios de Linux por crear una CD/cinta de restoracion/rescate
    1915
    20 Name:       %{name}
    21 Version:    %{version}
    22 Release:    %{rel}
     16Name:       mondo
     17Version:    VVV
     18Release:    %{mrel}
    2319License:    GPL
    24 Group:      %{grp}
     20Group:      GRP
    2521Url:        http://www.mondorescue.org
    26 Source:     %{src}
     22Source:     SSS
    2723BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
    2824BuildRequires:  newt-devel >= 0.50, slang-devel >= 1.4.1, gcc
    29 Epoch:      %(echo EEE | cut -d- -f1 | sed "s~M~~")
    3025OBS
    3126%ifarch ia64
     
    6459
    6560%prep
    66 %setup -q -n %name-%{version}
     61%setup -q -n %name-%{version}-%{tag}
    6762
    6863%build
  • trunk/mondo/distributions/suse/spec.m4

    r461 r561  
    22dnl
    33dnl SSS is replaced by the source package format
    4 define(`SSS', %{name}-%{version}.tgz)dnl
     4define(`SSS', `ftp://ftp.mondorescue.org/src/%{name}-%{version}-%{tag}.tar.gz')dnl
    55dnl DDD is replaced by the list of dependencies specific to that distro
    6 define(`DDD', %{addreqb}, buffer, cdrecord)dnl
     6define(`DDD', `, buffer, cdrecord')dnl
    77dnl GRP is replaced by the RPM group of apps
    8 define(`GRP', Productivity/Archiving/Backup)dnl
     8define(`GRP', `Productivity/Archiving/Backup')dnl
    99dnl OBS is replaced vy what is being obsoleted
    1010define(`OBS', )dnl
  • trunk/mondo/mondo/common/libmondo-raid-EXT.h

    r59 r561  
    5353#endif
    5454
    55 extern int create_raidtab_from_mdstat(char *, char *);
    56 extern int read_mdstat(struct s_mdstat *mdstat, char *mdstat_file);
    57 
    58 extern int create_raidtab_from_mdstat(char *raidtab_fname,
    59                                       char *mdstat_fname);
     55extern int parse_mdstat(struct raidlist_itself *raidlist, char *device_prefix);
     56extern int create_raidtab_from_mdstat(char *raidtab_fname);
  • trunk/mondo/mondo/common/libmondo-raid.c

    r507 r561  
    344344
    345345    fprintf(fout, "raiddev %s\n", raidrec->raid_device);
    346     if (raidrec->raid_level == -1) {
     346    if (raidrec->raid_level == -2) {
     347        fprintf(fout, "    raid-level            multipath\n");
     348    } else if (raidrec->raid_level == -1) {
    347349        fprintf(fout, "    raid-level            linear\n");
    348350    } else {
     
    350352                raidrec->raid_level);
    351353    }
    352     fprintf(fout, "    chunk-size            %d\n", raidrec->chunk_size);
    353354    fprintf(fout, "    nr-raid-disks         %d\n",
    354355            raidrec->data_disks.entries);
    355     fprintf(fout, "    nr-spare-disks        %d\n",
    356             raidrec->spare_disks.entries);
     356    if (raidrec->spare_disks.entries > 0) {
     357        fprintf(fout, "    nr-spare-disks        %d\n",
     358                raidrec->spare_disks.entries);
     359    }
    357360    if (raidrec->parity_disks.entries > 0) {
    358361        fprintf(fout, "    nr-parity-disks       %d\n",
    359362                raidrec->parity_disks.entries);
    360363    }
    361 
    362364    fprintf(fout, "    persistent-superblock %d\n",
    363365            raidrec->persistent_superblock);
     366    if (raidrec->chunk_size > -1) {
     367      fprintf(fout, "    chunk-size            %d\n", raidrec->chunk_size);
     368    }
     369    if (raidrec->parity > -1) {
     370      switch(raidrec->parity) {
     371      case 0:
     372        fprintf(fout, "    parity-algorithm      left-asymmetric\n");
     373        break;
     374      case 1:
     375        fprintf(fout, "    parity-algorithm      right-asymmetric\n");
     376        break;
     377      case 2:
     378        fprintf(fout, "    parity-algorithm      left-symmetric\n");
     379        break;
     380      case 3:
     381        fprintf(fout, "    parity-algorithm      right-symmetric\n");
     382        break;
     383      default:
     384        fatal_error("Unknown RAID parity algorithm.");
     385        break;
     386      }
     387    }
    364388    save_additional_vars_to_file(&raidrec->additional_vars, fout);
    365389    fprintf(fout, "\n");
     
    642666
    643667    if (!strcmp(label, "raid-level")) {
    644         if (!strcmp(value, "linear")) {
     668        if (!strcmp(value, "multipath")) {
     669            raidrec->raid_level = -2;
     670        } else if (!strcmp(value, "linear")) {
    645671            raidrec->raid_level = -1;
    646672        } else {
     
    655681    } else if (!strcmp(label, "chunk-size")) {
    656682        raidrec->chunk_size = atoi(value);
     683    } else if (!strcmp(label, "parity-algorithm")) {
     684        if (!strcmp(value, "left-asymmetric")) {
     685            raidrec->parity = 0;
     686        } else if (!strcmp(value, "right-asymmetric")) {
     687            raidrec->parity = 1;
     688        } else if (!strcmp(value, "left-symmetric")) {
     689            raidrec->parity = 2;
     690        } else if (!strcmp(value, "right-symmetric")) {
     691            raidrec->parity = 3;
     692        } else {
     693            log_msg(1, "Unknown RAID parity algorithm '%s'\n.", value);
     694        }
    657695    } else if (!strcmp(label, "device")) {
    658696        get_next_raidtab_line(fin, labelB, valueB);
     
    898936
    899937
    900 int read_mdstat(struct s_mdstat *mdstat, char *mdstat_file)
    901 {
    902     FILE *fin;
    903     char *tmp;
    904     char *stub;
    905     char *incoming = NULL;
    906     char *p, *q, *r;
    907     int diskno;
    908     size_t n = 0;
    909 
    910     malloc_string(incoming);
    911     if (!(fin = fopen(mdstat_file, "r"))) {
    912         log_msg(1, "%s not found", mdstat_file);
     938int parse_mdstat(struct raidlist_itself *raidlist, char *device_prefix) {
     939
     940  const char delims[] = " ";
     941
     942  FILE   *fin;
     943  int    res = 0, row, i, index_min;
     944  int lastpos = 0;
     945  size_t len = 0;
     946  char   *token;
     947  char *string = NULL;
     948  char *pos;
     949  char type;
     950  char *strtmp;
     951
     952  // open file
     953  if (!(fin = fopen(MDSTAT_FILE, "r"))) {
     954    log_msg(1, "Could not open %s.\n", MDSTAT_FILE);
     955    return 1;
     956  }
     957  // initialise record, build progress and row counters
     958  raidlist->entries = 0;
     959  raidlist->el[raidlist->entries].progress = 999;
     960  row = 1;
     961  // skip first output row - contains registered RAID levels
     962  res = getline(&string, &len, fin);
     963  // parse the rest
     964  while ( !feof_unlocked(fin) ) {
     965    res = getline(&string, &len, fin);
     966    if (res <= 0) break;
     967    // trim leading spaces
     968    pos = string;
     969    while (*pos == ' ') *pos++;
     970    asprintf(&string, pos);
     971    //
     972    // if we have newline after only spaces, this is a blank line, update
     973    // counters, otherwise do normal parsing
     974    if (*string == '\n') {
     975      row = 1;
     976      raidlist->entries++;
     977      raidlist->el[raidlist->entries].progress = 999;
     978    } else {
     979      switch (row) {
     980      case 1:  // device information
     981    // check whether last line of record and if so skip
     982    pos = strcasestr(string, "unused devices: ");
     983    if (pos == string) {
     984      //raidlist->entries--;
     985      break;
     986    }
     987    // tokenise string
     988    token = mr_strtok (string, delims, &lastpos);
     989    // get RAID device name
     990    asprintf(&strtmp,"%s%s", device_prefix, token);
     991    strcpy(raidlist->el[raidlist->entries].raid_device, strtmp);
     992    paranoid_free(strtmp);
     993    paranoid_free(token);
     994    // skip ':' and status
     995    token = strtok (string, delims, &lastpos);
     996    paranoid_free(token);
     997    token = strtok (string, delims, &lastpos);
     998    if (!strcmp(token, "inactive")) {
     999      log_msg(1, "RAID device '%s' inactive.\n",
     1000         raidlist->el[raidlist->entries].raid_device);
     1001      paranoid_free(string);
     1002      paranoid_free(token);
     1003      return 1;
     1004    }
     1005    paranoid_free(token);
     1006
     1007    // get RAID level
     1008    token = strtok (string, delims, &lastpos);
     1009    if (!strcmp(token, "multipath")) {
     1010      raidlist->el[raidlist->entries].raid_level = -2;
     1011    } else if (!strcmp(token, "linear")) {
     1012      raidlist->el[raidlist->entries].raid_level = -1;
     1013    } else if (!strcmp(token, "raid0")) {
     1014      raidlist->el[raidlist->entries].raid_level = 0;
     1015    } else if (!strcmp(token, "raid1")) {
     1016      raidlist->el[raidlist->entries].raid_level = 1;
     1017    } else if (!strcmp(token, "raid4")) {
     1018      raidlist->el[raidlist->entries].raid_level = 4;
     1019    } else if (!strcmp(token, "raid5")) {
     1020      raidlist->el[raidlist->entries].raid_level = 5;
     1021    } else if (!strcmp(token, "raid6")) {
     1022      raidlist->el[raidlist->entries].raid_level = 6;
     1023    } else if (!strcmp(token, "raid10")) {
     1024      raidlist->el[raidlist->entries].raid_level = 10;
     1025    } else {
     1026      log_msg(1, "Unknown RAID level '%s'.\n", token);
     1027      paranoid_free(string);
     1028      paranoid_free(token);
     1029      return 1;
     1030    }
     1031    paranoid_free(token);
     1032
     1033    // get RAID devices (type, index, device)
     1034    // Note: parity disk for RAID4 is last normal disk, there is no '(P)'
     1035    raidlist->el[raidlist->entries].data_disks.entries = 0;
     1036    raidlist->el[raidlist->entries].spare_disks.entries = 0;
     1037    raidlist->el[raidlist->entries].failed_disks.entries = 0;
     1038    while((token = strtok (string, delims, &lastpos))) {
     1039      if ((pos = strstr(token, "("))) {
     1040        type = *(pos+1);
     1041      } else {
     1042        type = ' ';
     1043      }
     1044      pos = strstr(token, "[");
     1045      *pos = '\0';
     1046      switch(type) {
     1047      case ' ': // normal data disks
     1048        raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].index = atoi(pos + 1);
     1049        asprintf(&strtmp,"%s%s", device_prefix, token);
     1050        strcpy(raidlist->el[raidlist->entries].data_disks.el[raidlist->el[raidlist->entries].data_disks.entries].device, strtmp);
     1051        paranoid_free(strtmp);
     1052        raidlist->el[raidlist->entries].data_disks.entries++;
     1053        break;
     1054      case 'S': // spare disks
     1055        raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].index = atoi(pos + 1);
     1056        asprintf(&strtmp,"%s%s", device_prefix, token);
     1057        strcpy(raidlist->el[raidlist->entries].spare_disks.el[raidlist->el[raidlist->entries].spare_disks.entries].device, strtmp);
     1058        paranoid_free(strtmp);
     1059        raidlist->el[raidlist->entries].spare_disks.entries++;
     1060        break;
     1061      case 'F': // failed disks
     1062        raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].index = atoi(pos + 1);
     1063        asprintf(&strtmp,"%s%s", device_prefix, token);
     1064        strcpy(raidlist->el[raidlist->entries].failed_disks.el[raidlist->el[raidlist->entries].failed_disks.entries].device, strtmp);
     1065        paranoid_free(strtmp);
     1066        raidlist->el[raidlist->entries].failed_disks.entries++;
     1067        log_it("At least one failed disk found in RAID array.\n");
     1068        break;
     1069      default: // error
     1070        log_msg(1, "Unknown device type '%c'\n", type);
     1071        paranoid_free(string);
     1072        paranoid_free(token);
     1073        return 1;
     1074        break;
     1075      }
     1076      paranoid_free(token);
     1077    }
     1078
     1079    // adjust index for each device so that it starts with 0 for every type
     1080    index_min = 99;
     1081    for (i=0; i<raidlist->el[raidlist->entries].data_disks.entries;i++) {
     1082      if (raidlist->el[raidlist->entries].data_disks.el[i].index < index_min) {
     1083        index_min = raidlist->el[raidlist->entries].data_disks.el[i].index;
     1084      }
     1085    }
     1086    if (index_min > 0) {
     1087      for (i=0; i<raidlist->el[raidlist->entries].data_disks.entries;i++) {
     1088        raidlist->el[raidlist->entries].data_disks.el[i].index = raidlist->el[raidlist->entries].data_disks.el[i].index - index_min;   
     1089      }
     1090    }
     1091    index_min = 99;
     1092    for (i=0; i<raidlist->el[raidlist->entries].spare_disks.entries;i++) {
     1093      if (raidlist->el[raidlist->entries].spare_disks.el[i].index < index_min) {
     1094        index_min = raidlist->el[raidlist->entries].spare_disks.el[i].index;
     1095      }
     1096    }
     1097    if (index_min > 0) {
     1098      for (i=0; i<raidlist->el[raidlist->entries].spare_disks.entries;i++) {
     1099        raidlist->el[raidlist->entries].spare_disks.el[i].index = raidlist->el[raidlist->entries].spare_disks.el[i].index - index_min; 
     1100      }
     1101    }
     1102    index_min = 99;
     1103    for (i=0; i<raidlist->el[raidlist->entries].failed_disks.entries;i++) {
     1104      if (raidlist->el[raidlist->entries].failed_disks.el[i].index < index_min) {
     1105        index_min = raidlist->el[raidlist->entries].failed_disks.el[i].index;
     1106      }
     1107    }
     1108    if (index_min > 0) {
     1109      for (i=0; i<raidlist->el[raidlist->entries].failed_disks.entries;i++) {
     1110        raidlist->el[raidlist->entries].failed_disks.el[i].index = raidlist->el[raidlist->entries].failed_disks.el[i].index - index_min;   
     1111      }
     1112    }
     1113    break;
     1114      case 2:  // config information
     1115    // check for persistent super block
     1116    if (strcasestr(string, "super non-persistent")) {
     1117      raidlist->el[raidlist->entries].persistent_superblock = 0;
     1118    } else {
     1119      raidlist->el[raidlist->entries].persistent_superblock = 1;
     1120    }
     1121    // extract chunk size
     1122    if (!(pos = strcasestr(string, "k chunk"))) {
     1123      raidlist->el[raidlist->entries].chunk_size = -1;
     1124    } else {
     1125      while (*pos != ' ') {
     1126        *pos--;
     1127        if (pos < string) {
     1128          log_it("String underflow!\n");
     1129          paranoid_free(string);
     1130          return 1;
     1131        }
     1132      }
     1133      raidlist->el[raidlist->entries].chunk_size = atoi(pos + 1);
     1134    }
     1135    // extract parity if present
     1136    if ((pos = strcasestr(string, "algorithm"))) {
     1137      raidlist->el[raidlist->entries].parity = atoi(pos + 9);
     1138    } else {
     1139      raidlist->el[raidlist->entries].parity = -1;
     1140    }
     1141    break;
     1142      case 3:  // optional build status information
     1143    if (!(pos = strchr(string, '\%'))) {
     1144      if (strcasestr(string, "delayed")) {
     1145        raidlist->el[raidlist->entries].progress = -1;  // delayed (therefore, stuck at 0%)
     1146      } else {
     1147        raidlist->el[raidlist->entries].progress = 999; // not found
     1148      }
     1149    } else {
     1150      while (*pos != ' ') {
     1151        *pos--;
     1152        if (pos < string) {
     1153          printf("ERROR: String underflow!\n");
     1154          paranoid_free(string);
     1155          return 1;
     1156        }
     1157      }
     1158      raidlist->el[raidlist->entries].progress = atoi(pos);
     1159    }
     1160    break;
     1161      default: // error
     1162    log_msg(1, "Row %d should not occur in record!\n", row);
     1163    break;
     1164      }
     1165      row++;
     1166    }
     1167  }
     1168  // close file
     1169  fclose(fin);
     1170  // free string
     1171  paranoid_free(string);
     1172  // return success
     1173  return 0;
     1174
     1175}
     1176
     1177
     1178
     1179
     1180int create_raidtab_from_mdstat(char *raidtab_fname)
     1181{
     1182    struct raidlist_itself *raidlist;
     1183    int retval = 0;
     1184
     1185    raidlist = malloc(sizeof(struct raidlist_itself));
     1186
     1187    // FIXME: Prefix '/dev/' should really be dynamic!
     1188    if (parse_mdstat(raidlist, "/dev/")) {
     1189        log_to_screen("Sorry, cannot read %s", MDSTAT_FILE);
    9131190        return (1);
    9141191    }
    915     mdstat->entries = 0;
    916     for (getline(&incoming, &n, fin); !feof(fin);
    917          getline(&incoming, &n, fin)) {
    918         p = incoming;
    919         if (*p != 'm' && *(p + 1) == 'm') {
    920             p++;
    921         }
    922         if (strncmp(p, "md", 2)) {
    923             continue;
    924         }
    925 // read first line --- mdN : active raidX ............
    926         mdstat->el[mdstat->entries].md = atoi(p + 2);
    927         log_msg(8, "Storing /dev/md%d's info", atoi(p + 2));
    928         while (*p != ':' && *p) {
    929             p++;
    930         }
    931         while ((*p != 'r' || *(p + 1) != 'a') && *p) {
    932             p++;
    933         }
    934         if (!strncmp(p, "raid", 4)) {
    935             mdstat->el[mdstat->entries].raidlevel = *(p + 4) - '0';
    936         }
    937         p += 4;
    938         while (*p != ' ' && *p) {
    939             p++;
    940         }
    941         while (*p == ' ' && *p) {
    942             p++;
    943         }
    944         for (diskno = 0; *p; diskno++) {
    945             asprintf(&stub, "%s", p);
    946             q = strchr(stub, '[');
    947             if (q) {
    948                 *q = '\0';
    949                 q++;
    950                 r = strchr(q, ']');
    951                 if (r) {
    952                     *r = '\0';
    953                 }
    954                 mdstat->el[mdstat->entries].disks.el[diskno].index =
    955                     atoi(q);
    956             } else {
    957                 mdstat->el[mdstat->entries].disks.el[diskno].index = -1;
    958                 q = strchr(stub, ' ');
    959                 if (q) {
    960                     *q = '\0';
    961                 }
    962             }
    963             asprintf(&tmp, "/dev/%s", stub);
    964             paranoid_free(stub);
    965 
    966             log_msg(8, "/dev/md%d : disk#%d : %s (%d)",
    967                     mdstat->el[mdstat->entries].md, diskno, tmp,
    968                     mdstat->el[mdstat->entries].disks.el[diskno].index);
    969             strcpy(mdstat->el[mdstat->entries].disks.el[diskno].device,
    970                    tmp);
    971             paranoid_free(tmp);
    972 
    973             while (*p != ' ' && *p) {
    974                 p++;
    975             }
    976             while (*p == ' ' && *p) {
    977                 p++;
    978             }
    979         }
    980         mdstat->el[mdstat->entries].disks.entries = diskno;
    981 // next line --- skip it
    982         if (!feof(fin)) {
    983             getline(&incoming, &n, fin);
    984         } else {
    985             continue;
    986         }
    987 // next line --- the 'progress' line
    988         if (!feof(fin)) {
    989             getline(&incoming, &n, fin);
    990         } else {
    991             continue;
    992         }
    993 //  log_msg(1, "Percentage line = '%s'", incoming);
    994         if (!(p = strchr(incoming, '\%'))) {
    995             mdstat->el[mdstat->entries].progress = 999; // not found
    996         } else if (strstr(incoming, "DELAYED")) {
    997             mdstat->el[mdstat->entries].progress = -1;  // delayed (therefore, stuck at 0%)
    998         } else {
    999             for (*p = '\0'; *p != ' '; p--);
    1000             mdstat->el[mdstat->entries].progress = atoi(p);
    1001         }
    1002         log_msg(8, "progress =%d", mdstat->el[mdstat->entries].progress);
    1003         mdstat->entries++;
    1004     }
    1005     fclose(fin);
    1006     paranoid_free(incoming);
    1007     return (0);
    1008 }
    1009 
    1010 
    1011 
    1012 int create_raidtab_from_mdstat(char *raidtab_fname, char *mdstat_fname)
    1013 {
    1014     struct raidlist_itself *raidlist;
    1015     struct s_mdstat *mdstat;
    1016     int retval = 0;
    1017     int i;
    1018 
    1019     raidlist = malloc(sizeof(struct raidlist_itself));
    1020     mdstat = malloc(sizeof(struct s_mdstat));
    1021 
    1022     if (read_mdstat(mdstat, mdstat_fname)) {
    1023         log_to_screen("Sorry, cannot read %s", mdstat_fname);
    1024         return (1);
    1025     }
    1026 
    1027     for (i = 0; i < mdstat->entries; i++) {
    1028         sprintf(raidlist->el[i].raid_device, "/dev/md%d",
    1029                 mdstat->el[i].md);
    1030         raidlist->el[i].raid_level = mdstat->el[i].raidlevel;
    1031         raidlist->el[i].persistent_superblock = 1;
    1032         raidlist->el[i].chunk_size = 4;
    1033         memcpy((void *) &raidlist->el[i].data_disks,
    1034                (void *) &mdstat->el[i].disks,
    1035                sizeof(struct list_of_disks));
    1036         // FIXME --- the above line does not allow for spare disks
    1037         log_to_screen
    1038             (_("FIXME - create_raidtab_from_mdstat does not allow for spare disks"));
    1039     }
    1040     raidlist->entries = i;
     1192
    10411193    retval += save_raidlist_to_raidtab(raidlist, raidtab_fname);
    10421194    return (retval);
  • trunk/mondo/mondo/common/libmondo-raid.h

    r59 r561  
    4343#endif
    4444
    45 
    46 int create_raidtab_from_mdstat(char *, char *);
    47 int read_mdstat(struct s_mdstat *mdstat, char *mdstat_file);
    48 
    49 int create_raidtab_from_mdstat(char *raidtab_fname, char *mdstat_fname);
     45int create_raidtab_from_mdstat(char *raidtab_fname);
     46int parse_mdstat(struct raidlist_itself *raidlist, char *device_prefix);
  • trunk/mondo/mondo/common/libmondo-string.c

    r507 r561  
    22   $Id$
    33*/
    4 
    54
    65/**
     
    11391138}
    11401139
     1140
     1141/* New functions safe from a memory manageemnt point of view */
     1142/* Developped by Andree Leidenfrost */
     1143
     1144char *mr_strtok(char *instr, const char *delims, int *lastpos) {
     1145
     1146char *token = NULL;
     1147char *strptr = NULL;
     1148size_t pos1 = 0;
     1149size_t pos2 = 0;
     1150
     1151if (strlen(instr) <= *lastpos) {
     1152    *lastpos = 0;
     1153    return token;
     1154}
     1155
     1156strptr = instr + *lastpos;
     1157pos2 = strspn(strptr, delims);
     1158strptr += pos2;
     1159pos1 = strcspn(strptr, delims);
     1160token = malloc(sizeof(*token)*(pos1+1));
     1161strncpy(token, strptr, pos1);
     1162*lastpos = *lastpos + pos1 + pos2 + 1;
     1163
     1164return token;
     1165}
    11411166/* @} - end of stringGroup */
  • trunk/mondo/mondo/common/libmondo-string.h

    r59 r561  
    3434char *media_descriptor_string(t_bkptype);
    3535inline void turn_wildcard_chars_into_literal_chars(char *out, char *in);
     36
     37/* Valid external functions */
     38char *mr_strtok(char *instr, const char *delims, int *lastpos)
  • trunk/mondo/mondo/common/libmondo-tools.c

    r539 r561  
    282282    assert(raidrec != NULL);
    283283    raidrec->raid_device[0] = '\0';
    284     raidrec->raid_level = 0;
    285     raidrec->chunk_size = 4;
     284    raidrec->raid_level = -9;
    286285    raidrec->persistent_superblock = 1;
     286    raidrec->chunk_size = 64;
     287    raidrec->parity = -1;
    287288    raidrec->data_disks.entries = 0;
    288289    raidrec->spare_disks.entries = 0;
     
    994995        log_to_screen
    995996            (_("You have RAID partitions but no /etc/raidtab - creating one from /proc/mdstat"));
    996         create_raidtab_from_mdstat("/etc/raidtab", "/proc/mdstat");
     997        create_raidtab_from_mdstat("/etc/raidtab");
    997998    }
    998999
  • trunk/mondo/mondo/common/mondostructures.h

    r539 r561  
    133133   */
    134134    int index;
     135   
     136  /**
     137   * Type of disk.
     138   */
     139    char type;  // ' ' = data (default), S = spare, F = faulty
     140   
    135141};
    136142
     
    224230       */
    225231    int chunk_size;
     232   
     233      /**
     234       * The parity algorithm of this RAID device. (RAID5 only)
     235       */
     236    int parity; // 0=left-asymmetric, 1=right-asymmetric, 2=left-symmetric, 3=right-symmetric
    226237
    227238      /**
     
    249260       */
    250261    struct additional_raid_variables additional_vars;
     262
     263      /**
     264       * Resync progress for this device.
     265       */
     266    int progress;
    251267};
    252268
  • trunk/mondo/mondo/common/my-stuff.h

    r539 r561  
    2222 * The main header file for Mondo.
    2323 */
    24 #ifndef _MY_STUFF_H_
    25 #define _MY_STUFF_H_
    2624
    2725/* Required for the use of getline, ... */
    28 #define __USE_GNU
    2926#define _GNU_SOURCE
    3027
     
    8380#ifndef S_SPLINT_S
    8481#include <pthread.h>
     82#endif
    8583#include <assert.h>
    8684
     
    114112 */
    115113#define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg"
     114
     115/**
     116 * The RAID kernel proc file
     117 */
     118#define MDSTAT_FILE "/proc/mdstat"
    116119
    117120/**
     
    428431
    429432
    430 
    431433#endif                          /* _MY_STUFF_H_ */
  • trunk/mondo/mondo/mondorestore/mondo-prep.c

    r507 r561  
    695695
    696696/**
     697 * Create @p RAID device using information from @p structure.
     698 * This will create the specified RAID devive using information provided in
     699 * raidlist by means of the mdadm tool.
     700 * @param raidlist The structure containing all RAID information
     701 * @param device The RAID device to create.
     702 * @return 0 for success, nonzero for failure.
     703 */
     704int create_raid_device_via_mdadm(struct raidlist_itself *raidlist, char *device)
     705{
     706  /** int **************************************************************/
     707  int i   = 0;
     708  int j   = 0;
     709  int res = 0;
     710 
     711  /** buffers ***********************************************************/
     712  char *devices = NULL;
     713  char *strtmp  = NULL;
     714  char *level   = NULL;
     715  char *program = NULL;
     716 
     717  // leave straight away if raidlist is initial or has no entries
     718  if (!raidlist || raidlist->entries == 0) {
     719    log_msg(1, "No RAID arrays found.");
     720    return 1;
     721  } else {
     722    log_msg(1, "%d RAID arrays found.", raidlist->entries);
     723  }
     724  // find raidlist entry for requested device
     725  for (i = 0; i < raidlist->entries; i++) {
     726    if (!strcmp(raidlist->el[i].raid_device, device)) break;
     727  }
     728  // check whether RAID device was found in raidlist
     729  if (i == raidlist->entries) {
     730    log_msg(1, "RAID device %s not found in list.", device);
     731    return 1;
     732  }
     733  // create device list from normal disks followed by spare ones
     734  asprintf(&devices, raidlist->el[i].data_disks.el[0].device);
     735  for (j = 1; j < raidlist->el[i].data_disks.entries; j++) {
     736    asprintf(&strtmp, "%s", devices);
     737    paranoid_free(devices);
     738    asprintf(&devices, "%s %s", strtmp,
     739         raidlist->el[i].data_disks.el[j].device);
     740    paranoid_free(strtmp);
     741  }
     742  for (j = 0; j < raidlist->el[i].spare_disks.entries; j++) {
     743    asprintf(&strtmp, "%s", devices);
     744    paranoid_free(devices);
     745    asprintf(&devices, "%s %s", strtmp,
     746         raidlist->el[i].spare_disks.el[j].device);
     747    paranoid_free(strtmp);
     748  }
     749  // translate RAID level
     750  if (raidlist->el[i].raid_level == -2) {
     751    asprintf(&level, "multipath");
     752  } else if (raidlist->el[i].raid_level == -1) {
     753    asprintf(&level, "linear");
     754  } else {
     755    asprintf(&level, "raid%d", raidlist->el[i].raid_level);
     756  }
     757  // create RAID device:
     758  // - RAID device, number of devices and devices mandatory
     759  // - parity algorithm, chunk size and spare devices optional
     760  // - faulty devices ignored
     761  // - persistent superblock always used as this is recommended
     762  asprintf(&program,
     763       "mdadm --create --force --run --auto=yes %s --level=%s --raid-devices=%d",
     764       raidlist->el[i].raid_device, level,
     765       raidlist->el[i].data_disks.entries);
     766  if (raidlist->el[i].parity != -1) {
     767    asprintf(&strtmp, "%s", program);
     768    paranoid_free(program);
     769    switch(raidlist->el[i].parity) {
     770    case 0:
     771      asprintf(&program, "%s --parity=%s", strtmp, "la");
     772      break;
     773    case 1:
     774      asprintf(&program, "%s --parity=%s", strtmp, "ra");
     775      break;
     776    case 2:
     777      asprintf(&program, "%s --parity=%s", strtmp, "ls");
     778      break;
     779    case 3:
     780      asprintf(&program, "%s --parity=%s", strtmp, "rs");
     781      break;
     782    default:
     783      fatal_error("Unknown RAID parity algorithm.");
     784      break;
     785    }
     786    paranoid_free(strtmp);
     787  }
     788  if (raidlist->el[i].chunk_size != -1) {
     789    asprintf(&strtmp, "%s", program);
     790    paranoid_free(program);
     791    asprintf(&program, "%s --chunk=%d", strtmp, raidlist->el[i].chunk_size);
     792    paranoid_free(strtmp);
     793  }
     794  if (raidlist->el[i].spare_disks.entries > 0) {
     795    asprintf(&strtmp, "%s", program);
     796    paranoid_free(program);
     797    asprintf(&program, "%s --spare-devices=%d", strtmp,
     798         raidlist->el[i].spare_disks.entries);
     799    paranoid_free(strtmp);
     800  }
     801  asprintf(&strtmp, "%s", program);
     802  paranoid_free(program);
     803  asprintf(&program, "%s %s", strtmp, devices);
     804  paranoid_free(strtmp);
     805  res = run_program_and_log_output(program, 1);
     806  // free memory
     807  paranoid_free(devices);
     808  paranoid_free(level);
     809  paranoid_free(program);
     810  // return to calling instance
     811  return res;
     812}
     813
     814
     815/**
    697816 * Format @p device as a @p format filesystem.
    698817 * This will use the format command returned by which_format_command_do_i_need().
     
    704823 * @return 0 for success, nonzero for failure.
    705824 */
    706 int format_device(char *device, char *format)
     825int format_device(char *device, char *format, struct raidlist_itself *raidlist)
    707826{
    708827    /** int **************************************************************/
     
    836955
    837956        log_msg(1, "Making %s", device);
    838         sprintf(program, "mkraid --really-force %s", device);
    839         res = run_program_and_log_output(program, 1);
    840         log_msg(1, "%s returned %d", program, res);
    841         system("sync");
    842         sleep(3);
    843         start_raid_device(device);
    844         if (g_fprep) {
    845             fprintf(g_fprep, "%s\n", program);
     957        // use mkraid if it exists, otherwise use mdadm
     958        if (run_program_and_log_output("which mkraid", FALSE)) {
     959            res = create_raid_device_via_mdadm(raidlist, device);
     960            log_msg(1, "Creating RAID device %s via mdadm returned %d", device, res);
     961        } else {
     962            sprintf(program, "mkraid --really-force %s", device);
     963            res = run_program_and_log_output(program, 1);
     964            log_msg(1, "%s returned %d", program, res);
     965            system("sync");
     966            sleep(3);
     967            start_raid_device(device);
     968            if (g_fprep) {
     969                fprintf(g_fprep, "%s\n", program);
     970            }
    846971        }
    847972        system("sync");
    848973        sleep(2);
    849 
    850974//      log_to_screen("Starting %s", device);
    851975//      sprintf(program, "raidstart %s", device);
     
    853977//      log_msg(1, "%s returned %d", program, res);
    854978//      system("sync"); sleep(1);
    855         if (g_fprep) {
    856             fprintf(g_fprep, "%s\n", program);
    857         }
    858979#endif
    859980        system("sync");
     
    9231044 * @return The number of errors encountered (0 for success).
    9241045 */
    925 int format_everything(struct mountlist_itself *mountlist,
    926                       bool interactively)
     1046int format_everything(struct mountlist_itself *mountlist, bool interactively,
     1047                          struct raidlist_itself *raidlist)
    9271048{
    9281049    /** int **************************************************************/
     
    9831104            if (do_it) {
    9841105                // NB: format_device() also stops/starts RAID device if necessary
    985                 retval += format_device(me->device, me->format);
     1106                retval += format_device(me->device, me->format, raidlist);
    9861107            }
    9871108            g_current_progress += progress_step;
     
    10001121    log_msg(1, "Creating LVMs");
    10011122    if (does_file_exist("/tmp/i-want-my-lvm")) {
    1002         wait_until_software_raids_are_prepped("/proc/mdstat", 10);
     1123        wait_until_software_raids_are_prepped("/proc/mdstat", 100);
    10031124        log_to_screen(_("Configuring LVM"));
    10041125        if (!g_text_mode) {
     
    10761197
    10771198            if (do_it)
    1078                 retval += format_device(me->device, me->format);
     1199                retval += format_device(me->device, me->format, raidlist);
    10791200        }
    10801201
     
    22462367    sprintf(program, "vinum stop -f %s", raid_device);
    22472368#else
    2248     sprintf(program, "raidstop %s", raid_device);
    2249 //      sprintf (program, "raidstop " RAID_DEVICE_STUB "*");
     2369    // use raidstop if it exists, otherwise use mdadm
     2370    if (run_program_and_log_output("which raidstop", FALSE)) {
     2371        sprintf(program, "mdadm -S %s", raid_device);
     2372    } else {
     2373        sprintf(program, "raidstop %s", raid_device);
     2374    }
    22502375#endif
    22512376    log_msg(1, "program = %s", program);
  • trunk/mondo/mondo/mondorestore/mondo-restore.c

    r507 r561  
    839839                    }
    840840
    841                     fmt_errs = format_everything(mountlist, FALSE);
     841                    fmt_errs = format_everything(mountlist, FALSE, raidlist);
    842842                    if (!fmt_errs) {
    843843                        log_to_screen
     
    857857                if (ask_me_yes_or_no
    858858                    (_("Do you want to format your hard drives?"))) {
    859                     fmt_errs = format_everything(mountlist, TRUE);
     859                    fmt_errs = format_everything(mountlist, TRUE, raidlist);
    860860                    if (!fmt_errs) {
    861861                        done = TRUE;
     
    11641164                system("sync");
    11651165                log_to_screen(_("Please wait. This may take a few minutes."));
    1166                 res += format_everything(mountlist, FALSE);
     1166                res += format_everything(mountlist, FALSE, raidlist);
    11671167            }
    11681168            paranoid_fclose(g_fprep);
     
    34253425    }
    34263426
    3427     if (argc == 4 && strcmp(argv[1], "--mdconv") == 0) {
    3428         finish(create_raidtab_from_mdstat(argv[2], argv[3]));
     3427    if (argc == 3 && strcmp(argv[1], "--mdconv") == 0) {
     3428        finish(create_raidtab_from_mdstat(argv[2]));
    34293429    }
    34303430
     
    35253525            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
    35263526            load_mountlist(mountlist, g_mountlist_fname);
    3527             res = format_everything(mountlist, FALSE);
     3527            res = format_everything(mountlist, FALSE, raidlist);
    35283528            finish(res);
    35293529        }
  • 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}
  • trunk/mondo/mondo/mondorestore/mondoprep.h

    r59 r561  
    5858int start_all_raid_devices(struct mountlist_itself *);
    5959int stop_all_raid_devices(struct mountlist_itself *);
    60 int format_everything(struct mountlist_itself *, bool);
     60int format_everything(struct mountlist_itself *, bool, struct raidlist_itself *);
    6161int partition_device(FILE *, const char *, int, int, const char *,
    6262                     long long);
     
    6565int partition_device_with_fdisk(FILE *, const char *, int, int,
    6666                                const char *, long long);
    67 int format_device(char *, char *);
     67int format_device(char *, char *, struct raidlist_itself *);
    6868int partition_drive(struct mountlist_itself *, char *);
    6969int partition_everything(struct mountlist_itself *);
  • trunk/mondo/mondo/mondorestore/mr-externs.h

    r127 r561  
    2727extern int edit_mountlist(char *mountlist_fname, struct mountlist_itself *,
    2828                          struct raidlist_itself *);
    29 extern int format_everything(struct mountlist_itself *, bool);
    30 extern int format_device(char *, char *);
     29extern int format_everything(struct mountlist_itself *, bool, struct raidlist_itself *);
     30extern int format_device(char *, char *, struct raidlist_itself *);
    3131extern void finish(int);
    3232extern void free_filelist(struct s_node *);
  • trunk/mondo/mondo/test/mktest

    r532 r561  
    55# test script for library functions
    66#
    7     gcc -O2 -I../common test-conf.c ../common/libmondo-conf.c ../common/libmondo-msg.c -o test-conf
     7
     8gcc -O2 -I../common test-conf.c ../common/libmondo-conf.c ../common/libmondo-msg.c -o test-conf
     9gcc -O2 -I../common test-string.c ../common/libmondo-string.c ../common/libmondo-msg.c -o test-string
     10
    811for f in "test-conf"; do
    912    chmod 755 $f
  • trunk/tools/common-env

    r320 r561  
    11#!/bin/bash
    22#
    3 # Creates common environment from SVN repository
     3# Creates common environment
    44#
    55# $Id$
     
    88# Adapt to your needs
    99export BASE=${HOME}/mondo
    10 
    11 # Should not be modified below
    12 dname=`dirname $0`
    13 export VER="branches/`cat $dname/../mondo/VERSION`"
     10export TOPDIR=${BASE}/build
     11mkdir -p ${TOPDIR}
    1412export TMP=${BASE}/tmp
    1513mkdir -p ${TMP}
    16 
    17 export MINDI_VER=`cat ${BASE}/svn/${VER}/mindi/VERSION`
    18 export MONDO_VER=`cat ${BASE}/svn/${VER}/mondo/VERSION`
    19 
    20 # To be safe for SVN commands
    21 cd $TOOLHOME/..
    22 export REVISION=`$TOOLHOME/mksvnversion`
  • trunk/tools/livwww

    r518 r561  
    5555fi
    5656
    57 svn export $optsvn ${VER}/website $LOCALDIR
     57svn export $optsvn ${SVNBRANCH}/website $LOCALDIR
    5858
    5959if [ $force -eq 1 ]; then
     
    6262fi
    6363
    64 svn export $optsvn ${VER}/documentation $LOCALDOC
     64svn export $optsvn ${SVNBRANCH}/mondo-doc $LOCALDOC
    6565
    6666#
  • trunk/tools/mkdeliv

    r537 r561  
    2020fi
    2121
     22. $TOOLHOME/common-env
     23. $TOOLHOME/svn-env
    2224. $TOOLHOME/rpm-env
    2325
  • trunk/tools/mkqemu

    r537 r561  
    33# $Id$
    44#
    5 # Script allowing mondo packages production on various distributions with qemu
     5# Call virtual machine with qemu
    66#
    77
    88if [ _"$1" == _"" ]; then
    9     echo "Syntax: mkqemu [mondo version] ([vm].. )"
     9    echo "Syntax: qemu vm"
    1010    exit -1
     11else
     12    m=$1
    1113fi
    1214
    13 if [ _"$2" == _"" ]; then
    14     export SVN_VM="mdk101 mdk102 mdv2006 rh73 rh9 fc4 fc5 rhel3 rhel4 suse10 sles9 debian31 slackware102 gentoo"
    15 else
    16     export SVN_VM="$2"
    17 fi
     15ipvm=10.0.2.15
     16sp=2222
    1817
    19 cat > /tmp/mkmondo << EOF
    20 #!/bin/bash
    21 
    22 export SVN_HOME=\$HOME/mondo/svn/branches
    23 export SVN_SSH="ssh -l bcornec"
    24 export SVN_EDITOR=vim
    25 export LANG="C"
    26 export LANGUAGE="C"
    27 export LC_ALL="C"
    28 
    29 if [ -d \$SVN_HOME/$1 ]; then
    30     cd \$SVN_HOME/$1
    31     svn up
    32     if [ \$? != 0 ]; then
    33             echo "Verify SVN installation"
    34             exit -1
    35     fi
    36 else
    37     mkdir -p \$SVN_HOME
    38     cd \$SVN_HOME
    39     svn co svn+ssh://bcornec@svn.berlios.de/svnroot/repos/mondorescue/branches/$1 $1
    40     if [ \$? != 0 ]; then
    41             echo "Verify SVN installation"
    42             exit -1
    43     fi
    44 fi
    45 echo \$SVN_VM | grep -q "debian"
    46 if [ \$? -eq 0 ]; then
    47     \$SVN_HOME/$1/tools/mkdeb < /dev/null
    48 else
    49     echo \$SVN_VM | grep -q "slack"
    50     if [ \$? -eq 0 ]; then
    51         \$SVN_HOME/$1/tools/mkslack < /dev/null
    52     else
    53         echo \$SVN_VM | grep -q "gentoo"
    54         if [ \$? -eq 0 ]; then
    55             \$SVN_HOME/$1/tools/mkemerge < /dev/null
    56         else
    57             \$SVN_HOME/$1/tools/mkrpm < /dev/null
    58         fi
    59     fi
    60 fi
    61 \$SVN_HOME/$1/tools/mkdeliv
    62 EOF
    63 
    64 ipvm=10.0.2.15
    65 
    66 for m in $SVN_VM; do
    67     sp=22`host $m.mondo.musique-ancienne.org | cut -d. -f7`
    68     vmp=0
    69     if [ ! -f /users/vmplayer/$m.qemu ]; then
    70             echo "VM unaccessible. Verify NFS mount"
    71             exit -1
    72     fi
    73     ps auxww | grep qemu | grep -v grep | grep -q /users/vmplayer/$m.qemu
    74     if [ $? -ne 0 ]; then
    75         # Virtual machine alreday started
    76         vmp=1
    77         qemu -m 256 $QEMUOPT -redir tcp:${sp}:${ipvm}:22 /users/vmplayer/$m.qemu &
    78         sleep 300
    79     fi
    80     scp -P $sp /tmp/mkmondo bruno@localhost:
    81     ssh -p $sp bruno@localhost "chmod 755 ./mkmondo ; ./mkmondo" | tee /tmp/mkvm.log
    82     if [ $vmp -eq 1 ]; then
    83         ssh -p $sp root@localhost "halt -p"
    84         sleep 300
    85         proces=`ps auxww | grep qemu | grep -v grep | grep -q /users/vmplayer/$m.qemu | awk '{print $2}'`
    86         if [ "$proces" != "" ]; then
    87             kill $proces
    88         fi
    89     fi
    90 done
     18qemu -m 256 $QEMUOPT -redir tcp:${sp}:${ipvm}:22 /users/qemu/$m.qemu
  • trunk/website/latest-news.html

    r489 r561  
    44mondo 2.0.7 / mindi 1.0.7 aka r460
    55</p>
    6 
    76<p>
    87Now available at ftp://ftp.mondorescue.org/
     
    141140- stop creating further size of floppy disks if the smaller one succeeds (Bruno Cornec)<br>
    142141</p>
    143 
    144 <p><B>2006-02-21 </B>Mondo Rescue has a new Web site</p>
    145 <p>Thanks to <a href="http://www.73lab.com">Ayo</a>'s authorization, and after 2 weeks of hard work, we are proud to announce that we now have a new and updated Web site. We hope it will be useful and wait for your feedback.</p>
    146 <p>You may find it at <a href="http://www.mondorescue.org">http://www.mondorescue.org</a> (IP: 213.30.161.23)</p>
    147 <p><B>2006-02-05 </B>Mondo Rescue referenced by HP</p>
    148 <p>Mondorescue has been officially referenced by the HP OpenSource Portal:
    149 <a href="http://opensource.hp.com/index.php">http://opensource.hp.com/index.php</a> (look in the "Recently released" area)</p>
    150 
Note: See TracChangeset for help on using the changeset viewer.