Changeset 1914


Ignore:
Timestamp:
Apr 15, 2008, 2:24:58 AM (11 years ago)
Author:
bruno
Message:
  • Complete removal of cp --parents. Now using tar everywhere
  • uncompress kernel modules only when not using udev
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mindi/mindi

    r1913 r1914  
    4040TMPDIR=/tmp
    4141
    42 EXTRA_SPACE=32768       # increase if you run out of ramdisk space
     42EXTRA_SPACE=49152       # increase if you run out of ramdisk space
    4343BOOT_SIZE=16384         # size of the boot disk
    4444MAX_DISKS=99
     
    168168
    169169    mkdir -p $bigdir/etc
    170     cp --parents -pRdf $mappath $bigdir 2>> $LOGFILE || LogIt "AKMF -- Could not copy $mappath to $bigdir"
     170    #cp --parents -pRdf $mappath $bigdir 2>> $LOGFILE || LogIt "AKMF -- Could not copy $mappath to $bigdir"
     171    tar cf - $mappath 2>> $LOGFILE | (cd $bigdir ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir"
    171172    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    172173        included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     
    203204    [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"
    204205    [ "`echo "$filename" | grep -F "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-"
    205     if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then
     206
     207    # Uncompress modules only if not using udevd
     208    if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    206209        mv $scratchfile $scratchfile.gz
    207210        gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz"
     
    275278                BIGNO=$(($BIGNO+1))
    276279            else
    277                 cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
    278                 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] ; then
     280                #cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
     281                tar cf - $incoming 2> /dev/null | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
     282   
     283                # Only uncompress modules if not using udevd
     284                if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    279285                    gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming"
    280286                fi
     
    20592065        cd $MINDI_TMP
    20602066        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    2061             cp --parents -pRdf ./$i $bigdir 2>> $LOGFILE || Die "PDDI can't cp $i->$bigdir"
     2067            #cp --parents -pRdf ./$i $bigdir 2>> $LOGFILE || Die "PDDI can't cp $i->$bigdir"
     2068            tar cf - ./$i 2>> $LOGFILE | (cd $bigdir ; tar xf -) || Die "PDDI can't copy $i->$bigdir"
    20622069            if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
    2063                 cp --parents -pRdf $i $bigdir 2>> $LOGFILE
     2070                #cp --parents -pRdf $i $bigdir 2>> $LOGFILE
     2071                tar cf - $i 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    20642072            else
    20652073                ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
     
    20722080            for k in $j ; do
    20732081                if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
    2074                     cp --parents -pRdf $k $bigdir 2>> $LOGFILE
     2082                    #cp --parents -pRdf $k $bigdir 2>> $LOGFILE
     2083                    tar cf - $k 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    20752084                else
    20762085                    ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
     
    21312140        [ "$?" -ne "0" ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
    21322141    fi
    2133     [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2>> $LOGFILE
     2142    #[ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state . 2>> $LOGFILE
     2143    [ -d "/lib/dev-state" ] && tar cf - /lib/dev-state 2>> $LOGFILE | tar xf -
    21342144    cd $old_pwd
    21352145    echo -e "$DONE"
     
    24372447    cp -Rdf $tgz_dir_fname/* . 2>&1 >> $LOGFILE
    24382448    tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz"
     2449
    24392450    cd dev || Die "Can't cd to dev"
    24402451    tar -zxf dev-entries.tgz || Die "Cannot untar dev-entries.tgz"
     
    24502461    done
    24512462
    2452     mkdir -p tmp
    24532463    [ -e "/dev/.devfsd" ] && echo "/dev/.devfsd found" > tmp/USE-DEVFS
    24542464
     
    24642474    fi
    24652475
     2476    mkdir -p $mountpoint/tmp
    24662477    # Management of udev (which includes modprobe in rules)
    24672478    ps auxww | grep -v grep | grep -qw udevd
    24682479    if [ $? -eq 0 ]; then
    2469         echo "udev device manager found" > tmp/USE-UDEV
     2480        echo "udev device manager found" > $mountpoint/tmp/USE-UDEV
    24702481        LogIt "udev device manager found"
    24712482        #cp --parents -Rdf /etc/udev . 2> /dev/null
     
    25062517            echo "udevd daemon not in standard place (/sbin)" 2>&1 | tee -a $LOGFILE
    25072518            echo "mindi will use static devices which may cause problems" 2>&1 | tee -a $LOGFILE
    2508             rm -f tmp/USE-UDEV
     2519            rm -f $mountpoint/tmp/USE-UDEV
    25092520        fi
    25102521    fi
     
    25792590        needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`"
    25802591    done
     2592
    25812593    for i in $needed_modules ; do
    25822594        [ -e "$i" ] && s=`du -sk $i | cut -f1` || s=""
     
    25852597        #cp --parents -Rpdf $i $mountpoint 2>/dev/null || LogIt "Unable to copy $i to $mountpoint"
    25862598        tar cf - $i 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy $i to $mountpoint"
    2587         # Uncompress modules if not useing udev and native modprobe
     2599        # Uncompress modules if not using udev and native modprobe
    25882600        if [ ! -f $mountpoint/tmp/USE-UDEV ]; then
    25892601            if [ "`echo "$i" | grep -F ".gz"`" ]; then
     2602                echo "Uncompressing $i" >> $LOGFILE
    25902603                gunzip -f $mountpoint/$i
    2591                 #i=`echo $i | sed 's/.gz//'`
    25922604            fi
    25932605        fi
     
    25982610    tar cf - /$needed_modules_path/modules.dep 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint"
    25992611
    2600     # For all modules supported, create symlinks under the mountpoint
    2601     for i in $EXTRA_MODS $NET_MODS $SCSI_MODS; do
    2602         all_modules="$all_modules `FindSpecificModuleInPath $mountpoint $i | sed 's~^$mountpoint/~~g'`"
    2603     done
    26042612    if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
    26052613        echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE
     
    26122620    dd if=/dev/zero of=$mountpoint/zero &> /dev/null
    26132621    rm -f $mountpoint/zero
    2614     mkdir -p $mountpoint/tmp
    26152622    if [ _"$MONDO_SHARE" != _"" ]; then
    26162623        MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg
Note: See TracChangeset for help on using the changeset viewer.