Changeset 1885 in MondoRescue


Ignore:
Timestamp:
Mar 2, 2008, 12:38:35 AM (16 years ago)
Author:
Bruno Cornec
Message:
  • Remove floppy support from mindi and mondo and adapt docs
  • Align more mindi with the version from stable
Location:
branches/2.2.5
Files:
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi/mindi

    r1883 r1885  
    4343BOOT_SIZE=16384         # size of the boot disk
    4444MAX_DISKS=99
    45 WRITE_BOOT_FLOPPIES="yes"   # do you want to be propted to write floppy images
    46 PROMPT_WRITE_BOOT_FLOPPIES="yes"
    47     # do you want to be prompted to write
    48     # floppy images out to floppy disks?
    49     # if 'no', images will not be written to floppies
    5045
    5146PROMPT_MAKE_CD_IMAGE="yes"
     
    6358
    6459MY_FSTAB=/etc/fstab
    65 FLOPPY_MODS="ide-floppy floppy"
    6660TAPE_MODS="ht st osst ide-tape ide_tape"
    6761SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci 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 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid megaraid_mm megaraid_mbox megaraid_sas mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod scsi_transport_sas scsi_transport_spi sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs"
    6862
    6963# ide-probe-mod
    70 IDE_MODS="ide ide-generic ide-detect ide-mod ide-disk ide-cd ide_cd ide-cs ide-core ide_core edd paride ata_generic ata_piix libata via82cxxx generic nvidia ahci sata_nv cmd64x pata_amd pata_marvell pata_serverworks"
     64IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide-cd ide_cd ide-cs ide-core ide_core edd paride ata_generic ata_piix libata via82cxxx generic nvidia ahci sata_nv cmd64x pata_amd pata_marvell pata_serverworks"
    7165PCMCIA_MODS="pcmcia_core ds yenta_socket"
    7266USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage input hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd usbkbd usbhid keybdev mousedev libusual"
    73 CDROM_MODS="$TAPE_MODS $FLOPPY_MODS $IDE_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_cp437 nls_utf8 sg sr_mod zlib_inflate $USB_MODS $PCMCIA_MODS"
     67CDROM_MODS="$TAPE_MODS $IDE_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_cp437 nls_utf8 sg sr_mod zlib_inflate $USB_MODS $PCMCIA_MODS"
    7468NET_MODS="sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 e1000 eepro100 ne2k-pci tg3 pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmnet"
    7569EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid5 raid456 lvm-mod dm-mod dm-snapshot dm-zero dm-mirror jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache"
     
    8175
    8276LOGFILE=/var/log/mindi.log
    83 FDDEVICE=/dev/fd0             ; # 1.44MB floppy #0
    8477MINDI_CACHE=/var/cache/mindi
    85 FORCE_DUAL_FLOPPIES=no
    8678BOOT_MEDIA_MESSAGE="\
    8779To format and restore all files automatically, type 'nuke' <enter>.\n\
     
    10698    . $MINDI_CONFIG
    10799fi
     100DEPLIST_FILE="$MINDI_CONF/deplist.txt"
     101ISO_CMD="/usr/bin/mkisofs"
     102ISO_OPT="-J -r -v -p Mindi -publisher http://www.mondorescue.org -A Mindi"
    108103
    109104# Now we can create what we need
    110105export MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX`
    111 mkdir -p $MINDI_TMP
    112 
    113 # Purge from potential old run
    114 rm -rf $MINDI_CACHE/* 2> /dev/null
    115 mkdir -p $MINDI_CACHE
     106
    116107# ----------------------------------------------------------------------------
    117108
     
    249240    biggienumber=$4
    250241
    251     [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend deplist.txt accordingly."
     242    [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend $DEPLIST_FILE accordingly."
    252243    mkdir -p $outdir
    253244
     
    361352        Die "Please install either fdformat or superformat."
    362353    fi
    363     echo -en "\rWriting $comment"
     354    echo -en "\nWriting $comment"
    364355    if echo $image | grep "mindi-[r|b]oot\.1440" &> /dev/null ; then
    365356        cat $image > $dev &
     
    10391030                if echo "$MODULES" | grep lvm &> /dev/null ; then
    10401031                    echo "I think you are, so please take heed!" >> $LOGFILE
    1041 #                   LogIt "Where is liblvm? You need it."
    10421032                else
    10431033                    echo "I don't think you are, so don't worry about it." >> $LOGFILE
     
    12571247    [ "$mountlist" != "" ] && rm -Rf $mountlist
    12581248    > $mountlist
    1259     echo -en "\rHang on...\r"
    12601249    all_partitions=""
    12611250   
    12621251    if [ $LVM != "false" ]; then
    1263         echo -en "\rAnalyzing LVM...\r"
     1252        echo -en "Analyzing LVM...\n"
    12641253        $MINDI_LIB/analyze-my-lvm > $MINDI_TMP/lvm.res
    12651254        if [ $? -ne 0 ]; then
     
    13671356                current_partition=$actual_dev
    13681357            else
    1369                 Die "Your system uses a LABEL partition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in /etc/fstab or install findfs|blkid|vol_id"
     1358                Die "Your system uses a LABEL partition ($current_partition), but you lack the tool to support it.\nPlease replace labels with their correct devices in $MY_FSTAB or install findfs|blkid|vol_id"
    13701359            fi
    13711360        # This part tries to retrieve the correct device from a UUID line in /etc/fstab
     
    16431632
    16441633
    1645 
    1646 OfferToCopyImagesToDisks() {
    1647     local imagesdir i imagename dev count boot_dev data_dev
    1648     imagesdir=$1
    1649     boot_dev=$2
    1650     data_dev=$3
    1651 
    1652     echo -en "Would you like to create boot+data floppy disks now (y/[n]) ?"
    1653     read i
    1654     [ "$i" != "y" ] && [ "$i" != "Y" ] && return
    1655     mount | grep -F /dev/fd > /dev/null && Die "Please unmount your floppies first."
    1656     echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS."
    1657     [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?"
    1658     [ ! -e "$data_dev" ] && Die "Cannot find $data_dev - is your Linux distro broken?"
    1659     i=`find $imagesdir -type f | grep -F "/mindi-root.1" 2> /dev/null`
    1660     j=`find $imagesdir -type f | grep -F "/mindi-boot" | grep -Ev "2880|$BOOT_SIZE"`
    1661     if [ "$i" ] ; then
    1662         CopyImageToDisk $j $data_dev "boot disk"
    1663         CopyImageToDisk $i $data_dev "root disk"
    1664     else
    1665         CopyImageToDisk $j $boot_dev "boot/root disk"
    1666     fi
    1667     count=1
    1668     for i in `find $imagesdir | grep -F mindi-data` ; do
    1669         CopyImageToDisk $i $data_dev "data disk #$count"
    1670         count=$(($count+1))
    1671     done
    1672 }
    1673 
    1674 
    16751634OfferToMakeBootableISO() {
    16761635    local i old_pwd
     
    16801639        [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0
    16811640    fi
    1682     if [ ! "$MINDI_TMP" ] ; then
    1683         LogIt "NB: Mindi's bootable CD always uses isolinux."
    1684         LogIt "For a bootable CD w/LILO, please use Mondo."
     1641    if [ _"$MINDI_TMP" = _"" ]; then
     1642        Die "MINDI_TMP undefined"
    16851643    fi
    16861644    rm -Rf $MINDI_TMP/iso
     
    16971655            cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k"
    16981656            cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP"
    1699             cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT"
     1657            if [ _"$MONDO_SHARE" != _"" ]; then
     1658                cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT"
     1659            fi
    17001660        fi
    17011661    done
    17021662    MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt
    1703     cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MINDI_TMP/iso/isolinux/vmlinuz). Did you run out of disk space?"
    1704     cp $kernelpath $MONDO_ROOT/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
     1663    cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/isolinux/vmlinuz). Did you run out of disk space?"
    17051664    cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE
    1706     cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE
     1665    if [ _"$MONDO_SHARE" != _"" ]; then
     1666        cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"/dev/null
     1667        cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE || Die "Cannot copy mindi.rdz ($MINDI_TMP/mindi.rdz) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
     1668
     1669    fi
    17071670    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    17081671    cd $MINDI_TMP/iso/isolinux
    1709     cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg from mindi_home to tmp_root - did you run out of disk space?"
     1672    cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg to $MINDI_TMP/iso/isolinux - did you run out of disk space?"
    17101673    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    1711         mv isolinux.cfg isolinux.cfg.old
    1712         sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg
     1674        perl -pi -e 's/interactive/iso/' isolinux.cfg
    17131675    fi
    17141676    if [ "$ARCH" != "ia64" ] ; then
    1715         cp $ISOLINUX isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to tmp_root - did you run out of disk space?"
     1677        cp $ISOLINUX isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso/isolinux - did you run out of disk space?"
    17161678        cp $ISOLINUX ../ 2>> $LOGFILE
    17171679    fi
    17181680    cd $MINDI_TMP/iso
    17191681    if [ "$ARCH" != "ia64" ] ; then
    1720         cp -f $MINDI_TMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?"
    1721     fi
    1722     [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun .    2>> $LOGFILE
    1723     if [ "$ARCH" != "ia64" ] ; then
    1724         mkisofs -U -J -r -o $MINDI_CACHE/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log
    1725     else
    1726         mkisofs -J -r -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log
     1682        if [ _"$MONDO_SHARE" != _"" ]; then
     1683            cp -f $MINDI_TMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1684            cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE
     1685        fi
     1686        $ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log
     1687    else
     1688        $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log
    17271689    fi
    17281690    if [ "$?" -ne "0" ] ; then
    1729         echo "----------- mkisofs's errors --------------" >> $LOGFILE
     1691        echo "----------- $ISO_CMD's errors --------------" >> $LOGFILE
    17301692        cat $MINDI_TMP/mkisofs.log >> $LOGFILE
    1731         echo "mkisofs returned the following errors:-"
     1693        echo "$ISO_CMD returned the following errors:-"
    17321694        cat $MINDI_TMP/mkisofs.log
    17331695        LogIt "Failed to create ISO image."
     
    18721834
    18731835MakeMessageFile() {
    1874     local disksize
    1875     disksize=$1
    18761836    if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then
    18771837        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/
     
    18791839        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" /etc/issue.net | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/
    18801840    fi
    1881     if [ "$disksize" -gt "2880" ] ; then
    1882         if [ _"$MONDO_SHARE" != _"" ] ; then
    1883             if [ "$CDRECOVERY" != "yes" ] ; then
    1884                 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    1885                     echo -en "Press <enter> to continue.\n"
    1886                 elif [ ! "$MINDI_TMP" ] ; then
    1887                     echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
    1888                 else
    1889                     echo -en "$BOOT_MEDIA_MESSAGE"
    1890                 fi
     1841    if [ _"$MONDO_SHARE" != _"" ]; then
     1842        if [ "$CDRECOVERY" != "yes" ] ; then
     1843            if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
     1844                echo -en "Press <enter> to continue.\n"
     1845            elif [ ! "$MINDI_TMP" ] ; then
     1846                echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
     1847            else
     1848                echo -en "$BOOT_MEDIA_MESSAGE"
    18911849            fi
    18921850        fi
     
    19011859
    19021860
    1903 write_full_floppy_of_kernel() {
    1904     local mtpt image old_pwd res disksize
    1905 
    1906     res=0
    1907     old_pwd=`pwd`
    1908     KERN_DISK_MADE=1
    1909     disksize=$3
    1910     rand1=$RANDOM
    1911     rand2=$RANDOM
    1912     image=$MINDI_TMP/$rand1.$rand2.img
    1913     mtpt=$MINDI_TMP/$rand1.$rand2.mtpt
    1914     dd if=/dev/zero of=$image bs=1k count=$disksize &> /dev/null
    1915     mke2fs -N 26 -F $image &> /dev/null
    1916     mkdir -p $mtpt
    1917     mount -o loop $image $mtpt
    1918     cd $mtpt
    1919     mkdir -p {dev,tmp,boot}
    1920     cp -f $1 vmlinuz 2>> $LOGFILE
    1921     if [ "$?" -ne "0" ] ; then
    1922         LogIt "Failed to copy $1 to ramdisk"
    1923         cd $old_pwd
    1924         umount $mtpt
    1925         rmdir $mtpt
    1926         rm $image
    1927         return 1
    1928     fi
    1929 
    1930     rdev vmlinuz 2,0
    1931     rdev -R vmlinuz 0
    1932     rdev -r vmlinuz 49152
    1933 
    1934     tar -zxf $MINDI_LIB/dev.tgz || LogIt "Cannot untar dev.tgz"
    1935     # BERLIOS : Useless and generating errors on CentOS ? (losetup miss a param)
    1936     #losetup /dev/loop0 > /dev/null 2> /dev/null
    1937     #[ "$?" -eq "0" ] || losetup /dev/loop0 -d || Die "Please free up /dev/loop0 by typing 'losetup /dev/loop0 -d'.\nReboot if necessary."
    1938     CopyBootBFile $mtpt/boot.b
    1939 
    1940     MakeLiloConfFile $disksize >> bdlilo.conf
    1941 
    1942     chmod 644 bdlilo.conf
    1943     MakeMessageFile $disksize > message
    1944     lilo -v -C bdlilo.conf -r $mtpt
    1945     res=$?
    1946 
    1947     cd $old_pwd
    1948     umount $mtpt
    1949     mv -f $image $2
    1950     rmdir $mtpt
    1951 
    1952     return $res
    1953 }
    1954 
    1955 
    19561861MakeLiloConfFile() {
    1957     local disksize options i ooo
    1958     disksize=$1
     1862    local options i ooo
    19591863    options=""
    19601864
    19611865    if [ "$ARCH" != "ia64" ] ; then
    19621866        echo -en "boot=/dev/loop0\ndisk=/dev/loop0\n"
    1963     fi
    1964     if [ "$disksize" -eq "2880" ] ; then
    1965         echo -en "bios=0x00\nsectors=36\nheads=2\ncylinders=80\n"
    1966     elif [ "$disksize" -eq "1722" ] ; then
    1967         echo -en "bios=0x00\nsectors=21\nheads=2\ncylinders=82\n"
    1968     elif [ "$disksize" -gt "2880" ] ; then
    1969         /bin/true
    1970     else
    1971         echo -en "bios=0x00\nsectors=18\nheads=2\ncylinders=80\n"
    1972     fi
    1973     if [ "$ARCH" != "ia64" ] ; then
    19741867        echo -en "install=/boot.b\nmap=/boot.map\n"
    19751868    fi
    19761869    if [ "$CDRECOVERY" = "yes" ] ; then
    19771870        echo -en "default=RESTORE\n"
    1978     elif [ "$disksize" -gt "2880" ] && [ _"$MONDO_SHARE" != _"" ] ; then
     1871    elif [ _"$MONDO_SHARE" != _"" ]; then
    19791872        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    19801873            echo -en "default=iso\n"
     
    19961889    if [ "$CDRECOVERY" = "yes" ] ; then
    19971890        options="RESTORE expert"
    1998     elif [ "$disksize" -gt "2880" ] ; then
    1999         if [ _"$MONDO_SHARE" != _"" ] ; then
     1891    else
     1892        if [ _"$MONDO_SHARE" != _"" ]; then
    20001893            if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    20011894                options="iso"
     
    20071900            options="expert"
    20081901        fi
    2009     else
    2010         options="expert"
    20111902    fi
    20121903    for i in $options ; do
     
    20221913        outstr=$outstr" $ooo_mode"
    20231914        outstr=$outstr"\"\n"
    2024         if [ "$disksize" = "1440" ] ; then
    2025             echo -en "$outstr" | sed s/initrd=.*// | grep -v root=
    2026         else
    2027             echo -en "$outstr"
    2028         fi
     1915        echo -en "$outstr"
    20291916    done
    20301917}
     
    20321919
    20331920PrepareBootDiskImage_LILO() {
    2034     local disksize imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf
     1921    local imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf
    20351922    imagesdir=$1
    2036     disksize=$2
    2037     kernelpath=$3
    2038     ramdisksize=$4
     1923    kernelpath=$2
     1924    ramdisksize=$3
    20391925
    20401926    retval=0
    20411927    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    2042     echo -en "Making "$disksize"KB boot disk..."
    2043     TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
    2044     if [ "$ARCH" != "ia64" ] ; then
    2045         [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "$BOOT_SIZE" ] && Die "PDBI - disksize is $disksize - bad size"
    2046     fi
     1928    echo -en "Making "$BOOT_SIZE"KB boot disk..."
     1929    TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/mindi.rdz $ramdisksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
    20471930    echo -en "..."
    2048     imagefile=$imagesdir/mindi-bootroot.$disksize.img
     1931    imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img
    20491932    mountpoint=$MINDI_TMP/mountpoint.$$
    20501933    mkdir -p $mountpoint
    2051     dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file"
     1934    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
    20521935    if [ "$ARCH" = "ia64" ] ; then
    20531936        mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE
     
    20771960    CopyBootBFile $mountpoint/boot.b
    20781961
    2079     MakeLiloConfFile $disksize > $liloconf
     1962    MakeLiloConfFile > $liloconf
    20801963
    20811964    # Copy it so that CD-ROM menu entry is satisfied
     
    21091992        retval=$(($retval+1))
    21101993    fi
    2111     MakeMessageFile $disksize > $mountpoint/message
     1994    MakeMessageFile > $mountpoint/message
    21121995
    21131996    mkdir -p $mountpoint/tmp
     
    21242007    free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4`
    21252008    cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2> /dev/null
    2126     if [ "$?" -ne "0" ] || [ "$FORCE_DUAL_FLOPPIES" = "yes" ] ; then
     2009    if [ "$?" -ne "0" ] ; then
    21272010        echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE
    21282011        du -sk $mountpoint/* >> $LOGFILE
    21292012        echo "--- end of list of files ---" >> $LOGFILE
    21302013        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\
    2131 Sorry, your kernel is too big for a boot/root floppy.\nI'll try the new boot/root two-disk thingy.\n" >> $LOGFILE
     2014Sorry, your kernel is too big for your image.\n" >> $LOGFILE
    21322015        rm -f $mountpoint/vmlinuz
    21332016        cd $old_pwd
     
    21352018        rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
    21362019    #   losetup /dev/loop0 -d
    2137         res=0
    2138         write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440
    2139         res=$(($res+$?))
    2140         cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 2>> $LOGFILE
    2141         res=$(($res+$?))
    21422020        rm -f $imagefile
    2143         if [ "$res" -ne "0" ]; then
    2144             LogIt "WARNING - failed to create 1.44MB boot/root floppies"
    2145             rm -f $imagesdir/mindi-*.1440.img
    2146         fi
    2147         return $res
     2021        return 0
    21482022    fi
    21492023    free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4`
    21502024    max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`))
    2151     echo "Free space left on floppy = $free_space KB" >> $LOGFILE
    2152     echo "Max kernel size on $disksize KB floppy (est'd) = $max_kernel_size K" >> $LOGFILE
     2025    echo "Free space left on image = $free_space KB" >> $LOGFILE
     2026    echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE
    21532027    # make it bootable
    21542028    rm -f $mountpoint/zero
    21552029    [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE
    2156     if [ "$disksize" -gt "2880" ] && [ ! "$KERN_DISK_MADE" ] ; then
     2030    if [ ! "$KERN_DISK_MADE" ] ; then
    21572031        if [ "$ARCH" != "ia64" ] ; then
    21582032            $LILO_EXE $LILO_OPTIONS -r $mountpoint >> $LOGFILE 2>> $LOGFILE
     
    21602034            /bin/true
    21612035        fi
    2162     elif [ ! "$KERN_DISK_MADE" ] ; then
    2163         # 12/28/2001 - if 1.72MB floppy then don't use LILO's optimizations at all
    2164         $LILO_EXE -r $mountpoint >> $LOGFILE 2>> $LOGFILE
    21652036    else
    21662037        echo "Not running LILO. It's not that kind of disk." >> $LOGFILE
     
    21872058    rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
    21882059    if [ "$retval" -eq "0" ] ; then
    2189         echo -en "...$DONE\r"
     2060        echo -en "...$DONE\n"
    21902061        if [ "$KERN_DISK_MADE" ] ; then
    2191             LogIt "... $disksize KB boot disks were created OK\r"
    2192         fi
    2193     else
    2194         echo -en "...failed\r"
    2195         LogIt $disksize"KB boot disk was NOT created\r"
     2062            LogIt "$BOOT_SIZE KB boot disks were created OK\n"
     2063        fi
     2064    else
     2065        echo -en "...failed\n"
     2066        LogIt $BOOT_SIZE"KB boot disk was NOT created\n"
    21962067        rm -f $imagefile
    21972068    fi
     
    22022073
    22032074PrepareBootDiskImage_SYSLINUX() {
    2204     local disksize imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage
     2075    local imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage
    22052076    imagesdir=$1
    2206     disksize=$2
    2207     kernelpath=$3
    2208     ramdisksize=$4
     2077    kernelpath=$2
     2078    ramdisksize=$3
    22092079    do_boot_root_thingy=""
    22102080    local retval old_pwd
     
    22122082
    22132083    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    2214     echo -en "Making "$disksize"KB boot disk..."
    2215     TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
    2216     [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "$BOOT_SIZE" ] && Die "PDBI - disksize is $disksize - bad size"
     2084    echo -en "Making "$BOOT_SIZE"KB boot disk..."
     2085    TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/mindi.rdz $ramdisksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"
    22172086    echo -en "..."
    2218     imagefile=$imagesdir/mindi-bootroot.$disksize.img
     2087    imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img
    22192088    mountpoint=$MINDI_TMP/mountpoint.$$
    22202089    mkdir -p $mountpoint
    2221 # If I format a 1722KB data file & run syslinux on it, the resultant image
    2222 # won't boot. So, I have formatted a floppy, called syslinux on/to it, and
    2223 # used 'dd' to copy it to sys-disk.raw (zipped to sys-disk.raw.gz).
    2224 # If I extract it, mount it, copy my files to it, etc. then the resultant
    2225 # image _is_ bootable. I don't know why syslinux and/or mkfs.vfat won't
    2226 # play nicely and I don't care. :) I have worked around the problem. -Hugo, 06/27/2002
    2227     if [ "$disksize" = "1722" ] ; then
    2228         gzip -dc $MINDI_LIB/sys-disk.raw.gz > $imagefile || Die "Cannot dd blank file"
    2229     else
    2230         dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file"
    2231         mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
    2232         syslinux $imagefile >> $LOGFILE 2>> $LOGFILE
    2233     fi
     2090    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
     2091    echo "Creating vfat filesystem on $imagefile" >> $LOGFILE
     2092    mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
     2093    syslinux $imagefile >> $LOGFILE 2>> $LOGFILE
     2094
    22342095    mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)"
    22352096
     
    22412102    cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root"
    22422103    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    2243         mv syslinux.cfg syslinux.cfg.orig
    2244         sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg
     2104        perl -pi -e 's/interactive/iso/' syslinux.cfg
    22452105    fi
    22462106    cd $old_pwd
     
    22642124    free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4`
    22652125    cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
    2266     if [ "$?" -ne "0" ] || [ "$FORCE_DUAL_FLOPPIES" = "yes" ] ; then
     2126    if [ "$?" -ne "0" ] ; then
    22672127        echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE
    22682128        du -sk $mountpoint/* >> $LOGFILE
    22692129        echo "--- end of list of files ---" >> $LOGFILE
    22702130        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\
    2271 Sorry, your kernel is too big for a boot/root floppy.\nI'll try the new boot/root two-disk thingy.\n" >> $LOGFILE
     2131Sorry, your kernel is too big for your image.\n" >> $LOGFILE
    22722132        rm -f $mountpoint/vmlinuz
    22732133        cd $old_pwd
     
    22752135        rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
    22762136
    2277         res=0
    2278         write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440
    2279         res=$(($res+$?))
    2280         cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 2>> $LOGFILE
    2281         res=$(($res+$?))
    22822137        rm -f $imagefile
    2283         if [ "$res" -ne "0" ]; then
    2284             LogIt "WARNING - failed to create 1.44MB boot/root floppies"
    2285             rm -f $imagesdir/mindi-*.1440.img
    2286         fi
    2287         return $res
     2138        return 0
    22882139    fi
    22892140    free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4`
    22902141    max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`))
    2291     echo "Free space left on floppy = $free_space KB" >> $LOGFILE
    2292     echo "Max kernel size on $disksize KB floppy (est'd) = $max_kernel_size K" >> $LOGFILE
     2142    echo "Free space left on image = $free_space KB" >> $LOGFILE
     2143    echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE
    22932144
    22942145    # make it bootable
     
    23012152
    23022153    if [ "$retval" -eq "0" ] ; then
    2303         echo -en "...$DONE\r"
     2154        echo -en "...$DONE\n"
    23042155        if [ "$KERN_DISK_MADE" ] ; then
    23052156            rm -f $imagefile
    2306             LogIt "... $disksize KB boot disks were created OK\r"
    2307         fi
    2308     else
    2309         echo -en "...failed\r"
    2310         LogIt $disksize"KB boot disk was NOT created\r"
     2157            LogIt "$BOOT_SIZE KB boot disks were created OK\n"
     2158        fi
     2159    else
     2160        echo -en "...failed\n"
     2161        LogIt $BOOT_SIZE"KB boot disk was NOT created\n"
    23112162        rm -f $imagefile
    23122163    fi
     
    23172168
    23182169PrepareDataDiskImages() {
    2319     local needlist bigdir minidir_root tardir diskdir imagesdir res i j k old_pwd lines
     2170    local needlist bigdir minidir_root tardir diskdir imagesdir res i j k old_pwd lines lfiles
    23202171
    23212172    imagesdir=$1
     
    23282179    tardir=$MINDI_TMP/tardir
    23292180
    2330     lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l`
    2331     cat $MINDI_CONF/deplist.txt | GenerateGiantDependencyList $needlist $lines
     2181    lfiles="$DEPLIST_FILE"
     2182    lines=`grep -vx " *#.*" $lfiles | grep -vx "" | wc -l`
     2183    cat $lfiles | GenerateGiantDependencyList $needlist $lines
    23322184    res=$?
    23332185    if [ "$YOUR_KERNEL_SUCKS" ]; then
     
    23652217    FindAndAddUserKeyboardMappingFile
    23662218    mkdir -p $bigdir/tmp
    2367     if [ _"$MONDO_SHARE" != _"" ] ; then
     2219    if [ _"$MONDO_SHARE" != _"" ]; then
    23682220        MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg
    23692221        cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null
     
    24142266    noof_disks=$?
    24152267    [ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
    2416 #    if [ "$noof_disks" -ge "8" ] ; then
    2417 #        LogIt "You are putting a ludicrously large amount of data on these disks."
    2418 #        LogIt "I shall therefore double EXTRA_SPACE, just in case your ramdisk is too small."
    2419 #        EXTRA_SPACE=$(($EXTRA_SPACE*2))
    2420 #    fi
    24212268    MakeMountlist $MINDI_TMP/mountlist.txt
    24222269    mkdir -p $minidir_root/$noof_disks/tmp
    24232270    cp -f $MINDI_TMP/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt 2> /dev/null || Die "Cannot copy mountlist.txt from $MINDI_TMP to data disk"
    2424     [ _"$MONDO_SHARE" != _"" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/. 2>> $LOGFILE
     2271    if [ _"$MONDO_SHARE" != _"" ]; then
     2272        cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/. 2>> $LOGFILE
     2273    fi
    24252274    [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm || LVM="false"
    24262275    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     
    27922641
    27932642TurnTgzIntoRdz() {
    2794     local tgz_dir_fname rdz_fname ramdisksize tempfile mountpoint old_pwd nodes disksize kernelsize maxsize res currsize not_copied j k floppy_modules s w
     2643    local tgz_dir_fname rdz_fname ramdisksize tempfile mountpoint old_pwd nodes kernelsize maxsize res currsize not_copied j k s w needed_modules_path
    27952644
    27962645    tgz_dir_fname=$1
    27972646    rdz_fname=$2
    27982647    ramdisksize=$3
    2799     disksize=$4
    2800     kernelsize=$5
    2801     maxsize=$(($disksize-$kernelsize))
     2648    kernelsize=$4
     2649    maxsize=$(($BOOT_SIZE-$kernelsize))
    28022650    maxsize=$(($maxsize*2)); # to allow for compression of 50%
    28032651    tempfile=$MINDI_TMP/temp.rd
     
    29032751    fi
    29042752
    2905     for w in cdrom floppy groovy-stuff ; do
     2753    for w in cdrom groovy-stuff ; do
    29062754        mkdir -p mnt/$w
    29072755    done
     
    29222770    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    29232771        cd $MINDI_TMP
    2924         floppy_modules_path=lib/modules/$FAILSAFE_KVER
     2772        needed_modules_path=lib/modules/$FAILSAFE_KVER
    29252773    else
    29262774        cd /
    2927 ###
    2928 ### Sq-Modification... Use kernel name in module path if specified.
    2929 ###
    2930         #floppy_modules_path=lib/modules/`uname -r`
    29312775        if [ "${kernelname}" != "" ]
    29322776        then
    2933             floppy_modules_path=lib/modules/${kernelname}
     2777            needed_modules_path=lib/modules/${kernelname}
    29342778        else
    2935             floppy_modules_path=lib/modules/`uname -r`
    2936         fi
    2937 ###
    2938 ### Sq-Modification end
    2939 ###
    2940     fi
    2941     floppy_modules=""
    2942     if [ "$disksize" -lt "2880" ] ; then
    2943         list_of_groovy_mods="$FLOPPY_MODS $FORCE_MODS $IDE_MODS ide-scsi sr_mod cdrom isocd isofs `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`"
    2944     else
    2945         list_of_groovy_mods="$CDROM_MODS $FORCE_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`"
    2946     fi
     2779            needed_modules_path=lib/modules/`uname -r`
     2780        fi
     2781    fi
     2782
     2783    needed_modules=""
     2784    list_of_groovy_mods="$CDROM_MODS $FORCE_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`"
     2785
    29472786    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    29482787        # For PXE boot
     
    29572796    done
    29582797
    2959     [ -e "$floppy_modules_path" ] || LogIt "path $floppy_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."
     2798    [ -e "$needed_modules_path" ] || LogIt "path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."
    29602799    for i in $list_of_groovy_mods ; do
    2961         floppy_modules="$floppy_modules `FindSpecificModuleInPath $floppy_modules_path $i`"
    2962     done
    2963     for i in $floppy_modules ; do
     2800        needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`"
     2801    done
     2802    for i in $needed_modules ; do
    29642803        [ -e "$i" ] && s=`du -sk $i | cut -f1` || s=""
    29652804        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
     
    29762815
    29772816    # Also copy modules.dep in case of udev so that normal modprobe works
    2978     cp --parents -pdf /$floppy_modules_path/modules.dep $mountpoint 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint"
     2817    cp --parents -pdf /$needed_modules_path/modules.dep $mountpoint 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint"
    29792818
    29802819    # For all modules supported, create symlinks under the mountpoint
     
    29852824        (cd $mountpoint ; ln -s $i . 2>/dev/null)
    29862825    done
    2987     if [ ! -e "/sbin/devfsd" ] || [ "$disksize" -lt "2880" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
     2826    if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
    29882827        echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE
    29892828        [ ! -e "/sbin/devfsd" ] && echo "...because /sbin/devfsd not found" >> $LOGFILE
    2990         [ "$disksize" -lt "2880" ] && echo "...because disksize = $disksize" >> $LOGFILE
    29912829        [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE
    29922830        rm -f $mountpoint/sbin/devfsd
     
    29962834    dd if=/dev/zero of=$mountpoint/zero &> /dev/null
    29972835    rm -f $mountpoint/zero
    2998     if [ _"$MONDO_SHARE" != _"" ] ; then
     2836    mkdir -p $mountpoint/tmp
     2837    if [ _"$MONDO_SHARE" != _"" ]; then
    29992838        MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg
    30002839        cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null
     
    30072846        [ "$USE_STAR" = "yes" ] && echo -en "Using star. Hooray." >> $mountpoint/tmp/USING-STAR
    30082847    fi
    3009     mkdir -p $mountpoint/tmp
    30102848    mkdir -p $mountpoint/proc
    3011     echo "$disksize" > $mountpoint/tmp/$disksize.siz
    3012     find $mountpoint -name CVS -exec rm -rf '{}' \;
     2849    echo "$BOOT_SIZE" > $mountpoint/tmp/$BOOT_SIZE.siz
    30132850    # Determine what filesystem to use for initrd image
    30142851    echo "Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." >> $LOGFILE
     
    31122949##############################################################################
    31132950
     2951# Now we can create what we need
     2952mkdir -p $MINDI_TMP
     2953
     2954# Purge from potential old run
     2955if [ _"$MINDI_CACHE" = _"" ]; then
     2956    Die "MINDI_CACHE undefined"
     2957fi
     2958rm -rf $MINDI_CACHE/* 2> /dev/null
     2959mkdir -p $MINDI_CACHE
     2960
     2961if [ "$1" = "--printvar" ] ; then
     2962    shift
     2963    if [ _"$1" != _"" ] ; then
     2964        set | grep -Ew "^$1" | cut -d= -f2
     2965    fi
     2966    MindiExit 0
     2967fi
    31142968
    31152969> $LOGFILE
     
    31292983# Log some capital variables
    31302984[ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly."
     2985echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
    31312986echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE
    31322987echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE
    31332988[ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly."
    31342989echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
    3135 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
     2990if [ -f $MINDI_CONFIG ]; then
     2991    echo "-----------------------------" >> $LOGFILE
     2992    echo " Mindi configuration file    " >> $LOGFILE
     2993    echo "-----------------------------" >> $LOGFILE
     2994    grep -Ev '^#' $MINDI_CONFIG >> $LOGFILE
     2995    echo "-----------------------------" >> $LOGFILE
     2996fi
     2997
    31362998
    31372999trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT
     
    31753037fi
    31763038
    3177 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1`
     3039# If we have a distribution-specific script for finding a FAILSAFE kernel, use it.
     3040if [ -f "$MINDI_LIB/FindDistroFailsafe" ] && [ ! "$1" = "--makemountlist" ] && [ "$kernelpath" = "FAILSAFE" ]; then
     3041    source $MINDI_LIB/FindDistroFailsafe
     3042    # Log kernel image
     3043    LogIt "FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"
     3044else
     3045    [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1`
     3046fi
    31783047
    31793048if ! which mkfs.vfat 1> /dev/null 2> /dev/null ; then
     
    31933062    FindLiloBinary
    31943063fi
    3195 # BERLIOS: Remove as too dangerous and now useless
    3196 #grep -F " $MINDI_TMP " /proc/mounts | grep -F tmpfs > /dev/null 2> /dev/null && MINDI_TMP=/home/tmpmondo && mkdir -p $MINDI_TMP && LogIt "Changing MINDI_TMP to $MINDI_TMP because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason
    31973064trap "Aborted" SIGTERM
    31983065DONE="\r\t\t\t\t\t\t\t\tDone.         "
     
    34953362fi
    34963363if [ _"$MONDO_SHARE" = _"" ] && [ "$ARCH" != "ia64" ]; then
    3497     echo -en "Would you like to use LILO (instead of syslinux)\nfor your boot CD/floppies (y/[n]) ?"
     3364    echo -en "Would you like to use LILO (instead of syslinux)\nfor your boot image (y/[n]) ?"
    34983365    read ch
    34993366    if [ "$ch" != "y" ] && [ "$ch" != "Y" ] ; then
     
    35043371fi
    35053372if [ "$YOUR_KERNEL_SUCKS" != "" ] || [ "$kernelpath" = "" ] || [ "$kernelpath" = "SUCKS" ] || [ "$kernelpath" = "FAILSAFE" ] ; then
    3506     kernelpath=$MINDI_LIB/vmlinuz
    3507     LogIt "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks."
    3508     LogIt "However, you are still running your kernel. If Mindi fails to create your"
    3509     LogIt "disks then it may still be a result of a problem with your kernel."
    3510     pwd=`pwd`
    3511     cd $MINDI_TMP
    3512     bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2"
    3513     cd $pwd
     3373    # If we have a distribution-specific script for finding a FAILSAFE kernel, use it.
     3374    if [ -f "$MINDI_LIB/FindDistroFailsafe" ] && [ ! "$1" = "--makemountlist" ]; then
     3375        source $MINDI_LIB/FindDistroFailsafe
     3376        # Log kernel image
     3377        LogIt "FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"
     3378        kernelpath="$FAILSAFE_KBIN"
     3379        LogIt "I shall include a failsafe kernel, not your kernel, in the boot disks.\n"
     3380        LogIt "The failsafe kernel is $kernelpath.\n"
     3381        LogIt "However, you are still running your kernel. If Mindi fails to create your\n"
     3382        LogIt "disks then it may still be a result of a problem with your kernel.\n"
     3383        pwd=`pwd`
     3384        cd $MINDI_TMP
     3385        mkdir -p lib/modules
     3386        cp -a "/lib/modules/$FAILSAFE_KVER" "lib/modules/$FAILSAFE_KVER" || Die "Cannot copy kernel modules."
     3387        cd $pwd
     3388    else
     3389        kernelpath=$MINDI_LIB/vmlinuz
     3390        LogIt "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks."
     3391        LogIt "However, you are still running your kernel. If Mindi fails to create your"
     3392        LogIt "disks then it may still be a result of a problem with your kernel."
     3393        pwd=`pwd`
     3394        cd $MINDI_TMP
     3395        bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2"
     3396        cd $pwd
     3397    fi
    35143398    YOUR_KERNEL_SUCKS="Your kernel sucks"
    35153399fi
     
    35273411echo "Ramdisk will be $ramdisk_size KB" >> $LOGFILE
    35283412if [ "$ARCH" = "ia64" ] ; then
    3529     PrepareBootDiskImage_LILO $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppy disk image."
     3413    PrepareBootDiskImage_LILO $MINDI_CACHE $kernelpath $ramdisk_size || Die "Failed to create ia64 image disk image."
    35303414else
    35313415    if [ "$USE_LILO" = "yes" ] ; then
    3532         if ! PrepareBootDiskImage_LILO $MINDI_CACHE 1722 $kernelpath $ramdisk_size ; then
    3533             LogIt "WARNING - failed to create 1.72MB boot image."
    3534             LogIt "Please reduce your kernel's size if you want to make a 1.72MB floppy disk."
    3535         fi
    3536         if ! PrepareBootDiskImage_LILO $MINDI_CACHE 2880 $kernelpath $ramdisk_size ;  then
    3537             LogIt "WARNING - failed to create 2.88MB floppy disk image."
    3538             LogIt "Please reduce your kernel's size if you want to make a 2.88MB floppy disk."
    3539             PrepareBootDiskImage_LILO $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image."
    3540         fi
    3541     else
    3542         if ! PrepareBootDiskImage_SYSLINUX $MINDI_CACHE 1722 $kernelpath $ramdisk_size ; then
    3543             LogIt "WARNING - failed to create 1.72MB boot image."
    3544             LogIt "Please reduce your kernel's size if you want to make a 1.72MB floppy disk."
    3545             if ! PrepareBootDiskImage_SYSLINUX $MINDI_CACHE 2880 $kernelpath $ramdisk_size ; then
    3546                 LogIt "WARNING - failed to create 2.88MB floppy disk image."
    3547                 LogIt "Please reduce your kernel's size if you want to make a 2.88MB floppy disk."
    3548                 PrepareBootDiskImage_SYSLINUX $MINDI_CACHE $BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create $BOOT_SIZE kB floppy disk image."
    3549             fi
    3550         fi
     3416        PrepareBootDiskImage_LILO $MINDI_CACHE $kernelpath $ramdisk_size || Die "Failed to create $BOOT_SIZE MB disk image."
     3417    else
     3418        PrepareBootDiskImage_SYSLINUX $MINDI_CACHE $kernelpath $ramdisk_size || Die "Failed to create $BOOT_SIZE MB disk image."
    35513419    fi
    35523420fi
     
    35573425if [ _"$MONDO_SHARE" = _"" ]; then
    35583426    ListImagesForUser $MINDI_CACHE
    3559     boot_dev=/dev/fd0u1722
    3560     [ ! -e "$boot_dev" ] && mknod $boot_dev b 2 60
    3561     [ ! -e "$boot_dev" ] && boot_dev=/dev/fd0H1722
    3562     [ ! -e "$boot_dev" ] && Die "Oh Lord, will you PLEASE tell the vendor to create the 1.72MB devices in /dev?"
    3563     if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then
    3564         OfferToCopyImagesToDisks $MINDI_CACHE $boot_dev $FDDEVICE
    3565     fi
     3427    OfferToMakeBootableISO $MINDI_CACHE
    35663428    if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ]; then
    35673429        OfferToMakeBootableUSB $MINDI_CACHE
    35683430    fi
    3569     OfferToMakeBootableISO $MINDI_CACHE
    35703431    LogIt "Finished."
    35713432elif [ "$TAPEDEV" ] ; then
     3433    rm -f $MINDI_CACHE/{*img,*gz,*iso}
    35723434    OfferToMakeBootableISO $MINDI_CACHE
    35733435    if [ -e "$MINDI_CACHE/all.tar.gz" ] ; then
  • branches/2.2.5/mindi/rootfs/README

    r1611 r1885  
    66which may be found at <http://www.mondorescue.org>.
    77
    8 This CD (or, this set of floppy disks) contains the tools required to do
     8This media image contains the tools required to do
    99basic system maintenance, e.g. formatting, moving files, mounting partitions.
    1010
  • branches/2.2.5/mindi/rootfs/sbin/find-and-mount-cdrom

    r1826 r1885  
    7575    exit 0
    7676fi
    77 #mount /dev/fd0u1722 -t ext2 /mnt/floppy
    78 [ "$1" = "--second-try" ] && exit 1; # don't try to mount floppy drive
     77[ "$1" = "--second-try" ] && exit 1;
    7978if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ] ; then
    8079    LogIt "Because you are using cdstream, I won't try to mount CD."
    8180    exit 0
    8281fi
    83 mount /dev/fd0 -t ext2 -o ro /mnt/floppy 2> /dev/null
    84 if [ "$?" -eq "0" ] ; then
    85     umount /mnt/floppy 2> /dev/null
    86     exit 1
    87 else
    88     LogIt "Please go to another PC, mount this CD and copy the data disk images" 1
    89     LogIt "from the CD's /images directory to blank 1.44MB floppy disks. You should" 1
    90     LogIt "use something like 'dd if=/mnt/cdrom/images/mindi-data-1.img of=/dev/fd0'" 1
    91     LogIt "for the first data disk, mindi-data-2.img for the second, and so on." 1
    92     LogIt "(If you are already booting from a floppy, please ignore this message.)" 1
    93     exit 2
    94 fi
    9582
    96 
    97 
    98 
     83LogIt "Unable to find and mount your CD-ROM" 1
     84LogIt "You probably miss the correct driver to support your CD-ROM drive" 1
     85exit 2
  • branches/2.2.5/mindi/rootfs/sbin/init

    r1863 r1885  
    124124        LogIt "$tapedev failed to act as extended data disk for booting." 1
    125125        LogIt "Please specify an alternate tape device," 1
    126         LogIt "or hit <Enter> to boot from CD/floppies." 1
     126        LogIt "or hit <Enter> to boot from another media." 1
    127127        echo -en "---> "
    128128        read tapedev
     
    140140    if [ "$res" -ne "0" ] ; then
    141141        cd /
    142         LogIt "Failed to use tape as extended datadisk. Reverting to floppies." 1
    143         HandleCDROMorFloppies
     142        LogIt "Failed to use tape as extended datadisk. Reverting to another media." 1
     143        HandleCDROM
    144144        res=$?
    145145    else
     
    155155
    156156
    157 HandleCDROMorFloppies() {
     157HandleCDROM() {
    158158    # Just in case we have an iLO ensure we will map it correctly
    159159    echo "$DENY_MODS" | grep -q "usb-storage "
     
    186186        LogIt "OK, I am running on a CD-ROM. Good." 3
    187187        CD_MOUNTED_OK=yes
    188     elif [ "$res" -eq "1" ] ; then
    189         LogIt "OK, I am running on floppies. Good." 3
    190         CD_MOUNTED_OK=""
    191     else
    192         LogIt "OK, I am falling back to floppy mode." 3
    193         LogIt "(You lay not have the right drivers" 3
    194         LogIt "to support the hardware on which we are running)" 3
    195         LogIt "That means you'll have to copy the data disk images from" 3
    196         LogIt "the CD/hard disk/whatever to physical 1.44MB disks and" 3
    197         LogIt "insert them, one after the other. Please see the manual." 3
    198         LogIt "The images are in /images on the CD, or /root/images/mindi" 3
    199         LogIt "on your hard disk. Your archives are probably fine but" 3
    200         LogIt "your tape streamer and/or CD-ROM drive are eccentric. :-)" 3
     188    else
     189        LogIt "You probably not have the right drivers" 3
     190        LogIt "to support the hardware on which we are running" 3
     191        LogIt "Your archives are probably fine but" 3
     192        LogIt "your tape streamer and/or CD-ROM drive are unsupported at that point." 3
    201193        CD_MOUNTED_OK=""
    202194    fi
     
    619611mount -o remount rw /
    620612[ ! "$GROOVY" ] && Die "I'm not groovy!"
    621 for i in $GROOVY /mnt/floppy /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do
     613for i in $GROOVY /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do
    622614    mkdir -p $i
    623615done
     
    698690    ExtractDataDisksAndLoadModules
    699691else
    700     HandleCDROMorFloppies
     692    HandleCDROM
    701693    ExtractDataDisksAndLoadModules
    702694    # We need to get here exported variables from start-nfs
     
    781773else
    782774    LogIt "backup-media-type is not specified in config file."
    783     LogIt "I think this CD/floppy has no archives on it."
     775    LogIt "I think this media has no archives on it."
    784776fi
    785777if grep "RESTORE" /proc/cmdline > /dev/null 2> /dev/null ; then
  • branches/2.2.5/mindi/rootfs/sbin/untar

    r1734 r1885  
    1414# ---------------------- main ----------------------
    1515
    16 mountpoint=/mnt/floppy
     16mountpoint=/dev/null
    1717[ -e "/tmp/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images
    1818[ "$#" -eq "2" ] || Die "untar <tarball> <untar_to>"
     
    2222if [ -e "/tmp/CDROM-LIVES-HERE" ] ; then
    2323    [ -e "$tarball" ] || LogIt "Can't find CD's $tarball" 1
    24 else
    25     while [ ! -f "$tarball" ] ; do
    26         echo -e -n "Please insert data (floppy) disk #$diskno and press ENTER."
    27         read line
    28         mount /dev/fd0 -t ext2 -o ro $mountpoint
    29         [ -f "$tarball" ] || umount $mountpoint ; # unmount if tarball not on disk
    30         echo -en "Working..."
    31     done
    3224fi
    3325
  • branches/2.2.5/mondo-doc/mindi.8

    r1691 r1885  
    3939.PP
    4040.B mindi
    41 creates a set of boot/root floppy disk images and/or a bootable ISO/USB image using
    42 files from the system it runs on.
     41creates a bootable ISO/USB image using files from the system it runs on.
    4342.B mindi
    4443will try hard to reproduce the environment of its host system including loaded
     
    4847is used by
    4948.B monodarchive(8)
    50 to produce the required boot/root floppy or USB/ISO images but can also be used
    51 stand-alone.
     49to produce the required USB/ISO images but can also be used stand-alone.
    5250
    5351For stand-alone usage,
     
    157155.I /var/cache/mindi/mindi-boot.F.img
    158156.B mindi
    159 boot floppy of size F [KB].
     157boot media of size F [KB].
    160158.TP
    161159.I /var/cache/mindi/mindi-root.F.img
    162160.B mindi
    163 root floppy of size F [KB].
     161root media of size F [KB].
    164162.TP
    165163.I /var/cache/mindi/mindi-data.N.img
    166164.B mindi
    167 data floppy number N for boot/root floppies.
     165data media number N for boot/root media.
    168166.TP
    169167.I /var/cache/mindi/mindi.iso
  • branches/2.2.5/mondo-doc/mondoarchive.8

    r1762 r1885  
    4646With
    4747.BR \-O ,
    48 it backs up your filesystem to CD, tape, ISO images or NFS share. Boot floppies
     48it backs up your filesystem to CD, tape, ISO images or NFS share. Boot media
    4949or a special boot CD will be created to allow you to restore from bare metal if
    5050necessary.
     
    6969To restore data, either run
    7070.I mondorestore
    71 from the command line or boot from the emergency CD/floppies generated during
     71from the command line or boot from the emergency media generated during
    7272the backup process. The latter will come in handy if a gremlin wipes your hard
    7373disk.
     
    209209.TP
    210210.BI "-o "
    211 Use LILO as boot loader of boot floppy/CD instead of SYSLINUX/ISOLINUX. By
    212 default, SYSLINUX is used for floppies and ISOLINUX for CD's. Use LILO if you
     211Use LILO as boot loader of boot media instead of SYSLINUX/ISOLINUX. By
     212default, SYSLINUX is used for USB and ISOLINUX for CD's. Use LILO if you
    213213prefer to use that boot loader. NB: This does not affect which boot loader you
    214 use to boot your PC, merely the boot loader used by the CD's/floppies created
     214use to boot your PC, merely the boot loader used by the media created
    215215by Mondo. Use ELILO instead which is mandatory for IA64 machines.
    216216
     
    249249
    250250.TP
    251 .BI "-F "
    252 Do not offer to write boot+data floppy disk images to 3.5-inch floppy disks.
    253 The images will remain in /var/cache/mindi until your next backup run,
    254 however.
    255 
    256 .TP
    257251.BI "-H "
    258252When you boot from the tape/CD, your hard drive will be wiped and the archives
  • branches/2.2.5/mondo-doc/mondorescue-howto.sgml

    r1691 r1885  
    3131other supported filesystem partitions to/from CD/DVD-+R/RW media, tape,
    3232NFS, ... and Mindi Linux provides the bootable emergency restore
    33 CD/floppy set which Mondo uses at boot-time.
     33media which Mondo uses at boot-time.
    3434</para>
    3535</abstract>
     
    421421</entry>
    422422<entry>
    423 Mondo calls Mindi. Mindi generates bootable floppy disk images and
     423Mondo calls Mindi. Mindi generates bootable media image and
    424424auxiliary data disk images which are based on your existing Linux
    425425distribution and filesystem. That way, you can be sure Mondo's
     
    445445</entry>
    446446</row>
    447 <row>
    448 <entry>
    449 <ulink url="images/10cd.png"><inlinemediaobject><imageobject>
    450 <imagedata fileref="images/10cd-mini">
    451 </imageobject></inlinemediaobject>
    452 </ulink>
    453 </entry>
    454 <entry>
    455 Do you want to create a boot floppy at the end? Yes, if you're a
    456 tape or NFS user. No, if you are using CD/DVD-R[W]'s and your computer
    457 supports bootable CD's. Tape users only need one floppy but other
    458 users may need more. Mondo will advise accordingly.
    459 </entry>
    460 </row>
    461447</tbody></tgroup></informaltable>
    462448
    463449<itemizedlist>
    464450<listitem>
    465 <para>Try to boot from the first CD of the backup (or the first
    466 floppy, if you made floppies). Choose 'Compare Mode' by typing
    467 compare at the boot screen.</para>
     451<para>Try to boot from the first media of the backup.
     452Choose 'Compare Mode' by typing compare at the boot screen.
     453</para>
    468454</listitem>
    469455<listitem>
     
    471457checkout the compatibility of your system. (see
    472458<link linkend="test-mindi">Testing Mindi</link> for more
    473 details). Remove the CD/floppy; boot your computer as usual;
     459details). Remove the media; boot your computer as usual;
    474460execute as root</para>
    475461<para></para>
     
    553539The '-gF' means you are going to see the pretty yellow-on-blue
    554540screen instead of the boring white-on-black screen. :) It also
    555 means Mondo will not offer to create physical boot floppies for
     541means Mondo will not offer to create physical boot media for
    556542you. It is assumed that you are able to boot from the CD which
    557543Mondo has generated.</para>
     
    612598If you find this to be the case for your computer, please use '-L'
    613599to force Mondo to use LILO instead of Syslinux as the boot loader
    614 for its CD/floppies. (NB: This has nothing to do with which boot
     600for its media. (NB: This has nothing to do with which boot
    615601loader your hard drive uses.) Also, it is a good habit to specify
    616602your tape streamer with '-d &lt;device&gt;'. You don't usually need
     
    691677<title>Mindi</title>
    692678<para>
    693 Mindi Linux creates a set of boot/root floppy disk images
     679Mindi Linux creates a set of boot/root media images
    694680that will let you perform basic system maintenance on your Linux
    695681distro. The principal virtues of Mindi's boot disks are the fact
     
    757743<listitem>
    758744    <para>If you are not backing up to CD, please create boot
    759     floppies when prompted.</para>
     745    media when prompted.</para>
    760746</listitem>
    761747</itemizedlist>
     
    766752command-line options.</para>
    767753</listitem>
    768 <listitem><para>Insert the CD or the first boot floppy when prompted.
     754<listitem><para>Insert the media when prompted.
    769755                Press &lt;Enter&gt;. Wait a moment.</para></listitem>
    770756<listitem><para>Select a subset of files to restore, e.g. /usr/local/man
     
    778764<itemizedlist>
    779765<listitem>
    780 <para>Boot from CD/floppies.</para>
     766<para>Boot from media.</para>
    781767</listitem>
    782768<listitem><para>Select 'Interactive Mode' at boot-time. (Type
     
    916902</listitem>
    917903<listitem>
    918 <para>floppy disk support (built in)</para>
    919 </listitem>
    920 <listitem>
    921904<para>ext2 file system support (built-in)</para>
    922905</listitem>
     
    929912also</para>
    930913<para>vfat support in the active kernel - mindi needs this when creating
    931 syslinux boot floppies</para>
     914syslinux boot media</para>
    932915</listitem>
    933916</itemizedlist>
     
    940923module. It does require that your kernel support the initrd
    941924initial ramdisk facility. Typically this is supported by the Linux
    942 kernel. Modules used are needed to support the CD, floppy disks,
     925kernel. Modules used are needed to support the CD,
    943926hard disks, etc. If the support is modular, then the modules will
    944927be incorporated in a boot disk by Mindi. If the support is built-in
     
    12331216Do you want to use your own kernel to build the boot disk (y/n) ?y
    12341217Would you like to use LILO (instead of syslinux)
    1235 for your boot CD/floppies (y/n) ?n
     1218for your boot media (y/n) ?n
    12361219Analyzing dependency requirements                               Done.
    12371220Making complete dependency list                                 Done.
     
    12651248Failed to copy /boot/vmlinuz-2.6.12-15mdk-i686-up-4GB to ramdisk
    12661249
    1267 Warning - failed to create 1.44MB boot/root floppies
    1268 
    1269 Warning - failed to create 1.72MB boot image. Please reduce your kernel's size
    1270 
    1271 if you want to make a 1.72MB floppy disk.
    1272 
    12731250Making 2880KB boot disk...........................mkfs.vfat 2.10 (22 Sep 2003)
    12741251... 2880 KB boot disks were created OK                          Done.
    12751252In the directory '/root/images/mindi' you will find the images:-
    12761253   mindi-data-1.img    mindi-data-2.img    mindi-data-3.img    mindi-data-4.img    mindi-data-5.img mindi-root.1440.img
    1277 Would you like to create boot+data floppy disks now (y/n) ?n
    12781254Shall I make a bootable CD image? (y/n) y
    12791255NB: Mindi's bootable CD always uses isolinux.
     
    12901266
    12911267<para>If your kernel is too large (more than about 900KB) then you
    1292 cannot make boot floppies, although you can still make a bootable
     1268cannot make boot media, although you can still make a bootable
    12931269CD image. The easiest way to test Mindi in either case is to say
    12941270'n' to its first question and 'y' to its second, then use the
     
    15371513isn't a good idea unless you're a Mondo expert because they'll try
    15381514to restore over a network by default, which is silly because the
    1539 archives are on the CD's). Or, you can boot from the Mindi floppies
     1515archives are on the CD's). Or, you can boot from the Mindi media
    15401516(or mondorescue.iso) and hit ENTER a few times to restore.</para>
    15411517<para>Those ISO images can also be used for a PXE restore. For this
     
    19141890</para>
    19151891<para>If you find that you cannot make your PC boot from the CD,
    1916 take heart: the first backup CD of each set contains floppy disk
    1917 images to give you the same functionality as the CD (minus the
    1918 archives, of course) on floppies. Remember, your Mondo CD is a
     1892take heart: the first backup media of each set contains disk
     1893images to give you the same functionality as this media (minus the
     1894archives, of course) on other boot media. Remember, your Mondo CD is a
    19191895fully functional CD-based mini-distribution as well as a recovery
    19201896CD.</para>
     
    20181994<listitem>
    20191995<para>If it did not work then please copy /tmp/mondorestore.log to
    2020 a floppy (or to your hard disk, USB key, ...), gzip it and e-mail it to the
     1996to your hard disk, USB key, ..., gzip it and e-mail it to the
    20211997&ML;.</para>
    20221998</listitem>
     
    23612337<para>It is now possible to restore to a live filesystem using
    23622338Mondo. In other words, you do not have to boot your PC from your
    2363 CD/floppy in order to restore files. Mondo was originally designed
     2339media in order to restore files. Mondo was originally designed
    23642340for disaster recovery - situations in which you cannot boot your
    23652341PC. If you can boot your PC, it is not really a disaster, is it? :)
     
    23902366Choose your type of backup media. The live restoration process is
    23912367very similar to what you'll experience if you type mondorestore
    2392 with no parameters after booting from a Mondo CD/floppy.
     2368with no parameters after booting from a Mondo media.
    23932369</entry>
    23942370</row>
     
    24042380tape backup, the tape itself should be enough. If you generated a
    24052381CD backup, the first CD should be enough. Otherwise, you may need
    2406 the boot floppy.
     2382the boot media.
    24072383</entry>
    24082384</row>
     
    26632639</qandaentry>
    26642640<qandaentry>
    2665 <question><para>Q: Why do you insist on putting floppy
     2641<question><para>Q: Why do you insist on putting media
    26662642disk images on Mondo CD? They waste space and I never use them. The
    2667 CD works just fine, so why keep the floppy disk images?</para>
     2643CD works just fine, so why keep the media disk images?</para>
    26682644</question>
    26692645<answer>
     
    27432719your kernel does not support these things, Mondo will not boot from
    27442720your CD. However, when running Mindi, you may choose to use _its_
    2745 kernel instead of your own. In addition, you may boot from floppy
    2746 disk images instead the CD: copy the disk images from the CD
    2747 /images directory to floppy disks, using 'dd'. Take a look at
    2748 <link linkend="copybootdatadisk">Copy boot data
    2749 disks</link> on how to make those.</para>
    2750 </answer>
    2751 </qandaentry>
    2752 <qandaentry>
    2753 <question><para>Q: The Mondo CD/floppy takes ages to
     2721kernel instead of your own.
     2722</para>
     2723</answer>
     2724</qandaentry>
     2725<qandaentry>
     2726<question><para>Q: The LILO Mondo media takes ages to
    27542727                boot. How can I speed it up?</para></question>
    27552728<answer>
     
    27732746</qandaentry>
    27742747<qandaentry>
    2775 <question><para>Q: What if my PC won't boot from a
    2776                 CD?</para></question>
    2777 <answer>
    2778 <para>A: Copy the image files from the CD /images directory, using
    2779 the dd command. Take a look at
    2780 <link linkend="copybootdatadisk">Copy boot data
    2781 disks</link> on how to make those. Then boot from the first
    2782 floppy; follow it up with the data disks; finally, type 'mount
    2783 /mnt/cdrom' and then utilize the restore script as usual, e.g.
    2784 mondorestore.</para>
    2785 <para>A: You may also want to boot using the network with PXE.
    2786         Look at the README.pxe file of mindi to know more details on how.</para>
    2787 </answer>
    2788 </qandaentry>
    2789 <qandaentry>
    2790 <question><para>Q: But why won't Mondo boot from my CD?
     2748<question><para>Q: Why won't Mondo boot from my CD?
    27912749It says my kernel is flawed/outdated/ whatever, and when I wrote to
    27922750the ML, they told me the same thing... but I still don't get it. I
     
    28082766aside for a large tarball containing the data disks, a list of all
    28092767files backed up, and other sundries. If Mondo and Mindi do their
    2810 respective jobs then you won't need additional floppies, just the
    2811 boot floppy and the tape(s).</para>
     2768respective jobs then you won't need additional media, just the
     2769boot media and the tape(s).</para>
    28122770<para>For the moment mondorescue doesn't support OBDR for tapes.
    28132771        Feel free to produce patches for it :-)</para>
     
    28372795at <link linkend="overview-sysrq-kernelreq">Linux Kernel support</link> to
    28382796see what your kernel must support.</para>
    2839 </answer>
    2840 </qandaentry>
    2841 <qandaentry>
    2842 <question>
    2843 <para id="copybootdatadisk">Q: How do i copy boot+data disk images to physical floppy disks ?</para>
    2844 </question>
    2845 <answer>
    2846 <para>A: The images are in /root/images/mindi (even if they are
    2847 created by Mondo) and also in the 'images' directory on the first
    2848 CD of your backup set, if you have backed up to CD. You can copy
    2849 the images to disk as follows:-</para>
    2850 <informaltable><tgroup cols="1"><tbody>
    2851 <row>
    2852 <entry>
    2853         Put an empty Boot floppy
    2854 </entry>
    2855 </row>
    2856 <row>
    2857 <entry>
    2858         bash# fdformat /dev/fd0u1722
    2859 </entry>
    2860 </row>
    2861 <row>
    2862 <entry>
    2863         bash# dd if=/root/images/mindi/mindi-boot.1722.img of=/dev/fd0u1722
    2864 </entry>
    2865 </row>
    2866 <row>
    2867 <entry>
    2868         Put an empty Data floppy
    2869 </entry>
    2870 </row>
    2871 <row>
    2872 <entry>
    2873         bash# fdformat /dev/fd0
    2874 </entry>
    2875 </row>
    2876 <row>
    2877 <entry>
    2878         bash# dd if=/root/images/mindi/mindi-data-N.img of=/dev/fd0
    2879 </entry>
    2880 </row>
    2881 <row>
    2882 <entry>
    2883         Replace N with 1, 2, etc.
    2884 
    2885 </entry>
    2886 </row>
    2887 </tbody></tgroup></informaltable>
    28882797</answer>
    28892798</qandaentry>
     
    30132922</qandaentry>
    30142923<qandaentry>
    3015 <question><para>Q: How do I copy the floppy images from
    3016                 the CD to floppy disks?</para></question>
    3017 <answer>
    3018 <para>A: Mount the CD-ROM, e.g. at /mnt/cdrom. Insert a blank
    3019 floppy. Type:</para>
    3020 <para></para>
    3021 <informaltable><tgroup cols="1"><tbody>
    3022 <row>
    3023 <entry>
    3024 
    3025         bash# cd /mnt/cdrom/images
    3026 </entry>
    3027 </row>
    3028 <row>
    3029 <entry>
    3030         bash# dd if=mindi-boot.1722.img of=/dev/fd0u1722
    3031 
    3032 </entry>
    3033 </row>
    3034 </tbody></tgroup></informaltable>
    3035 
    3036 <para>Insert another blank floppy and type:</para>
    3037 <para></para>
    3038 <informaltable><tgroup cols="1"><tbody>
    3039 <row>
    3040 <entry>
    3041 
    3042 bash# dd if=mindi-data-1.img of=/dev/fd0u1722
    3043 
    3044 </entry>
    3045 </row>
    3046 </tbody></tgroup></informaltable>
    3047 
    3048 <para>Do the above for each 'mindi-data' disk image.</para>
    3049 </answer>
    3050 </qandaentry>
    3051 <qandaentry>
    30522924<question><para>Q: Sometimes, my laptop won't mount
    30532925                Mondo CD properly, or something. Umm...</para></question>
     
    32133085<para>A: Yes. Just backup as usual but add '-d /mnt/nfs' or
    32143086wherever your partition is mounted; don't use '-Oc' or '-Ot' at
    3215 all; just '-Oi -d /root'. Then, after booting from the floppies
     3087all; just '-Oi -d /root'. Then, after booting from the media
    32163088which Mondo generates, you need to type 'ISO' at the
    32173089console.</para>
     
    33143186<qandaentry>
    33153187<question><para id="SEGF">Q: When I restore after
    3316 booting from the CD/floppies, I sometimes get errors like, "Running
     3188booting from the media, I sometimes get errors like, "Running
    33173189out of memory" or "Segmentation fault". What is going on?</para></question>
    33183190<answer><para>A: It sounds as if you are running out of disk
  • branches/2.2.5/mondo/distributions/conf/mondorescue.conf

    r1522 r1885  
    9292
    9393#
    94 # Write boot floppies (yes|no) ?
    95 #
    96 write_boot_floppy=no
    97 
    98 #
    9994# Write mindi CD (yes|no) ?
    10095#
  • branches/2.2.5/mondo/src/common/libmondo-archive-EXT.h

    r1647 r1885  
    2222extern int _move_files_to_stream(
    2323                                 char *files_to_add, ...);
    24 extern int offer_to_write_boot_floppies_to_physical_disks();
    2524extern void pause_and_ask_for_cdr(int, bool *);
    2625extern int slice_up_file_etc(
  • branches/2.2.5/mondo/src/common/libmondo-archive.c

    r1878 r1885  
    195195
    196196
    197 /** @def DEFAULT_1722MB_DISK The default 1.722M floppy disk to write images to. */
    198 /** @def BACKUP_1722MB_DISK  The 1.722M floppy disk to try if the default fails. */
    199 
    200 #ifdef __FreeBSD__
    201 #define DEFAULT_1722MB_DISK "/dev/fd0.1722"
    202 #define BACKUP_1722MB_DISK "/dev/fd0.1722"
    203 #else
    204 #define DEFAULT_1722MB_DISK "/dev/fd0u1722"
    205 #define BACKUP_1722MB_DISK "/dev/fd0H1722"
    206197#ifndef _SEMUN_H
    207198#define _SEMUN_H
     
    10321023        log_OS_error("Unable to make images directory");
    10331024    }
    1034     sprintf(command, "mkdir -p %s%s", bkpinfo->scratchdir, MNT_FLOPPY);
    1035     if (system(command)) {
    1036         res++;
    1037         log_OS_error("Unable to make mnt floppy directory");
    1038     }
    10391025    sprintf(tmp, "BTW, I'm telling Mindi your kernel is '%s'",
    10401026            bkpinfo->kernel_path);
     
    14561442}
    14571443
    1458 
    1459 /**
    1460  * Calls floppy-formatting @c cmd and tracks its progress if possible.
    1461  *
    1462  * @param cmd The command to run (e.g. @c fdformat @c /dev/fd0).
    1463  * @param title The human-friendly description of the floppy you are writing.
    1464  * This will be used as the title in the progress bar window. Example:
    1465  * "Formatting disk /dev/fd0".
    1466  * @see format_disk
    1467  * @return The exit code of fdformat/superformat.
    1468  */
    1469 int format_disk_SUB(char *cmd, char *title)
    1470 {
    1471 
    1472     /*@ int *************************************************************** */
    1473     int res = 0;
    1474     int percentage = 0;
    1475     int maxtracks = 0;
    1476     int trackno = 0;
    1477     int last_trkno = 0;
    1478 
    1479     /*@ buffers *********************************************************** */
    1480     char *command;
    1481     char *tempfile;
    1482 
    1483     /*@ pointers ********************************************************** */
    1484     FILE *pin;
    1485 
    1486     assert_string_is_neither_NULL_nor_zerolength(cmd);
    1487     assert_string_is_neither_NULL_nor_zerolength(title);
    1488 
    1489     malloc_string(command);
    1490     malloc_string(tempfile);
    1491 #ifdef __FreeBSD__
    1492 /* Ugh. FreeBSD fdformat prints out this pretty progress indicator that's
    1493    impossible to parse. It looks like
    1494    VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVF-------------------
    1495    where V means verified, E means error, F means formatted, and - means
    1496    not done yet.
    1497 */
    1498     return (run_program_and_log_to_screen(cmd, title));
    1499 #endif
    1500 
    1501 /* if Debian then do bog-standard superformat; don't be pretty */
    1502     if (strstr(cmd, "superformat")) {
    1503         return (run_program_and_log_to_screen(cmd, title));
    1504     }
    1505 /* if not Debian then go ahead & use fdformat */
    1506     sprintf(tempfile, "%s/mondo.floppy.log", bkpinfo->tmpdir);
    1507     sprintf(command, "%s >> %s 2>> %s; rm -f %s", cmd, tempfile, tempfile,
    1508             tempfile);
    1509     log_msg(3, command);
    1510     open_evalcall_form(title);
    1511     if (!(pin = popen(command, "r"))) {
    1512         log_OS_error("fmt err");
    1513         return (1);
    1514     }
    1515     if (strstr(command, "1722")) {
    1516         maxtracks = 82;
    1517     } else {
    1518         maxtracks = 80;
    1519     }
    1520     for (sleep(1); does_file_exist(tempfile); sleep(1)) {
    1521         trackno = get_trackno_from_logfile(tempfile);
    1522         if (trackno < 0 || trackno > 80) {
    1523             log_msg(1, "Weird track#");
    1524             continue;
    1525         }
    1526         percentage = trackno * 100 / maxtracks;
    1527         if (trackno <= 5 && last_trkno > 40) {
    1528             close_evalcall_form();
    1529             strcpy(title, "Verifying format");
    1530             open_evalcall_form(title);
    1531         }
    1532         last_trkno = trackno;
    1533         update_evalcall_form(percentage);
    1534     }
    1535     close_evalcall_form();
    1536     if (pclose(pin)) {
    1537         res++;
    1538         log_OS_error("Unable to pclose");
    1539     }
    1540     unlink(tempfile);
    1541     paranoid_free(command);
    1542     paranoid_free(tempfile);
    1543     return (res);
    1544 }
    1545 
    1546 /**
    1547  * Wrapper around @c format_disk_SUB().
    1548  * This function calls @c format_disk_SUB() with a @c device of its @c device
    1549  * parameter and a @c title of Formatting disk @c device. If the format
    1550  * fails, the user will be given the option of retrying.
    1551  *
    1552  * @param device The floppy drive to write to.
    1553  * @see format_disk_SUB
    1554  * @return The exit code of fdformat/superformat.
    1555  * @ingroup deviceGroup
    1556  */
    1557 int format_disk(char *device)
    1558 {
    1559 
    1560     /*@ int ************************************************************** */
    1561     int res = 0;
    1562 
    1563     /*@ buffer *********************************************************** */
    1564     char *command;
    1565     char *title;
    1566 
    1567 
    1568     assert_string_is_neither_NULL_nor_zerolength(device);
    1569     malloc_string(title);
    1570     command = malloc(1000);
    1571     if (!system("which superformat > /dev/null 2> /dev/null")) {
    1572         sprintf(command, "superformat %s", device);
    1573     } else {
    1574 #ifdef __FreeBSD__
    1575         sprintf(command, "fdformat -y %s", device);
    1576 #else
    1577         sprintf(command, "fdformat %s", device);
    1578 #endif
    1579     }
    1580     sprintf(title, "Formatting disk %s", device);
    1581     while ((res = format_disk_SUB(command, title))) {
    1582         if (!ask_me_yes_or_no("Failed to format disk. Retry?")) {
    1583             return (res);
    1584         }
    1585     }
    1586     paranoid_free(title);
    1587     paranoid_free(command);
    1588     return (res);
    1589 }
    15901444
    15911445/**
     
    28792733
    28802734
    2881 
    2882 
    2883 
    2884 
    2885 /**
    2886  * Offer to write boot and data disk images to 3.5" floppy disks.
    2887  * @param bkpinfo The backup information structure. Only the
    2888  * @c backup_media_type field is used in this function.
    2889  * @param imagesdir The directory containing the floppy images (usually
    2890  * /root/images/mindi).
    2891  *
    2892  * @return The number of errors encountered (0 for success)
    2893  * @see write_image_to_floppy
    2894  * @see format_disk
    2895  * @ingroup MLarchiveGroup
    2896  */
    2897 int offer_to_write_floppies(char *imagesdir)
    2898 {
    2899     /*@ buffer ************************************************************ */
    2900     char *tmp;
    2901     char *comment;
    2902     char *bootdisk_dev;
    2903     char *datadisk_dev;
    2904     char *bootdisk_file;
    2905     char *rootdisk_file;
    2906 
    2907     /*@ int *************************************************************** */
    2908     int i = 0;
    2909     int res = 0;
    2910 
    2911     /*@ bool ************************************************************** */
    2912     bool format_first;
    2913     bool root_disk_exists = FALSE;
    2914 
    2915     malloc_string(tmp);
    2916     malloc_string(comment);
    2917     malloc_string(bootdisk_dev);
    2918     malloc_string(datadisk_dev);
    2919     malloc_string(rootdisk_file);
    2920     malloc_string(bootdisk_file);
    2921     assert(bkpinfo != NULL);
    2922     assert_string_is_neither_NULL_nor_zerolength(imagesdir);
    2923 
    2924 
    2925     if (!ask_me_yes_or_no
    2926         ("Write boot and data disk images to 3.5\" floppy disks?")) {
    2927         return (0);
    2928     }
    2929     if (does_device_exist(DEFAULT_1722MB_DISK)) {
    2930 #ifdef __FreeBSD__
    2931         // tell the system that this is a 1.72m floppy
    2932         system("/usr/sbin/fdcontrol -F 1722 /dev/fd0.1722");
    2933 #endif
    2934         strcpy(bootdisk_dev, DEFAULT_1722MB_DISK);
    2935     } else if (does_device_exist(BACKUP_1722MB_DISK)) {
    2936         sprintf(bootdisk_dev, "/dev/fd0H1722");
    2937     } else {
    2938         log_msg(1, "Warning - can't find a 1.72MB floppy device *sigh*");
    2939         strcpy(bootdisk_dev, DEFAULT_1722MB_DISK);
    2940 //      return (1);
    2941     }
    2942     strcpy(datadisk_dev, "/dev/fd0");
    2943     if (!does_device_exist(datadisk_dev)) {
    2944         log_msg(1, "Warning - can't find a 1.44MB floppy device *sigh*");
    2945         strcpy(datadisk_dev, "/dev/fd0");
    2946 //      return (1);
    2947     }
    2948     format_first =
    2949         ask_me_yes_or_no
    2950         ("Do you want me to format the disks before I write to them?");
    2951 
    2952 /* boot disk */
    2953     if (ask_me_OK_or_cancel("About to write boot disk")) {
    2954         log_to_screen("Writing boot floppy");
    2955 #ifdef __FreeBSD__
    2956         sprintf(tmp, "%s/mindi-kern.1722.img", imagesdir);
    2957         if (format_first) {
    2958             format_disk(bootdisk_dev);
    2959         }
    2960         res += write_image_to_floppy(bootdisk_dev, tmp);
    2961         if (ask_me_OK_or_cancel("About to write 1.44MB mfsroot disk")) {
    2962             log_to_screen("Writing mfsroot floppy");
    2963             if (format_first) {
    2964                 format_disk(datadisk_dev);
    2965             }
    2966             sprintf(tmp, "%s/mindi-mfsroot.1440.img", imagesdir);
    2967             write_image_to_floppy(datadisk_dev, tmp);
    2968         }
    2969 #else
    2970         sprintf(bootdisk_file, "%s/mindi-bootroot.1722.img", imagesdir);
    2971         if (does_file_exist(bootdisk_file)) {
    2972             if (format_first) {
    2973                 format_disk(bootdisk_dev);
    2974             }
    2975             res += write_image_to_floppy(bootdisk_dev, bootdisk_file);
    2976         } else {
    2977             sprintf(bootdisk_file, "%s/mindi-boot.1440.img", imagesdir);
    2978             sprintf(rootdisk_file, "%s/mindi-root.1440.img", imagesdir);
    2979             root_disk_exists = TRUE;
    2980             if (!does_file_exist(rootdisk_file)
    2981                 || !does_file_exist(bootdisk_file)) {
    2982                 popup_and_OK
    2983                     ("Cannot write boot/root floppies. Files not found.");
    2984                 log_to_screen
    2985                     ("Failed to find boot/root floppy images. Oh dear.");
    2986                 return (1);
    2987             }
    2988             if (format_first) {
    2989                 format_disk(datadisk_dev);
    2990             }
    2991             /*
    2992                sprintf(tmp, "cat %s > %s", bootdisk_file, datadisk_dev);
    2993                res += run_external_binary_with_percentage_indicator_NEW("Writing boot floppy", tmp);
    2994              */
    2995             res += write_image_to_floppy(datadisk_dev, bootdisk_file);
    2996             if (ask_me_OK_or_cancel("About to write root disk")) {
    2997                 log_to_screen("Writing root floppy");
    2998                 if (format_first) {
    2999                     format_disk(datadisk_dev);
    3000                 }
    3001                 sprintf(tmp, "cat %s > %s", rootdisk_file, datadisk_dev);
    3002                 log_msg(1, "tmp = '%s'", tmp);
    3003                 res +=
    3004                     run_external_binary_with_percentage_indicator_NEW
    3005                     ("Writing root floppy", tmp);
    3006 //              res += write_image_to_floppy (datadisk_dev, rootdisk_file);
    3007             }
    3008         }
    3009 #endif
    3010     }
    3011     if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    3012         log_to_screen
    3013             ("FYI, the data disks are stored on tape/CD for your convenience.");
    3014         return (0);
    3015     }
    3016     for (i = 1; i < 99; i++) {
    3017         sprintf(tmp, "%s/mindi-data-%d.img", imagesdir, i);
    3018         log_msg(3, tmp);
    3019         if (!does_file_exist(tmp)) {
    3020             log_msg(3, "...not found");
    3021             break;
    3022         }
    3023         sprintf(comment, "About to write data disk #%d", i);
    3024         if (ask_me_OK_or_cancel(comment)) {
    3025             sprintf(comment, "Writing data disk #%3d", i);
    3026             log_to_screen(comment);
    3027             if (format_first) {
    3028                 res += format_disk(datadisk_dev);
    3029             }
    3030             res += write_image_to_floppy(datadisk_dev, tmp);
    3031         }
    3032     }
    3033     paranoid_free(tmp);
    3034     paranoid_free(comment);
    3035     paranoid_free(bootdisk_dev);
    3036     paranoid_free(datadisk_dev);
    3037     return (res);
    3038 }
    3039 
    3040 
    3041 
    3042 
    3043 
    3044 
    3045 
    3046 
    3047 /**
    3048  * Wrapper around @c offer_to_write_floppies().
    3049  * @param bkpinfo The backup information structure. Used only
    3050  * in the call to @c offer_to_write_floppies().
    3051  * @return 0 if the boot floppies were found (not necessarily written OK),
    3052  * 1 otherwise.
    3053  * @see offer_to_write_floppies
    3054  * @ingroup MLarchiveGroup
    3055  */
    3056 
    3057 int offer_to_write_boot_floppies_to_physical_disks()
    3058 {
    3059     int res = 0;
    3060 
    3061     assert(bkpinfo != NULL);
    3062 
    3063     mvaddstr_and_log_it(g_currentY, 0,
    3064                         "Writing boot+data floppy images to disk");
    3065 
    3066     if (!bkpinfo->nonbootable_backup) {
    3067 #ifdef __FreeBSD__
    3068         if (!does_file_exist(MINDI_CACHE"/mindi-kern.1722.img"))
    3069 #else
    3070         if (!does_file_exist(MINDI_CACHE"/mindi-bootroot.1722.img") && !does_file_exist(MINDI_CACHE"/mindi-boot.1440.img"))
    3071 #endif
    3072         {
    3073             mvaddstr_and_log_it(g_currentY++, 74, "No Imgs");
    3074             if (does_file_exist(MINDI_CACHE"/mondorescue.iso")) {
    3075                 popup_and_OK
    3076                     ("No regular Boot+data floppies were created due of space constraints. However, you can burn "MINDI_CACHE"/mondorescue.iso to a CD and boot from that.");
    3077                 res++;
    3078             }
    3079         } else {
    3080             offer_to_write_floppies(MINDI_CACHE);
    3081             mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    3082         }
    3083     } else {
    3084         popup_and_OK
    3085             ("Since you opted for a nonbootable backup, no boot floppies were created.");
    3086     }
    3087 
    3088     return (res);
    3089 }
    3090 
    3091 
    3092 
    3093 
    30942735/**
    30952736 * @addtogroup LLarchiveGroup
     
    41073748
    41083749
    4109 
    4110 
    4111 
    4112 /**
    4113  * @addtogroup utilityGroup
    4114  * @{
    4115  */
    4116 /**
    4117  * Write an image to a real 3.5" floppy disk.
    4118  * @param device The device to write to (e.g. @c /dev/fd0)
    4119  * @param datafile The image to write to @p device.
    4120  * @return The number of errors encountered (0 for success)
    4121  * @see write_image_to_floppy
    4122  */
    4123 int write_image_to_floppy_SUB(char *device, char *datafile)
    4124 {
    4125     /*@ int *************************************************************** */
    4126     int res = 0;
    4127     int percentage = 0;
    4128     int blockno = 0;
    4129     int maxblocks = 0;
    4130 
    4131     /*@ buffers************************************************************ */
    4132     char *tmp;
    4133     char blk[1024];
    4134     char *title;
    4135 
    4136     /*@ pointers ********************************************************** */
    4137     char *p;
    4138     FILE *fout, *fin;
    4139 
    4140 
    4141     malloc_string(tmp);
    4142     malloc_string(title);
    4143     /* pretty stuff */
    4144     if (!(p = strrchr(datafile, '/'))) {
    4145         p = datafile;
    4146     } else {
    4147         p++;
    4148     }
    4149     sprintf(title, "Writing %s to floppy", p);
    4150     open_evalcall_form(title);
    4151     /* functional stuff */
    4152     for (p = device + strlen(device); p != device && isdigit(*(p - 1));
    4153          p--);
    4154     maxblocks = atoi(p);
    4155     if (!maxblocks) {
    4156         maxblocks = 1440;
    4157     }
    4158     sprintf(tmp, "maxblocks = %d; p=%s", maxblocks, p);
    4159     log_msg(2, tmp);
    4160     /* copy data from image to floppy */
    4161     if (!(fin = fopen(datafile, "r"))) {
    4162         log_OS_error("Cannot open img");
    4163         return (1);
    4164     }
    4165     if (!(fout = fopen(device, "w"))) {
    4166         log_OS_error("Cannot open fdd");
    4167         return (1);
    4168     }
    4169     for (blockno = 0; blockno < maxblocks; blockno++) {
    4170         percentage = blockno * 100 / maxblocks;
    4171         if (fread(blk, 1, 1024, fin) != 1024) {
    4172             if (feof(fin)) {
    4173                 log_msg(1,
    4174                         "img read err - img ended prematurely - non-fatal error");
    4175                 sleep(3);
    4176                 return (res);
    4177             }
    4178             res++;
    4179             log_to_screen("img read err");
    4180         }
    4181         if (fwrite(blk, 1, 1024, fout) != 1024) {
    4182             res++;
    4183             log_to_screen("fdd write err");
    4184         }
    4185         if (((blockno + 1) % 128) == 0) {
    4186             paranoid_system("sync");    /* fflush doesn't work; dunno why */
    4187             update_evalcall_form(percentage);
    4188         }
    4189     }
    4190     paranoid_fclose(fin);
    4191     paranoid_fclose(fout);
    4192     paranoid_free(tmp);
    4193     paranoid_free(title);
    4194     close_evalcall_form();
    4195     return (res);
    4196 }
    4197 
    4198 
    4199 
    4200 
    4201 
    4202 
    4203 
    4204 
    4205 
    4206 /**
    4207  * Wrapper around @c write_image_to_floppy_SUB().
    4208  * This function, unlike @c write_image_to_floppy_SUB(),
    4209  * gives the user the opportunity to retry if the write fails.
    4210  * @see write_image_to_floppy_SUB
    4211  */
    4212 int write_image_to_floppy(char *device, char *datafile)
    4213 {
    4214     /*@ int ************************************************************** */
    4215     int res = 0;
    4216 
    4217     assert_string_is_neither_NULL_nor_zerolength(device);
    4218     assert_string_is_neither_NULL_nor_zerolength(datafile);
    4219 
    4220     while ((res = write_image_to_floppy_SUB(device, datafile))) {
    4221         if (!ask_me_yes_or_no("Failed to write image to floppy. Retry?")) {
    4222             return (res);
    4223         }
    4224     }
    4225     return (res);
    4226 }
    4227 
    4228 /* @} - end of utilityGroup */
    4229 
    42303750void setenv_mondo_share(void) {
    42313751
  • branches/2.2.5/mondo/src/common/libmondo-archive.h

    r1647 r1885  
    2424int _move_files_to_stream(char *files_to_add,
    2525                          ...);
    26 int offer_to_write_boot_floppies_to_physical_disks();
    2726void pause_and_ask_for_cdr(int, bool *);
    2827void set_bit_N_of_array(char *array, int N, bool true_or_false);
     
    3332int verify_data();
    3433void wipe_archives(char *d);
    35 int write_image_to_floppy(char *device, char *datafile);
    36 int write_image_to_floppy_SUB(char *device, char *datafile);
    3734int write_iso_and_go_on(bool last_cd);
    3835int write_final_iso_if_necessary();
  • branches/2.2.5/mondo/src/common/libmondo-devices.c

    r1858 r1885  
    18901890    }
    18911891    if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) {
    1892         popup_and_OK("Please remove CD/floppy from drive(s)");
     1892        popup_and_OK("Please remove media from drive(s)");
    18931893    }
    18941894    log_msg(3, "media type = %s",
  • branches/2.2.5/mondo/src/common/my-stuff.h

    r1821 r1885  
    232232#define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg"
    233233/**
    234  * The location where mindi CD and floppy images are stored.
     234 * The location where mindi media images are stored.
    235235 */
    236236#define MINDI_CACHE "/var/cache/mindi"
  • branches/2.2.5/mondo/src/mondoarchive/main.c

    r1784 r1885  
    484484    }
    485485
    486 /* Offer to write floppy disk images to physical disks */
    487     if (bkpinfo->backup_data && !g_skip_floppies) {
    488         res = offer_to_write_boot_floppies_to_physical_disks();
    489         retval += res;
    490 //      res = offer_to_write_boot_ISO_to_physical_CD();
    491 //      retval += res;
    492     }
    493 
    494486/* Report result of entire operation (success? errors?) */
    495487    if (!retval) {
  • branches/2.2.5/mondo/src/mondoarchive/mondo-cli.c

    r1848 r1885  
    969969                ("Your kernel appears not to support vfat filesystems. I am therefore");
    970970            log_to_screen
    971                 ("using LILO instead of SYSLINUX as the CD/floppy's boot loader.");
     971                ("using LILO instead of SYSLINUX as the media boot loader.");
    972972        }
    973973        if (run_program_and_log_output("which mkfs.vfat", 2)) {
  • branches/2.2.5/mondo/src/mondorestore/mondo-restore.c

    r1881 r1885  
    141141 * The message to display if we detect that the user is using a Compaq Proliant.
    142142 */
    143 #define COMPAQ_PROLIANTS_SUCK "Partition and format your disk using Compaq's disaster recovery CD. After you've done that, please reboot with your Mondo CD/floppy in Interactive Mode."
     143#define COMPAQ_PROLIANTS_SUCK "Partition and format your disk using Compaq's disaster recovery CD. After you've done that, please reboot with your Mondo media in Interactive Mode."
    144144
    145145
     
    928928    if (!g_restoring_live_from_cd) {
    929929        popup_and_OK
    930             ("Please insert tape/CD/USB Key/boot floppy, then hit 'OK' to continue.");
     930            ("Please insert tape/CD/USB Key, then hit 'OK' to continue.");
    931931        sleep(1);
    932932    }
     
    29372937
    29382938    run_program_and_log_output("mkdir -p " MNT_CDROM, FALSE);
    2939     run_program_and_log_output("mkdir -p /mnt/floppy", FALSE);
    29402939
    29412940    malloc_string(tmp);
     
    32743273            mvaddstr_and_log_it(g_currentY++,
    32753274                                0,
    3276                                 "Run complete. Please remove floppy/CD/media and reboot.");
     3275                                "Run complete. Please remove media and reboot.");
    32773276        } else {
    32783277            run_program_and_log_output("sync", FALSE);
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c

    r1873 r1885  
    23132313    int res = 0;
    23142314    int fd = 0;
    2315     struct floppy_struct fdprms;
    23162315
    23172316    bool try_plan_B;
     
    23482347    log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file);
    23492348
    2350     /* Floppy? */
    2351     sprintf(tmp, "mkdir -p %s", mountpt);
    2352     run_program_and_log_output(tmp, FALSE);
    2353     sprintf(tmp, "mkdir -p %s/tmp", bkpinfo->tmpdir);
    2354     run_program_and_log_output(tmp, FALSE);
    2355 
    2356     /* Is there a floppy drive detected */
    2357     fd = open("/dev/fd0u1722", O_RDONLY);
    2358     if (fd > 0) {
    2359         // open OK
    2360         res = ioctl(fd, FDGETPRM, &fdprms);
    2361         if (res >= 0) {
    2362             // media OK to mount
    2363             sprintf(command, "mount /dev/fd0u1722 %s", mountpt);
    2364             res = run_program_and_log_output(command, FALSE);
    2365         } else {
    2366             //skip mount
    2367             res = 1;
    2368         }
    2369     } else {
    2370         fd = open("/dev/fd0H1440", O_RDONLY);
    2371         if (fd > 0) {
    2372             // open OK
    2373             res = ioctl(fd, FDGETPRM, &fdprms);
    2374             if (res >= 0) {
    2375                 // media OK to mount
    2376                 sprintf(command, "mount /dev/fd0H1440 %s", mountpt);
    2377                 res = run_program_and_log_output(command, FALSE);
    2378             } else {
    2379                 //skip mount
    2380                 res = 1;
    2381             }
    2382         }
    2383     }
    2384     if (res) {
    2385         try_plan_B = TRUE;
    2386     } else {
    2387         try_plan_B = TRUE;
    2388         log_msg(2,
    2389                 "Mounted floppy OK but I don't trust it because the archives might contain more up-to-date config file than the floppy does.");
    2390         // NB: If busybox does not support 'mount -o loop' then Plan A WILL NOT WORK.
    2391         log_msg(2, "Processing floppy (plan A?)");
    2392         sprintf(ramdisk_fname, "%s/mindi.rdz", mountpt);
    2393         if (!does_file_exist(ramdisk_fname)) {
    2394             sprintf(ramdisk_fname, "%s/initrd.img", mountpt);
    2395         }
    2396         if (!does_file_exist(ramdisk_fname)) {
    2397             log_msg(2,
    2398                     "Cannot find ramdisk file on mountpoint. Are you sure that's a boot disk in the drive?");
    2399         }
    2400         if (extract_config_file_from_ramdisk(ramdisk_fname, cfg_file, mountlist_file)) {
    2401             log_msg(2,
    2402                     "Warning - failed to extract config file from ramdisk. I think this boot disk is mangled.");
    2403         }
    2404         sprintf(command, "umount %s", mountpt);
    2405         run_program_and_log_output(command, 5);
    2406         unlink(ramdisk_fname);
    2407     }
    24082349    if (!does_file_exist(cfg_file)) {
    24092350        log_msg(2, "gcffa --- we don't have cfg file yet.");
     
    24532394
    24542395            if (!does_file_exist("tmp/mondo-restore.cfg")) {
    2455                 log_to_screen("Cannot find config info on tape/CD/floppy");
     2396                log_to_screen("Cannot find config info on media");
    24562397                return (1);
    24572398            }
  • branches/2.2.5/pbconf/mondo-doc/du/mondo-doc.doc-base

    r1674 r1885  
    66 effortlessly backup and interactively restore Linux, Windows and other
    77 supported filesystem partitions to/from CD-R/RW media, tape, NFS, ... and
    8  Mindi Linux provides the bootable emergency restore CD/floppy set which Mondo
     8 Mindi Linux provides the bootable emergency restore media set which Mondo
    99 uses at boot-time.
    1010Section: PBGRP
Note: See TracChangeset for help on using the changeset viewer.