Changeset 539 in MondoRescue for trunk/mindi/mindi


Ignore:
Timestamp:
May 13, 2006, 7:38:44 PM (18 years ago)
Author:
bcornec
Message:

merge -r 534:538 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/mindi

    r527 r539  
    7979# TBC
    8080if [ "$mindi_images_dir" == "" ]; then
    81     CACHE_LOC="/var/cache/mindi"
     81    CACHEDIR="/var/cache/mindi"
    8282else
    83     CACHE_LOC="$mindi_images_dir"
     83    CACHEDIR="$mindi_images_dir"
    8484fi
    8585if [ "$mindi_dual_floppies" == "" ]; then
     
    219219Aborted() {
    220220    trap SIGHUP SIGTERM SIGTRAP SIGINT
    221     [ "$imagesdir" != "" ] && rm -f $imagesdir/mindi*img $imagesdir/*gz $imagesdir/mindi.iso
     221    rm -f $CACHEDIR/mindi*img $CACHEDIR/*gz $CACHEDIR/mindi.iso
    222222    [ "$minidir_root" != "" ] && rm -Rf $minidir_root/*
    223223    Die "User abort."
     
    510510    if [ "$?" -ne "0" ] ; then
    511511    umount $mountpoint
    512     Die "Tarball $tarball is too big for disk! (CODI)\nTell Hugo to adjust MAX_COMPRESSED_SIZE"
     512    Die "Tarball $tarball is too big for disk! (CODI)\nTell dev team to adjust MAX_COMPRESSED_SIZE"
    513513    fi
    514514    [ "$diskno" -eq "$noof_disks" ] && echo "This is the last disk ($diskno=$noof_disks)" >> $mountpoint/LAST-DISK
     
    684684    echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
    685685    echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
    686     mkdir -p $CACHE_LOC
     686    mkdir -p $CACHEDIR
    687687}
    688688
     
    16261626
    16271627
    1628 OfferToCopyImagesToDisks() {
    1629     local imagesdir i imagename dev count boot_dev data_dev
    1630     imagesdir=$1
    1631     boot_dev=$2
    1632     data_dev=$3
    1633     echo -en "Would you like to create boot+data floppy disks now (y/n) ?"
    1634     read i
    1635     [ "$i" != "y" ] && [ "$i" != "Y" ] && return
    1636     mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first."
    1637     echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS."
    1638     [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?"
    1639     [ ! -e "$data_dev" ] && Die "Cannot find $data_dev - is your Linux distro broken?"
    1640     i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null`
    1641     j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'`
    1642 #    echo "i=$i"
    1643 #    echo "j=$j"
    1644     if [ "$i" ] ; then
    1645         CopyImageToDisk $j $data_dev "boot disk"
    1646         CopyImageToDisk $i $data_dev "root disk"
    1647     else
    1648         CopyImageToDisk $j $boot_dev "boot/root disk"
    1649     fi
    1650     count=1
    1651     for i in `find $imagesdir | fgrep mindi-data` ; do
    1652         CopyImageToDisk $i $data_dev "data disk #$count"
    1653         count=$(($count+1))
    1654     done
    1655 }
    1656 
    16571628
    16581629
     
    16881659    cp $kernelpath $TMP_ROOT/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?"
    16891660    cp $TMP_ROOT/mindi.rdz $TMP_ROOT/iso/isolinux/initrd.img
    1690     cp $TMP_ROOT/mindi.rdz $imagesdir/initrd.img
     1661    cp $TMP_ROOT/mindi.rdz $CACHEDIR/initrd.img
    16911662    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    16921663    cd $TMP_ROOT/iso/isolinux
     
    17091680    fi
    17101681    if [ "$ARCH" != "ia64" ] ; then
    1711         mkisofs -U -J -r -o $imagesdir/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> /tmp/$$.mk
    1712     else
    1713         mkisofs -J -r -o $imagesdir/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> /tmp/$$.mk
     1682        mkisofs -U -J -r -o $CACHEDIR/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> /tmp/$$.mk
     1683    else
     1684        mkisofs -J -r -o $CACHEDIR/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> /tmp/$$.mk
    17141685    fi
    17151686    if [ "$?" -ne "0" ] ; then
     
    17201691    LogIt "Failed to create ISO image.\n"
    17211692    else
    1722     echo "Created bootable ISO image at $imagesdir/mindi.iso" >> $LOGFILE
     1693    echo "Created bootable ISO image at $CACHEDIR/mindi.iso" >> $LOGFILE
    17231694    fi
    17241695    rm -f /tmp/$$.mk
     
    21742145    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n"
    21752146    return $retval
    2176 }
    2177 
    2178 
    2179 
    2180 
    2181 PrepareDataDiskImages() {
    2182     local needlist bigdir minidir_root tardir diskdir imagesdir res i j k old_pwd lines
    2183 
    2184     imagesdir=$1
    2185     rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
    2186     needlist=$TMP_ROOT/what-we-need.txt
    2187     bigdir=$TMP_ROOT/bigdir
    2188     minidir_root=$TMP_ROOT/minidir
    2189     mkdir -p $minidir_root
    2190     mkdir -p $bigdir/usr/bin
    2191     tardir=$TMP_ROOT/tardir
    2192 
    2193     lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | grep -vx "" | wc -l`
    2194     cat $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | GenerateGiantDependencyList $needlist $lines
    2195     res=$?
    2196     if [ "$YOUR_KERNEL_SUCKS" ]; then
    2197     pwd=`pwd`
    2198     cd $TMP_ROOT
    2199         for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    2200         cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
    2201         if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
    2202         cp --parents -pRdf $i $bigdir
    2203         else
    2204         ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
    2205         BIGNO=$(($BIGNO+1))
    2206         fi
    2207     done
    2208     for i in $EXTRA_MODS ; do
    2209         j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null`
    2210         [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE
    2211         for k in $j ; do
    2212         if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
    2213             cp --parents -pRdf $k $bigdir
    2214         else
    2215             ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
    2216             BIGNO=$(($BIGNO+1))
    2217         fi
    2218         echo "Added failsafe module $k to ramdisk" >> $LOGFILE
    2219         done
    2220     done
    2221     cd $pwd
    2222     else
    2223     ListKernelModulePaths >> $needlist
    2224     fi
    2225     if [ "$res" -ne "0" ] ; then
    2226         Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem."
    2227     fi
    2228     FindAndAddUserKeyboardMappingFile
    2229     mkdir -p $bigdir/tmp
    2230     if [ "`DidMondoCallMe`" ] ; then
    2231         MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg
    2232         cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null
    2233         cp -f $TMP_ROOT/mondo-restore.cfg $CACHE_LOC &> /dev/null
    2234     fi
    2235     [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
    2236     DropOptimizedLibraries $needlist $bigdir
    2237     echo -en "Assembling dependency files"
    2238     CopyDependenciesToDirectory < $needlist $bigdir
    2239 
    2240 # also copy io.sys and msdos.sys, if we can find them
    2241     for i in `mount | cut -d' ' -f3` ; do
    2242     for j in io.sys msdos.sys ; do
    2243         [ -e "$i/$j" ] && cp -f $i/$j $bigdir
    2244     done
    2245     done
    2246 
    2247 # master boot record, too
    2248     i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null`
    2249     if [ "$i" ] ; then
    2250     LogIt "Backing up $i's MBR\n"
    2251     dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
    2252 # < < E O F
    2253     sleep 1
    2254     sync
    2255 #        [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE
    2256     j=$i
    2257     [ -h "$j" ] && j=`ResolveSoftlink $j`
    2258     LogIt "Creating /dev/boot_device ($j)\n"
    2259     mkdir -p $bigdir/dev
    2260     cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk"
    2261     fi
    2262 
    2263 # more stuff
    2264 #    cp -f $MINDI_LIB/embleer* $bigdir
    2265     old_pwd=`pwd`
    2266     cd $bigdir
    2267 
    2268     [ -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'."
    2269     cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
    2270     if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then
    2271     tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
    2272     fi
    2273     if [ -e "$MONDO_SHARE/restore-scripts" ] ; then
    2274         cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
    2275         [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
    2276     fi
    2277     [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
    2278     cd $old_pwd
    2279     echo -e "$DONE"
    2280     TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
    2281     SplitDirectoryIntoMinidirs $bigdir $minidir_root
    2282     noof_disks=$?
    2283     [ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
    2284     MakeMountlist $TMP_ROOT/mountlist.txt
    2285     mkdir -p $minidir_root/$noof_disks/tmp
    2286     cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
    2287     cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC
    2288     [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
    2289     [ -d "/proc/lvm" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    2290     [ -d "/dev/mapper" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    2291     cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
    2292     ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
    2293     CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks
    2294     FRIENDLY_OUTSTRING="Boot and data disk images were created."
    2295 # One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images
    2296     rmdir $tardir $bigdir
    2297     rm -f $needlist
    2298     return $noof_disks
    22992147}
    23002148
     
    29252773    while [ "$diskno" -le "$noof_disks" ] ; do
    29262774        cd $minidir_root/$diskno || LogIt "Warning - cannot cd to $minidir_root/$diskno\n"
    2927         tar -cf - . 2>> $LOGFILE | gzip -9 > $tardir/$diskno.tar.gz || Die "Can't tar/gzip disk#$diskno; please tell Hugo -exactly- what the errors where."
     2775        tar -cf - . 2>> $LOGFILE | gzip -9 > $tardir/$diskno.tar.gz || Die "Can't tar/gzip disk#$diskno; please tell dev team -exactly- what the errors where."
    29282776        diskno=$(($diskno+1))
    29292777        echo -n "..."
     
    29752823if [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then
    29762824    echo "mindi v$MINDI_VERSION"
     2825    exit 0
     2826fi
     2827
     2828if [ "$1" = "-printvar" ] ; then
     2829    shift
     2830    if [ _"$1" != _"" ] ; then
     2831        set | egrep "^$1" | cut -d= -f2
     2832    fi
    29772833    exit 0
    29782834fi
     
    30262882BIGNO=0
    30272883MAX_COMPRESSED_SIZE=1300
    3028 imagesdir=/root/images/mindi
    3029 mkdir -p $imagesdir
     2884imagesdir=$CACHEDIR
    30302885kernelpath=""
    30312886MONDO_ROOT=/tmp/mindilinux/mondo-root
     
    30622917        exit $?
    30632918    elif [ "$1" = " --version" ] || [ "$1" = "-v" ] ; then
    3064     echo "Mindi v$MINDI_VERSION"
     2919        echo "Mindi v$MINDI_VERSION"
    30652920        exit 0
    30662921    elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then
    3067     TMP_ROOT=$2
    3068     MONDO_TMP=$2
    3069     imagesdir=$3
    3070     kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
     2922        TMP_ROOT=$2
     2923        MONDO_TMP=$2
     2924        imagesdir=$3
     2925        kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
    30712926###
    30722927### Sq-Modification...
     
    30752930###
    30762931        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    3077     LogIt "kernelname = $kernelname\n"
    3078     LogIt "kernelpath = $kernelpath\n"
     2932        LogIt "kernelname = $kernelname\n"
     2933        LogIt "kernelpath = $kernelpath\n"
    30792934        if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
    30802935        then
     
    30882943### end of Sq-Modification
    30892944###
    3090     TAPEDEV=$5
    3091     TAPESIZE=$6
    3092     FILES_IN_FILELIST=$7
    3093     USE_LZO=$8
    3094     CDRECOVERY=$9
     2945        TAPEDEV=$5
     2946        TAPESIZE=$6
     2947        FILES_IN_FILELIST=$7
     2948        USE_LZO=$8
     2949        CDRECOVERY=$9
    30952950        if [ "${10}" = "(null)" ] || [ "${10}" = "" ] ; then
    30962951            IMAGE_DEVS=""
     
    30982953            IMAGE_DEVS="`echo "${10}" | tr '|' ' '`"
    30992954        fi
    3100     if [ "${11}" ] ; then
    3101         LILO_OPTIONS=""
     2955        if [ "${11}" ] ; then
     2956            LILO_OPTIONS=""
    31022957#       LogIt "LILO will use conservative settings, to be compatible with older BIOSes."
    3103     fi
    3104     LAST_FILELIST_NUMBER=${12}
     2958        fi
     2959        LAST_FILELIST_NUMBER=${12}
    31052960        ESTIMATED_TOTAL_NOOF_SLICES=${13}
    31062961        EXCLUDE_DEVS="${14}"
    31072962        USE_COMP="${15}"
    31082963        USE_LILO="${16}"
    3109     USE_STAR="${17}"
    3110     INTERNAL_TAPE_BLOCK_SIZE="${18}"
     2964        USE_STAR="${17}"
     2965        INTERNAL_TAPE_BLOCK_SIZE="${18}"
    31112966        DIFFERENTIAL="${19}"
    31122967        NOT_BOOT="${20}"
    31132968        [ "$USE_COMP" = "" ] && USE_COMP=yes
    31142969        [ "$NOT_BOOT" = "" ] && NOT_BOOT=no
    3115     [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine.\n"
    3116     [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
     2970        [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine.\n"
     2971        [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
    31172972        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    31182973        if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
     
    31242979           LogIt "Using modules for kernel: ${kernelname}\n"
    31252980        fi
    3126     [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
     2981        [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
    31272982        MONDO_ROOT=`echo $imagesdir | sed 's/\(.*\)\/.*/\1/'`
    3128     [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined"
    3129     else
    3130     echo "Syntax: mindi (--custom ....)" >> /dev/stderr
    3131     exit 1
     2983        [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined"
     2984    else
     2985        echo "Syntax: mindi (--custom ....)" >> /dev/stderr
     2986        exit 1
    31322987    fi
    31332988fi
     
    31432998
    31442999
    3145 
    3146 
    3147 #ReplaceIndividualLine /tmp/init `grep -n "#WHOLIVESINAPINEAPPLEUNDERTHESEA#" /tmp/init | cut -d':' -f1` "$RUN_AFTER_INITIAL_BOOT_PHASE"
    3148 #exit 0
    3149 
    3150 
    3151 #ListKernelModules
    3152 #exit 0
    3153 
    3154 
    3155 
    3156 
    31573000[ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file"
    31583001rm -Rf $TMP_ROOT/mindilinux/*
    31593002TMP_ROOT=$TMP_ROOT/mindilinux/$$
    31603003mkdir -p $TMP_ROOT
    3161 mkdir -p $imagesdir
    31623004if [ ! "`DidMondoCallMe`" ] ; then
    31633005    LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION\n"
    3164     LogIt "Latest Mindi is available from http://mondorescue.berlios.de\n"
     3006    LogIt "Latest Mindi is available from http://www.mondorescue.org\n"
    31653007    LogIt "BusyBox sources are available from http://www.busybox.net\n"
    31663008    LogIt "------------------------------------------------------------------------------"
     
    32043046    fi
    32053047    if [ "$USE_OWN_KERNEL" = "yes" ]; then
    3206     YOUR_KERNEL_SUCKS=""
    3207     kernelpath=`TryToFindKernelPath`
    3208     if [ "$kernelpath" = "" ] ; then
    3209         echo -n "Please enter kernel path : "
    3210         read kernelpath
    3211     fi
    3212     else
    3213     YOUR_KERNEL_SUCKS="That's why you're using mine, dude. :-)"
     3048        YOUR_KERNEL_SUCKS=""
     3049        kernelpath=`TryToFindKernelPath`
     3050        if [ "$kernelpath" = "" ] ; then
     3051            echo -n "Please enter kernel path : "
     3052            read kernelpath
     3053        fi
     3054    else
     3055        YOUR_KERNEL_SUCKS="That's why you're using mine, dude. :-)"
    32143056    fi
    32153057fi
     
    32403082[ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it. Go to http://www.mondorescue.org and download it, then install it."
    32413083
    3242 rm -f /root/images/mindi/{*img,*gz,*iso}
    3243 
    3244 PrepareDataDiskImages $imagesdir
     3084rm -f $CACHEDIR/{*img,*gz,*iso}
     3085
     3086rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
     3087needlist=$TMP_ROOT/what-we-need.txt
     3088bigdir=$TMP_ROOT/bigdir
     3089minidir_root=$TMP_ROOT/minidir
     3090mkdir -p $minidir_root
     3091mkdir -p $bigdir/usr/bin
     3092tardir=$TMP_ROOT/tardir
     3093
     3094lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | grep -vx "" | wc -l`
     3095cat $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | GenerateGiantDependencyList $needlist $lines
     3096res=$?
     3097if [ "$YOUR_KERNEL_SUCKS" ]; then
     3098    pwd=`pwd`
     3099    cd $TMP_ROOT
     3100    for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
     3101        cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
     3102        if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
     3103            cp --parents -pRdf $i $bigdir
     3104        else
     3105            ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
     3106            BIGNO=$(($BIGNO+1))
     3107        fi
     3108    done
     3109    for i in $EXTRA_MODS ; do
     3110        j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null`
     3111        [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE
     3112        for k in $j ; do
     3113            if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
     3114                    cp --parents -pRdf $k $bigdir
     3115        else
     3116                ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
     3117                BIGNO=$(($BIGNO+1))
     3118            fi
     3119            echo "Added failsafe module $k to ramdisk" >> $LOGFILE
     3120        done
     3121    done
     3122    cd $pwd
     3123else
     3124    ListKernelModulePaths >> $needlist
     3125fi
     3126if [ "$res" -ne "0" ] ; then
     3127    Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem."
     3128fi
     3129FindAndAddUserKeyboardMappingFile
     3130mkdir -p $bigdir/tmp
     3131if [ "`DidMondoCallMe`" ] ; then
     3132    MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg
     3133    cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null
     3134    cp -f $TMP_ROOT/mondo-restore.cfg $CACHEDIR &> /dev/null
     3135fi
     3136[ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     3137DropOptimizedLibraries $needlist $bigdir
     3138echo -en "Assembling dependency files"
     3139CopyDependenciesToDirectory < $needlist $bigdir
     3140
     3141# also copy io.sys and msdos.sys, if we can find them
     3142for i in `mount | cut -d' ' -f3` ; do
     3143    for j in io.sys msdos.sys ; do
     3144        [ -e "$i/$j" ] && cp -f $i/$j $bigdir
     3145    done
     3146done
     3147
     3148# master boot record, too
     3149i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null`
     3150if [ "$i" ] ; then
     3151    LogIt "Backing up $i's MBR\n"
     3152    dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
     3153# < < E O F
     3154    sleep 1
     3155    sync
     3156#        [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE
     3157    j=$i
     3158    [ -h "$j" ] && j=`ResolveSoftlink $j`
     3159    LogIt "Creating /dev/boot_device ($j)\n"
     3160    mkdir -p $bigdir/dev
     3161    cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk"
     3162fi
     3163
     3164# more stuff
     3165#    cp -f $MINDI_LIB/embleer* $bigdir
     3166old_pwd=`pwd`
     3167cd $bigdir
     3168
     3169[ -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'."
     3170cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
     3171if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then
     3172    tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
     3173fi
     3174if [ -e "$MONDO_SHARE/restore-scripts" ] ; then
     3175    cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
     3176    [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     3177fi
     3178[ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
     3179cd $old_pwd
     3180echo -e "$DONE"
     3181TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
     3182SplitDirectoryIntoMinidirs $bigdir $minidir_root
    32453183noof_disks=$?
     3184[ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
     3185MakeMountlist $TMP_ROOT/mountlist.txt
     3186mkdir -p $minidir_root/$noof_disks/tmp
     3187cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
     3188cp -f $TMP_ROOT/mountlist.txt $CACHEDIR
     3189[ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
     3190[ -d "/proc/lvm" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     3191[ -d "/dev/mapper" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     3192cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     3193ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
     3194CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks
     3195FRIENDLY_OUTSTRING="Boot and data disk images were created."
     3196# One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images
     3197rmdir $tardir $bigdir
     3198rm -f $needlist
     3199#return $noof_disks
     3200
    32463201ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE))
    32473202rds=$(($ramdisk_size-$((ramdisk_size%4096))))
     
    32883243    [ ! -e "$boot_dev" ] && mknod $boot_dev b 2 60
    32893244    [ ! -e "$boot_dev" ] && boot_dev=/dev/fd0H1722
    3290     [ ! -e "$boot_dev" ] && Die "Oh Lord, will you PLEASE tell the vendor to create the 1.72MB devices in /dev?"
     3245    [ ! -e "$boot_dev" ] && Die "Will you PLEASE tell your distribution maker to create the 1.72MB devices in /dev?"
    32913246    if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then
    3292         OfferToCopyImagesToDisks $imagesdir $boot_dev $FDDEVICE
     3247        echo -en "Would you like to create boot+data floppy disks now (y/n) ?"
     3248        read i
     3249        [ "$i" != "y" ] && [ "$i" != "Y" ] && return
     3250        mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first."
     3251        echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS."
     3252        [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?"
     3253        [ ! -e "$FDDEVICE" ] && Die "Cannot find $FDDEVICE - is your Linux distro broken?"
     3254        i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null`
     3255        j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'`
     3256        if [ "$i" ] ; then
     3257            CopyImageToDisk $j $FDDEVICE "boot disk"
     3258            CopyImageToDisk $i $FDDEVICE "root disk"
     3259        else
     3260            CopyImageToDisk $j $boot_dev "boot/root disk"
     3261        fi
     3262        count=1
     3263        for i in `find $imagesdir | fgrep mindi-data` ; do
     3264            CopyImageToDisk $i $FDDEVICE "data disk #$count"
     3265            count=$(($count+1))
     3266        done
    32933267    fi
    32943268    OfferToMakeBootableISO $imagesdir
    32953269    LogIt "Finished.\n"
    32963270elif [ "$TAPEDEV" ] ; then
    3297     mkdir -p /root/images/mindi
    3298     rm -f /root/images/mindi/{*img,*gz,*iso}
     3271    rm -f $CACHEDIR/{*img,*gz,*iso}
    32993272    OfferToMakeBootableISO $imagesdir
    33003273    if [ -e "$imagesdir/all.tar.gz" ] ; then
     
    33053278else
    33063279    OfferToMakeBootableISO $imagesdir
    3307 fi
    3308 if [ "$imagesdir" != "/root/images/mindi" ] ; then
    3309     for i in `find $imagesdir -maxdepth 1 -name "*.iso" -o -name "*.img"` ; do
    3310     cp -f $i /root/images/mindi || LogIt "[line 3260] Cannot copy $i to /root/images/mindi\n"
    3311     done
    33123280fi
    33133281[ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT
Note: See TracChangeset for help on using the changeset viewer.