Changeset 541 in MondoRescue for branches/stable/mindi/mindi


Ignore:
Timestamp:
May 13, 2006, 8:47:23 PM (18 years ago)
Author:
bcornec
Message:

Stable is reverted to r436 (2.0.7) to put it in line with 2.0.8 and start from there over

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r538 r541  
    1616export ARCH=`/bin/arch`
    1717
     18ADDITIONAL_BOOT_PARAMS="acpi=off apm=off devfs=nomount exec-shield=0 noresume selinux=0 barrier=off"
     19
    1820RUN_AFTER_INITIAL_BOOT_PHASE="echo \"Who lives in a pineapple under the sea?\" > /tmp/spongebob.squarepants.txt"
    1921    # after booting from floppy/CD image but before
     
    3335MINDI_CONF=YYY
    3436MINDI_SBIN=${MINDI_PREFIX}/sbin
     37
    3538
    3639if [ "$ARCH" = "x86_64" ] ; then
     
    4043fi
    4144
    42 MINDI_CONFIG="$MINDI_CONF/mindi.conf"
    43 if [ ! -f $MINDI_CONFIG ]; then
    44     echo "No $MINDI_CONFIG file found using sensible values"
    45 else
    46     . $MINDI_CONFIG
    47 fi 
    48 
    49 #
    50 # Manages defaults coming from conf files
    51 #
    52 if [ "$mindi_extra_space" == "" ]; then
    53     EXTRA_SPACE=24576
    54 else
    55     EXTRA_SPACE=$mindi_extra_space
    56 fi
    57 if [ "$mindi_ia64_boot_size" == "" ]; then
    58     IA64_BOOT_SIZE=8192
    59 else
    60     IA64_BOOT_SIZE=$mindi_ia64_boot_size
    61 fi
    62 if [ "$mindi_deplist_dir" == "" ]; then
    63     DEPLIST_DIR="$MINDI_CONF/deplist.d"
    64 else
    65     DEPLIST_DIR="$mindi_deplist_dir"
    66 fi
    67 # TBC
    68 if [ "$mindi_write_boot_floppy" == "" ]; then
    69     WRITE_BOOT_FLOPPIES="yes"
    70 else
    71     WRITE_BOOT_FLOPPIES="$mindi_write_boot_floppy"
    72 fi
    73 # TBC
    74 if [ "$mindi_write_cd" == "" ]; then
    75     WRITE_MINDI_CD="yes"
    76 else
    77     WRITE_MINDI_CD="$mindi_write_cd"
    78 fi
    79 # TBC
    80 if [ "$mindi_images_dir" == "" ]; then
    81     CACHEDIR="/var/cache/mindi"
    82 else
    83     CACHEDIR="$mindi_images_dir"
    84 fi
    85 if [ "$mindi_dual_floppies" == "" ]; then
    86     FORCE_DUAL_FLOPPIES="/var/cache/mindi"
    87 else
    88     FORCE_DUAL_FLOPPIES="$mindi_dual_floppies"
    89 fi
    90 if [ "$mindi_tmp_dir" == "" ]; then
    91     TMP_ROOT="/tmp"
    92 else
    93     TMP_ROOT="$mindi_tmp_dir"
    94 fi
    95 if [ "$mindi_fd_device" == "" ]; then
    96     FDDEVICE="/dev/fd0"
    97 else
    98     FDDEVICE="$mindi_fd_device"
    99 fi
    100 if [ "mindi_boot_params" == "" ]; then
    101     ADDITIONAL_BOOT_PARAMS="acpi=off apm=off devfs=nomount exec-shield=0 noresume selinux=0 barrier=off"
    102 else
    103     ADDITIONAL_BOOT_PARAMS="$mindi_boot_params"
    104 fi
    105 
    106 
    107 # Other parameters
    108 # Useless ??
     45EXTRA_SPACE=24576         ; # increase if you run out of ramdisk space
     46IA64_BOOT_SIZE=8192       ; # size of the ia64 boot disk
     47TMP_ROOT=/tmp
     48WRITE_BOOT_FLOPPIES="yes" ; # do you want to be propted to write floppy images
    10949PROMPT_WRITE_BOOT_FLOPPIES="yes"
    11050    # do you want to be prompted to write
     
    12060    # you want to use your own kernel, or the supplied default.
    12161    # If "yes" mindi will automatically use your own kernel.
    122 
     62MINDI_CONFIG="$MINDI_CONF/mindi.conf"
     63if [ -f $MINDI_CONFIG ]; then
     64    . $MINDI_CONFIG
     65fi
    12366MY_FSTAB=/etc/fstab
    12467FLOPPY_MODS="ide-floppy floppy"
    12568TAPE_MODS="ht st osst ide-tape ide_tape"
    126 SCSI_MODS="3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs"
     69SCSI_MODS="3c59x 3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs"
    12770
    12871# ide-probe-mod
     
    13174USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd usbkbd"
    13275CDROM_MODS="$TAPE_MODS $FLOPPY_MODS $IDE_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_cp437 sg sr_mod zlib_inflate $USB_MODS $PCMCIA_MODS"
    133 NET_MODS="sunrpc nfs nfs_acl lockd loop mii 3c59x e100 bcm5700 e1000 eepro100 ne2k-pci tg3 pcnet32 8139cp 8139too 8390 vmxnet"
    134 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid5 lvm-mod dm-mod jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd"
     76NET_MODS="sunrpc nfs nfs_acl lockd loop mii e100 bcm5700 e1000 eepro100 tg3 pcnet32 vmxnet"
     77EXTRA_MODS="$CDROM_MODS vfat fat loop linear raid0 raid1 raid5 lvm-mod dm-mod jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd"
    13578LOGFILE=/var/log/mindi.log
     79FDDEVICE=/dev/fd0             ; # 1.44MB floppy #0
     80CACHE_LOC=/var/cache/mondo-archive
     81FORCE_DUAL_FLOPPIES=no
    13682
    13783BOOT_MEDIA_MESSAGE="\
     
    219165Aborted() {
    220166    trap SIGHUP SIGTERM SIGTRAP SIGINT
    221     rm -f $CACHEDIR/mindi*img $CACHEDIR/*gz $CACHEDIR/mindi.iso
     167    [ "$imagesdir" != "" ] && rm -f $imagesdir/mindi*img $imagesdir/*gz $imagesdir/mindi.iso
    222168    [ "$minidir_root" != "" ] && rm -Rf $minidir_root/*
    223169    Die "User abort."
     
    334280    biggienumber=$4
    335281
    336     [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend deplist file accordingly."
     282    [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend deplist.txt accordingly."
    337283    mkdir -p $outdir
    338284
     
    506452    [ "$?" -ne "0" ] && cat /tmp/mke2fs.$$
    507453    rm -f /tmp/mke2fs.$$
    508     mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $imagefile to $mountpoint! The reason may be missing support for loopfs or ext2 (or both) in the running kernel."
     454    mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $mountpoint; does your kernel support loopfs? If not, please recompile your kernel. Your Linux distro is broken."
    509455    mv $tarball $mountpoint/
    510456    if [ "$?" -ne "0" ] ; then
    511457    umount $mountpoint
    512     Die "Tarball $tarball is too big for disk! (CODI)\nTell dev team to adjust MAX_COMPRESSED_SIZE"
     458    Die "Tarball $tarball is too big for disk! (CODI)\nTell Hugo to adjust MAX_COMPRESSED_SIZE"
    513459    fi
    514460    [ "$diskno" -eq "$noof_disks" ] && echo "This is the last disk ($diskno=$noof_disks)" >> $mountpoint/LAST-DISK
     
    544490    my_partitions=`mount | fgrep $$ | cut -f1 -d' '`
    545491    [ "$my_partitions" != "" ] && umount $my_partitions
    546     # BCO : Too Dangerous !!!
    547     #[ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT
     492    [ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT
    548493    cd /tmp
    549494    mkdir -p mindi.err
     
    684629    echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
    685630    echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
    686     mkdir -p $CACHEDIR
     631    mkdir -p $CACHE_LOC
    687632}
    688633
     
    881826    echo "$fname" >> $outfile.pre
    882827        cat $tempdepfile >> $outfile.pre
     828#        echo "$fname ----> dependencies:-" >> $LOGFILE
     829#        cat $tempdepfile | tr -s '/' '/' | sort -u >> $LOGFILE
     830#        echo -en "(end of deplist of $fname)\n\n" >> $LOGFILE
    883831        rm -f $tempdepfile
    884832    progress=$(($progress+1))
     
    13061254    if [ $tmpmodprobe_flag == "Y" ] ; then
    13071255        infile="/tmp/modprobe.conf.mindi.$$"
    1308         find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile
     1256        find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f > $infile
    13091257    else
    13101258        infile="/etc/modules.conf"
     
    13821330    [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
    13831331    if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then
    1384         current_partition=`ResolveSoftlink $c_p`
     1332            current_partition=`ResolveSoftlink $c_p`
    13851333        [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p"
    1386         [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue
     1334            [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue
    13871335    else
    13881336        current_partition="$c_p"
    13891337    fi
    13901338    [ "$c_p" = "none" ] && continue
    1391     absolute_partition=`ResolveSoftlink $c_p`
    1392     partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    1393 
    1394     # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
    1395     # current_partition contains only first column of /etc/fstab
    1396     if [ "`echo "$current_partition" | /bin/grep -f -i "LABEL="`" != "" ] ; then
     1339        absolute_partition=`ResolveSoftlink $c_p`
     1340    partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1341    redhat_label=""
     1342    if [ "`echo "$current_partition" | fgrep -i "LABEL="`" != "" ] ; then
    13971343        str_to_find_fmt_with=$current_partition
    1398         redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2`
    1399         actual_dev=""
    1400 
    1401         # 1st try : blkid, the good way
    1402         if [ -x "/sbin/blkid" ] ; then
    1403             actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1`
    1404         fi
    1405 
    1406         # 2nd try, which works on a standard partition (ext2/3), but not on swap
    1407         if [ "x$actual_dev" = "x" ] ; then
    1408             actual_dev=`/bin/mount -l | /bin/grep " [$redhat_label]" | /bin/cut -d' ' -f1`
    1409         fi
    1410 
    1411         # 3rd try, with vol_id (which works with swap)
    1412         if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ] ; then
    1413                 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' `
    1414                 for dev_swap in $list_swaps ; do
    1415                     dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"`
    1416                     if [ "x$dev_exists" != "x" ] ; then
    1417                         actual_dev=$dev_swap
    1418                         break;
    1419                     fi
    1420                 done
    1421         fi
    1422 
    1423         # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5
    1424         if [ "x$actual_dev" = "x" -a  "`echo "$current_partition" | /bin/grep -i "LABEL=SWAP"`" != ""] ; then
    1425                 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`"
    1426                 present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`"
    1427                 if [ "x$present_dev" != "x" ] ; then
    1428                     actual_dev="/dev/$try_dev"
    1429                 fi
    1430         fi
    1431 
    1432         # Check if one of all those tries has known success
    1433         if [ "x$actual_dev" != "x" ] ; then
    1434                 current_partition=$actual_dev
    1435         else
    1436             Die "Your system uses a labelled swap partition, but you lack the tool to support it.\nPlease replace swap labels with their correct devices in /etc/fstab\n"
    1437         fi
     1344        redhat_label=`echo "$current_partition" | cut -d'=' -f2`
     1345        actual_dev=`mount -l | fgrep " [$redhat_label]" | cut -d' ' -f1`
     1346#       partition_mountpt=$redhat_label
     1347        current_partition=$actual_dev
    14381348    else
    14391349        str_to_find_fmt_with=$current_partition
    14401350    fi
    1441 
    14421351    partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
    14431352    if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_partition 2> /dev/null`" ] ; then
     
    16261535
    16271536
     1537OfferToCopyImagesToDisks() {
     1538    local imagesdir i imagename dev count boot_dev data_dev
     1539    imagesdir=$1
     1540    boot_dev=$2
     1541    data_dev=$3
     1542    echo -en "Would you like to create boot+data floppy disks now (y/n) ?"
     1543    read i
     1544    [ "$i" != "y" ] && [ "$i" != "Y" ] && return
     1545    mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first."
     1546    echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS."
     1547    [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?"
     1548    [ ! -e "$data_dev" ] && Die "Cannot find $data_dev - is your Linux distro broken?"
     1549    i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null`
     1550    j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'`
     1551#    echo "i=$i"
     1552#    echo "j=$j"
     1553    if [ "$i" ] ; then
     1554        CopyImageToDisk $j $data_dev "boot disk"
     1555        CopyImageToDisk $i $data_dev "root disk"
     1556    else
     1557        CopyImageToDisk $j $boot_dev "boot/root disk"
     1558    fi
     1559    count=1
     1560    for i in `find $imagesdir | fgrep mindi-data` ; do
     1561        CopyImageToDisk $i $data_dev "data disk #$count"
     1562        count=$(($count+1))
     1563    done
     1564}
     1565
    16281566
    16291567
     
    16591597    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?"
    16601598    cp $TMP_ROOT/mindi.rdz $TMP_ROOT/iso/isolinux/initrd.img
    1661     cp $TMP_ROOT/mindi.rdz $CACHEDIR/initrd.img
     1599    cp $TMP_ROOT/mindi.rdz $imagesdir/initrd.img
    16621600    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    16631601    cd $TMP_ROOT/iso/isolinux
     
    16801618    fi
    16811619    if [ "$ARCH" != "ia64" ] ; then
    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
     1620        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
     1621    else
     1622        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
    16851623    fi
    16861624    if [ "$?" -ne "0" ] ; then
     
    16911629    LogIt "Failed to create ISO image.\n"
    16921630    else
    1693     echo "Created bootable ISO image at $CACHEDIR/mindi.iso" >> $LOGFILE
     1631    echo "Created bootable ISO image at $imagesdir/mindi.iso" >> $LOGFILE
    16941632    fi
    16951633    rm -f /tmp/$$.mk
     
    17961734    return $res
    17971735
     1736# --- the kernel-only method NO LONGER WORKS. Not since Apr 2002.
     1737# It should work, according to the Boot Disk HOWTO, but it doesn't.
     1738# It works for my failsafe kernel & for RH7.2 but not RH7.3, 8.0, etc.
     1739# -Hugo, Apr 19th 2004
     1740#   dd if=$1 of=$2 bs=1k &> /dev/null || Die "Cannot dd blank file"
     1741#   dd if=/dev/zero bs=1k count=$3 >> $2 2> /dev/null || Die "Cannot dd blank file"
     1742#   mv -f $2 $2.old
     1743#   dd if=$2.old bs=1k count=$3 of=$2 &> /dev/null || Die "Cannot dd blank file"
     1744#   rm -f $2.old
     1745#   if [ "$3" = "1440" ] ; then
     1746#       rdev $2 "/dev/fd0H"$3
     1747#   else
     1748#       rdev $2 "/dev/fd0u"$3
     1749#   fi
     1750#   rdev -R $2 0
     1751#   rdev -r $2 49152
    17981752}
    17991753
     
    21452099    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n"
    21462100    return $retval
     2101}
     2102
     2103
     2104
     2105
     2106PrepareDataDiskImages() {
     2107    local needlist bigdir minidir_root tardir diskdir imagesdir res i j k old_pwd lines
     2108
     2109    imagesdir=$1
     2110    rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
     2111    needlist=$TMP_ROOT/what-we-need.txt
     2112    bigdir=$TMP_ROOT/bigdir
     2113    minidir_root=$TMP_ROOT/minidir
     2114    mkdir -p $minidir_root
     2115    mkdir -p $bigdir/usr/bin
     2116    tardir=$TMP_ROOT/tardir
     2117
     2118    lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l`
     2119    cat $MINDI_CONF/deplist.txt | GenerateGiantDependencyList $needlist $lines
     2120    res=$?
     2121    if [ "$YOUR_KERNEL_SUCKS" ]; then
     2122    pwd=`pwd`
     2123    cd $TMP_ROOT
     2124        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
     2125        cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
     2126        if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
     2127        cp --parents -pRdf $i $bigdir
     2128        else
     2129        ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
     2130        BIGNO=$(($BIGNO+1))
     2131        fi
     2132    done
     2133    for i in $EXTRA_MODS ; do
     2134        j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null`
     2135        [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE
     2136        for k in $j ; do
     2137        if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
     2138            cp --parents -pRdf $k $bigdir
     2139        else
     2140            ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
     2141            BIGNO=$(($BIGNO+1))
     2142        fi
     2143        echo "Added failsafe module $k to ramdisk" >> $LOGFILE
     2144        done
     2145    done
     2146    cd $pwd
     2147    else
     2148    ListKernelModulePaths >> $needlist
     2149    fi
     2150    if [ "$res" -ne "0" ] ; then
     2151        Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem."
     2152    fi
     2153    FindAndAddUserKeyboardMappingFile
     2154    mkdir -p $bigdir/tmp
     2155    if [ "`DidMondoCallMe`" ] ; then
     2156        MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg
     2157        cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null
     2158        cp -f $TMP_ROOT/mondo-restore.cfg $CACHE_LOC &> /dev/null
     2159    fi
     2160    [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     2161    DropOptimizedLibraries $needlist $bigdir
     2162    echo -en "Assembling dependency files"
     2163    CopyDependenciesToDirectory < $needlist $bigdir
     2164
     2165# also copy io.sys and msdos.sys, if we can find them
     2166    for i in `mount | cut -d' ' -f3` ; do
     2167    for j in io.sys msdos.sys ; do
     2168        [ -e "$i/$j" ] && cp -f $i/$j $bigdir
     2169    done
     2170    done
     2171
     2172# master boot record, too
     2173    i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null`
     2174    if [ "$i" ] ; then
     2175    LogIt "Backing up $i's MBR\n"
     2176    dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
     2177# < < E O F
     2178    sleep 1
     2179    sync
     2180#        [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE
     2181    j=$i
     2182    [ -h "$j" ] && j=`ResolveSoftlink $j`
     2183    LogIt "Creating /dev/boot_device ($j)\n"
     2184    mkdir -p $bigdir/dev
     2185    cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk"
     2186    fi
     2187
     2188# more stuff
     2189#    cp -f $MINDI_LIB/embleer* $bigdir
     2190    old_pwd=`pwd`
     2191    cd $bigdir
     2192
     2193    [ -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'."
     2194    cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
     2195    if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then
     2196    tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
     2197    fi
     2198    if [ -e "$MONDO_SHARE/restore-scripts" ] ; then
     2199        cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
     2200        [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     2201    fi
     2202    [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
     2203    cd $old_pwd
     2204    echo -e "$DONE"
     2205    TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
     2206    SplitDirectoryIntoMinidirs $bigdir $minidir_root
     2207    noof_disks=$?
     2208    [ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
     2209#    if [ "$noof_disks" -ge "8" ] ; then
     2210#        LogIt "You are putting a ludicrously large amount of data on these disks."
     2211#        LogIt "I shall therefore double EXTRA_SPACE, just in case your ramdisk is too small."
     2212#        EXTRA_SPACE=$(($EXTRA_SPACE*2))
     2213#    fi
     2214    MakeMountlist $TMP_ROOT/mountlist.txt
     2215    mkdir -p $minidir_root/$noof_disks/tmp
     2216    cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
     2217    cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC
     2218    [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
     2219    [ -d "/proc/lvm" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     2220    [ -d "/dev/mapper" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     2221    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     2222    ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
     2223    CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks
     2224    FRIENDLY_OUTSTRING="Boot and data disk images were created."
     2225# One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images
     2226    rmdir $tardir $bigdir
     2227    rm -f $needlist
     2228    return $noof_disks
    21472229}
    21482230
     
    24532535       root="/"
    24542536    fi
    2455     for fname in `find $root -maxdepth 2 -type f | fgrep lin | egrep -v '^/proc/|^/net/'` ; do
     2537    for fname in `find $root -maxdepth 2 -type f | fgrep lin | fgrep -v /proc/` ; do
    24562538    [ ! -e "$fname" ] && continue
    24572539        [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel
     
    26132695    echo -en "..."
    26142696    mkdir -p $mountpoint
    2615     mount -t ext2 -o loop $tempfile $mountpoint || Die "Cannot loopmount $tempfile to $mountpoint! The reason may be missing support for loopfs or ext2 (or both) in the running kernel."
     2697    mount -t ext2 -o loop $tempfile $mountpoint || Die "Cannot loopmount $tempfile to $mountpoint"
    26162698    echo -en "..."
    26172699    old_pwd=`pwd`
     
    27732855    while [ "$diskno" -le "$noof_disks" ] ; do
    27742856        cd $minidir_root/$diskno || LogIt "Warning - cannot cd to $minidir_root/$diskno\n"
    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."
     2857        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."
    27762858        diskno=$(($diskno+1))
    27772859        echo -n "..."
     
    28212903
    28222904
     2905#AWK=`which gawk`
     2906#LocateDeps $1
     2907#MakeModuleLoadingScript /tmp/load-modules.sh
     2908#exit 0
     2909
     2910
     2911#cat /etc/mindi/deplist.txt | GenerateGiantDependencyList /tmp/deplist.old 200
     2912#exit 0
     2913
     2914
     2915
    28232916if [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then
    28242917    echo "mindi v$MINDI_VERSION"
    2825     exit 0
    2826 fi
    2827 
    2828 if [ "$1" = "-printvar" ] ; then
    2829     shift
    2830     if [ _"$1" != _"" ] ; then
    2831         set | egrep "^$1" | cut -d= -f2
    2832     fi
    28332918    exit 0
    28342919fi
     
    28822967BIGNO=0
    28832968MAX_COMPRESSED_SIZE=1300
    2884 imagesdir=$CACHEDIR
     2969imagesdir=/root/images/mindi
     2970mkdir -p $imagesdir
    28852971kernelpath=""
    28862972MONDO_ROOT=/tmp/mindilinux/mondo-root
     
    29173003        exit $?
    29183004    elif [ "$1" = " --version" ] || [ "$1" = "-v" ] ; then
    2919         echo "Mindi v$MINDI_VERSION"
     3005    echo "Mindi v$MINDI_VERSION"
    29203006        exit 0
    29213007    elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then
    2922         TMP_ROOT=$2
    2923         MONDO_TMP=$2
    2924         imagesdir=$3
    2925         kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
     3008    TMP_ROOT=$2
     3009    MONDO_TMP=$2
     3010    imagesdir=$3
     3011    kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
    29263012###
    29273013### Sq-Modification...
     
    29303016###
    29313017        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    2932         LogIt "kernelname = $kernelname\n"
    2933         LogIt "kernelpath = $kernelpath\n"
     3018    LogIt "kernelname = $kernelname\n"
     3019    LogIt "kernelpath = $kernelpath\n"
    29343020        if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
    29353021        then
     
    29433029### end of Sq-Modification
    29443030###
    2945         TAPEDEV=$5
    2946         TAPESIZE=$6
    2947         FILES_IN_FILELIST=$7
    2948         USE_LZO=$8
    2949         CDRECOVERY=$9
     3031    TAPEDEV=$5
     3032    TAPESIZE=$6
     3033    FILES_IN_FILELIST=$7
     3034    USE_LZO=$8
     3035    CDRECOVERY=$9
    29503036        if [ "${10}" = "(null)" ] || [ "${10}" = "" ] ; then
    29513037            IMAGE_DEVS=""
     
    29533039            IMAGE_DEVS="`echo "${10}" | tr '|' ' '`"
    29543040        fi
    2955         if [ "${11}" ] ; then
    2956             LILO_OPTIONS=""
     3041    if [ "${11}" ] ; then
     3042        LILO_OPTIONS=""
    29573043#       LogIt "LILO will use conservative settings, to be compatible with older BIOSes."
    2958         fi
    2959         LAST_FILELIST_NUMBER=${12}
     3044    fi
     3045    LAST_FILELIST_NUMBER=${12}
    29603046        ESTIMATED_TOTAL_NOOF_SLICES=${13}
    29613047        EXCLUDE_DEVS="${14}"
    29623048        USE_COMP="${15}"
    29633049        USE_LILO="${16}"
    2964         USE_STAR="${17}"
    2965         INTERNAL_TAPE_BLOCK_SIZE="${18}"
     3050    USE_STAR="${17}"
     3051    INTERNAL_TAPE_BLOCK_SIZE="${18}"
    29663052        DIFFERENTIAL="${19}"
    29673053        NOT_BOOT="${20}"
    29683054        [ "$USE_COMP" = "" ] && USE_COMP=yes
    29693055        [ "$NOT_BOOT" = "" ] && NOT_BOOT=no
    2970         [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine.\n"
    2971         [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
     3056    [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine.\n"
     3057    [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
    29723058        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    29733059        if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
     
    29793065           LogIt "Using modules for kernel: ${kernelname}\n"
    29803066        fi
    2981         [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
     3067    [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
    29823068        MONDO_ROOT=`echo $imagesdir | sed 's/\(.*\)\/.*/\1/'`
    2983         [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined"
    2984     else
    2985         echo "Syntax: mindi (--custom ....)" >> /dev/stderr
    2986         exit 1
     3069    [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined"
     3070    else
     3071    echo "Syntax: mindi (--custom ....)" >> /dev/stderr
     3072    exit 1
    29873073    fi
    29883074fi
     
    29983084
    29993085
     3086
     3087
     3088#ReplaceIndividualLine /tmp/init `grep -n "#WHOLIVESINAPINEAPPLEUNDERTHESEA#" /tmp/init | cut -d':' -f1` "$RUN_AFTER_INITIAL_BOOT_PHASE"
     3089#exit 0
     3090
     3091
     3092#ListKernelModules
     3093#exit 0
     3094
     3095
     3096
     3097
    30003098[ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file"
    30013099rm -Rf $TMP_ROOT/mindilinux/*
    30023100TMP_ROOT=$TMP_ROOT/mindilinux/$$
    30033101mkdir -p $TMP_ROOT
     3102mkdir -p $imagesdir
    30043103if [ ! "`DidMondoCallMe`" ] ; then
    30053104    LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION\n"
    3006     LogIt "Latest Mindi is available from http://www.mondorescue.org\n"
     3105    LogIt "Latest Mindi is available from http://mondorescue.berlios.de\n"
    30073106    LogIt "BusyBox sources are available from http://www.busybox.net\n"
    30083107    LogIt "------------------------------------------------------------------------------"
     
    30463145    fi
    30473146    if [ "$USE_OWN_KERNEL" = "yes" ]; then
    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. :-)"
     3147    YOUR_KERNEL_SUCKS=""
     3148    kernelpath=`TryToFindKernelPath`
     3149    if [ "$kernelpath" = "" ] ; then
     3150        echo -n "Please enter kernel path : "
     3151        read kernelpath
     3152    fi
     3153    else
     3154    YOUR_KERNEL_SUCKS="That's why you're using mine, dude. :-)"
    30563155    fi
    30573156fi
     
    30823181[ "$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."
    30833182
    3084 rm -f $CACHEDIR/{*img,*gz,*iso}
    3085 
    3086 rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
    3087 needlist=$TMP_ROOT/what-we-need.txt
    3088 bigdir=$TMP_ROOT/bigdir
    3089 minidir_root=$TMP_ROOT/minidir
    3090 mkdir -p $minidir_root
    3091 mkdir -p $bigdir/usr/bin
    3092 tardir=$TMP_ROOT/tardir
    3093 
    3094 lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | grep -vx "" | wc -l`
    3095 cat $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | GenerateGiantDependencyList $needlist $lines
    3096 res=$?
    3097 if [ "$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
    3123 else
    3124     ListKernelModulePaths >> $needlist
    3125 fi
    3126 if [ "$res" -ne "0" ] ; then
    3127     Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem."
    3128 fi
    3129 FindAndAddUserKeyboardMappingFile
    3130 mkdir -p $bigdir/tmp
    3131 if [ "`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
    3135 fi
    3136 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
    3137 DropOptimizedLibraries $needlist $bigdir
    3138 echo -en "Assembling dependency files"
    3139 CopyDependenciesToDirectory < $needlist $bigdir
    3140 
    3141 # also copy io.sys and msdos.sys, if we can find them
    3142 for 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
    3146 done
    3147 
    3148 # master boot record, too
    3149 i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null`
    3150 if [ "$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"
    3162 fi
    3163 
    3164 # more stuff
    3165 #    cp -f $MINDI_LIB/embleer* $bigdir
    3166 old_pwd=`pwd`
    3167 cd $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'."
    3170 cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
    3171 if [ -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"
    3173 fi
    3174 if [ -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"
    3177 fi
    3178 [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
    3179 cd $old_pwd
    3180 echo -e "$DONE"
    3181 TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
    3182 SplitDirectoryIntoMinidirs $bigdir $minidir_root
     3183rm -f /root/images/mindi/{*img,*gz,*iso}
     3184
     3185PrepareDataDiskImages $imagesdir
    31833186noof_disks=$?
    3184 [ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
    3185 MakeMountlist $TMP_ROOT/mountlist.txt
    3186 mkdir -p $minidir_root/$noof_disks/tmp
    3187 cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
    3188 cp -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
    3192 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
    3193 ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
    3194 CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks
    3195 FRIENDLY_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
    3197 rmdir $tardir $bigdir
    3198 rm -f $needlist
    3199 #return $noof_disks
    3200 
    32013187ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE))
    32023188rds=$(($ramdisk_size-$((ramdisk_size%4096))))
     
    32093195    else
    32103196        if ! PrepareBootDiskImage_LILO $imagesdir 1722 $kernelpath $ramdisk_size ; then
    3211             LogIt "Warning - failed to create 1.72MB boot image. Please reduce your kernel's size\n"
    3212             LogIt "if you want to make a 1.72MB floppy disk.\n"
    3213         fi
    3214         if ! PrepareBootDiskImage_LILO $imagesdir 2880 $kernelpath $ramdisk_size ;  then
    3215             LogIt "Warning - failed to create 2.88MB floppy disk image.\n"
    3216             LogIt "Please reduce your kernel's size\n"
    3217             LogIt "if you want to make a 2.88MB floppy disk.\n"
    3218             PrepareBootDiskImage_LILO $imagesdir 5760 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image."
    3219         fi
     3197        LogIt "Warning - failed to create 1.72MB boot image. Please reduce your kernel's size\n"
     3198        LogIt "if you want to make a 1.72MB floppy disk.\n"
     3199        fi
     3200        PrepareBootDiskImage_LILO $imagesdir 2880 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image."
    32203201    fi
    32213202else
     
    32433224    [ ! -e "$boot_dev" ] && mknod $boot_dev b 2 60
    32443225    [ ! -e "$boot_dev" ] && boot_dev=/dev/fd0H1722
    3245     [ ! -e "$boot_dev" ] && Die "Will you PLEASE tell your distribution maker to create the 1.72MB devices in /dev?"
     3226    [ ! -e "$boot_dev" ] && Die "Oh Lord, will you PLEASE tell the vendor to create the 1.72MB devices in /dev?"
    32463227    if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then
    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
     3228        OfferToCopyImagesToDisks $imagesdir $boot_dev $FDDEVICE
    32673229    fi
    32683230    OfferToMakeBootableISO $imagesdir
    32693231    LogIt "Finished.\n"
    32703232elif [ "$TAPEDEV" ] ; then
    3271     rm -f $CACHEDIR/{*img,*gz,*iso}
     3233    mkdir -p /root/images/mindi
     3234    rm -f /root/images/mindi/{*img,*gz,*iso}
    32723235    OfferToMakeBootableISO $imagesdir
    32733236    if [ -e "$imagesdir/all.tar.gz" ] ; then
     
    32783241else
    32793242    OfferToMakeBootableISO $imagesdir
     3243fi
     3244if [ "$imagesdir" != "/root/images/mindi" ] ; then
     3245    for i in `find $imagesdir -maxdepth 1 -name "*.iso" -o -name "*.img"` ; do
     3246    cp -f $i /root/images/mindi || LogIt "[line 3260] Cannot copy $i to /root/images/mindi\n"
     3247    done
    32803248fi
    32813249[ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT
Note: See TracChangeset for help on using the changeset viewer.