Changeset 1989 in MondoRescue for branches/2.2.7


Ignore:
Timestamp:
Jun 22, 2008, 10:17:59 PM (16 years ago)
Author:
Bruno Cornec
Message:
  • Rwmove ChopUpAndCopyFile in mindi
  • mindi doesn't use slices anymore (no need as no floppy anymore)
  • Removal of sone useless scripts under restore-scripts/mondo
Location:
branches/2.2.7
Files:
6 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.7/mindi/install.sh

    r1983 r1989  
    6969
    7070echo "Creating target directories ..."
    71 install -m 755 -d $conf $locallib/mindi $MANDIR $local/sbin $CACHEDIR # $DOCDIR
     71install -m 755 -d $conf $locallib/mindi $MANDIR $local/sbin $CACHEDIR
    7272
    7373echo "Copying files ..."
     
    112112fi
    113113
    114 # Special case for SuSE family where doc is put elsewhere in the RPM
    115 # if [ -e /etc/SuSE-release ]; then
    116     # rm -rf $DOCDIR
    117 # fi
    118 
    119 # Special case for Debian family where doc is put elsewhere in the DEB
    120 # if [ -e /etc/debian_version ]; then
    121     # rm -rf $DOCDIR
    122 # fi
    123 
    124114exit 0
  • branches/2.2.7/mindi/mindi

    r1986 r1989  
    160160
    161161
    162 ChopUpAndCopyFile() {
    163     local filename slicesize outdir res biggienumber filesize sliceno noof_slices testfile scratchfile
    164     filename=$1
    165     outdir=$2
    166     slicesize=$3
    167     biggienumber=$4
    168 
    169     [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend $DEPLIST_FILE accordingly."
    170     mkdir -p $outdir
    171 
    172     sliceno=0
    173     scratchfile=$MINDI_TMP/blah.$$.dat
    174     cp -f $filename $scratchfile 2>> $LOGFILE || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?"
    175     [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"
    176     [ "`echo "$filename" | grep -F "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-"
    177 
    178     # Uncompress modules only if not using udevd
    179     if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    180         mv $scratchfile $scratchfile.gz
    181         gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz"
    182         filename=`echo "$filename" | tr '.' '#' | sed s/#o#gz/#o/ | sed s/#ko#gz/#ko/ | tr '#' '.'`
    183     fi
    184     filesize=`du -sk $scratchfile | cut -f1`
    185     noof_slices=$(($filesize/$slicesize))
    186     echo "$filename" > $outdir/slice-$biggienumber.name
    187     echo "$filesize" > $outdir/slice-$biggienumber.size
    188     [ -x "$scratchfile" ] && StripExecutable $scratchfile "-$filename-"
    189     while [ "$sliceno" -le "$noof_slices" ] ; do
    190         dd if=$scratchfile skip=$(($sliceno*$slicesize)) of=$outdir/slice-$biggienumber.`printf "%03d" $sliceno` bs=1k count=$slicesize &> /dev/null
    191         sliceno=$(($sliceno+1))
    192     done
    193     rm -f $scratchfile
    194 }
    195 
    196 
    197162CopyDependenciesToDirectory() {
    198     local outdir incoming fname filesize counter d found
     163    local outdir incoming fname counter d found
    199164    outdir=$1
    200165    mkdir -p $outdir
     
    218183            find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir
    219184        elif [ -e "$incoming" ] && [ $found = "false" ]; then
    220             filesize=`du -sk $incoming | cut -f1`
    221             if [ "$filesize" -gt "$(($CHOPSIZE*2))" ] && [ ! -h "$incoming" ] ; then
    222                 ChopUpAndCopyFile $incoming $outdir $CHOPSIZE $BIGNO
    223                 BIGNO=$(($BIGNO+1))
    224             else
    225                 tar cf - $incoming 2> /dev/null | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
    226    
    227                 # Only uncompress modules if not using udevd
    228                 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    229                     gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming"
    230                 fi
    231                 [ -x "$outdir" ] && StripExecutable $outdir "-$filename-"
     185            tar cf - $incoming 2> /dev/null | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
     186
     187            # Only uncompress modules if not using udevd
     188            if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
     189                gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming"
    232190            fi
     191            [ -x "$outdir" ] && StripExecutable $outdir "-$filename-"
    233192            counter=$(($counter+1))
    234193            if [ "$counter" -ge "5" ] ; then
     
    18081767        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    18091768            tar cf - ./$i 2>> $LOGFILE | (cd $bigdir ; tar xf -) || Die "PDDI can't copy $i->$bigdir"
    1810             if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
    1811                 tar cf - $i 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    1812             else
    1813                 ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
    1814                 BIGNO=$(($BIGNO+1))
    1815             fi
    18161769        done
    18171770        for i in $EXTRA_MODS ; do
     
    18191772            [ ! "$j" ] && echo "WARNING - cannot find failsafe module $i.o.gz" >> $LOGFILE
    18201773            for k in $j ; do
    1821                 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
    1822                     tar cf - $k 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    1823                 else
    1824                     ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
    1825                     BIGNO=$(($BIGNO+1))
    1826                 fi
     1774                tar cf - $k 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    18271775                echo "Added failsafe module $k to ramdisk" >> $LOGFILE
    18281776            done
     
    24842432trap "Aborted" SIGTERM
    24852433DONE="\r\t\t\t\t\t\t\t\tDone.         "
    2486 CHOPSIZE=240
    2487 BIGNO=0
    2488 MAX_COMPRESSED_SIZE=1300
    24892434kernelpath=""
    24902435MONDO_ROOT=/var/cache/mondo
     
    25592504fi
    25602505
    2561 if [ "$#" -ge "2" ] ; then
    2562     if [ "$1" = "--max-compressed-size" ] ; then
    2563         MAX_COMPRESSED_SIZE=$2
    2564         shift; shift
    2565     fi
    2566 fi
    2567 
    25682506FLOPPY_WAS_MOUNTED=""
    25692507for mtpt in /media/floppy /mnt/floppy /floppy ; do
  • branches/2.2.7/mindi/rootfs/sbin/install-additional-tools

    r1902 r1989  
    5050fi
    5151
    52 LogIt "Recombining large files..." 1
    53 biggienumber=0
    54 while [ -e "$mountdir/slice-$biggienumber.name" ] ; do
    55     stub=$mountdir/slice-$biggienumber
    56     biggiefname=`cat $stub.name`
    57     if [ -f $biggiefname ]; then
    58         LogIt "$biggiefname already exists - skipped" 1
    59         biggienumber=$(($biggienumber+1))
    60         continue
    61     fi
    62     biggiefsize=`cat $stub.size`
    63     rm -f $stub.name $stub.size
    64     > /tmp/out.dat
    65     sliceno=0
    66     while [ "$sliceno" -le "999" ] ; do
    67         slicefile=$stub.
    68         [ "$sliceno" -lt "100" ] && slicefile="$slicefile"0
    69         [ "$sliceno" -lt "10" ]  && slicefile="$slicefile"0
    70         slicefile="$slicefile"$sliceno
    71         [ ! -e "$slicefile" ] && break
    72         cat $slicefile >> /tmp/out.dat
    73         rm -f $slicefile
    74         sliceno=$(($sliceno+1))
    75         done
    76 
    77     LogIt "$biggiefname ($biggiefsize KB) restored. $sliceno slices." 1
    78 
    79     mkdir -p $biggiefname
    80     rmdir $biggiefname 2> /dev/null
    81     chmod +x /tmp/out.dat
    82     cp -f /tmp/out.dat $biggiefname
    83     rm -f /tmp/out.dat
    84     biggienumber=$(($biggienumber+1))
    85 done
    86 rm -f /slice*
    87 
    8852LogIt "Populating / with tar file content..." 1
    8953
  • branches/2.2.7/mindi/rootfs/sbin/post-init

    r1983 r1989  
    151151        if which mondorestore > /dev/null 2> /dev/null ; then
    152152            LogIt "Type 'mondorestore' to begin the restore/compare process." 1
    153             loc=`which ISO 2> /dev/null`
    154153        fi
    155154    fi
  • branches/2.2.7/mondo/configure.in

    r1930 r1989  
    120120AC_CHECK_FUNCS([bzero getcwd memmove memset mkdir mkfifo setenv strcasecmp strchr strerror strrchr strstr mkdtemp])
    121121
    122 AC_OUTPUT([Makefile src/Makefile src/common/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/restore-scripts/usr/Makefile src/restore-scripts/usr/bin/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile])
     122AC_OUTPUT([Makefile src/Makefile src/common/Makefile src/mondoarchive/Makefile src/mondorestore/Makefile src/restore-scripts/Makefile src/restore-scripts/mondo/Makefile src/post-nuke.sample/Makefile src/post-nuke.sample/usr/Makefile src/post-nuke.sample/usr/bin/Makefile])
  • branches/2.2.7/mondo/src/restore-scripts/Makefile.am

    r916 r1989  
    1 SUBDIRS = mondo usr
     1SUBDIRS = mondo
    22
    33restoreetcdir       = $(pkgdatadir)/restore-scripts/etc
  • branches/2.2.7/mondo/src/restore-scripts/mondo/Makefile.am

    r1983 r1989  
    11restoremondodir = $(pkgdatadir)/restore-scripts/mondo
    2 restoremondo_SCRIPTS = ISO ask-me-a-question compare-subroutine-me \
    3                         edit-mountlist grub-MR hack-fstab hack-grub hack-lilo hack-elilo \
     2restoremondo_SCRIPTS = grub-MR hack-fstab hack-grub hack-lilo hack-elilo \
    43                        label-partitions-as-necessary \
    54                        make-me-bootable mount-me mount-subroutine-me raw-MR \
    6                         restore-bigfiles-from-iso stabgrub-me stablilo-me stabelilo-me \
     5                        stabgrub-me stablilo-me stabelilo-me \
    76                        stabraw-me unmount-me unmount-subroutine-me
    87                        format-and-kludge-vfat
Note: See TracChangeset for help on using the changeset viewer.