Changeset 1885 in MondoRescue
- Timestamp:
- Mar 2, 2008, 12:38:35 AM (17 years ago)
- Location:
- branches/2.2.5
- Files:
-
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mindi/mindi
r1883 r1885 43 43 BOOT_SIZE=16384 # size of the boot disk 44 44 MAX_DISKS=99 45 WRITE_BOOT_FLOPPIES="yes" # do you want to be propted to write floppy images46 PROMPT_WRITE_BOOT_FLOPPIES="yes"47 # do you want to be prompted to write48 # floppy images out to floppy disks?49 # if 'no', images will not be written to floppies50 45 51 46 PROMPT_MAKE_CD_IMAGE="yes" … … 63 58 64 59 MY_FSTAB=/etc/fstab 65 FLOPPY_MODS="ide-floppy floppy"66 60 TAPE_MODS="ht st osst ide-tape ide_tape" 67 61 SCSI_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" 68 62 69 63 # 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"64 IDE_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" 71 65 PCMCIA_MODS="pcmcia_core ds yenta_socket" 72 66 USB_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"67 CDROM_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" 74 68 NET_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" 75 69 EXTRA_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" … … 81 75 82 76 LOGFILE=/var/log/mindi.log 83 FDDEVICE=/dev/fd0 ; # 1.44MB floppy #084 77 MINDI_CACHE=/var/cache/mindi 85 FORCE_DUAL_FLOPPIES=no86 78 BOOT_MEDIA_MESSAGE="\ 87 79 To format and restore all files automatically, type 'nuke' <enter>.\n\ … … 106 98 . $MINDI_CONFIG 107 99 fi 100 DEPLIST_FILE="$MINDI_CONF/deplist.txt" 101 ISO_CMD="/usr/bin/mkisofs" 102 ISO_OPT="-J -r -v -p Mindi -publisher http://www.mondorescue.org -A Mindi" 108 103 109 104 # Now we can create what we need 110 105 export 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 116 107 # ---------------------------------------------------------------------------- 117 108 … … 249 240 biggienumber=$4 250 241 251 [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend deplist.txtaccordingly."242 [ -d "$filename" ] && Die "Cannot chop up $filename: it's a directory. Please amend $DEPLIST_FILE accordingly." 252 243 mkdir -p $outdir 253 244 … … 361 352 Die "Please install either fdformat or superformat." 362 353 fi 363 echo -en "\ rWriting $comment"354 echo -en "\nWriting $comment" 364 355 if echo $image | grep "mindi-[r|b]oot\.1440" &> /dev/null ; then 365 356 cat $image > $dev & … … 1039 1030 if echo "$MODULES" | grep lvm &> /dev/null ; then 1040 1031 echo "I think you are, so please take heed!" >> $LOGFILE 1041 # LogIt "Where is liblvm? You need it."1042 1032 else 1043 1033 echo "I don't think you are, so don't worry about it." >> $LOGFILE … … 1257 1247 [ "$mountlist" != "" ] && rm -Rf $mountlist 1258 1248 > $mountlist 1259 echo -en "\rHang on...\r"1260 1249 all_partitions="" 1261 1250 1262 1251 if [ $LVM != "false" ]; then 1263 echo -en " \rAnalyzing LVM...\r"1252 echo -en "Analyzing LVM...\n" 1264 1253 $MINDI_LIB/analyze-my-lvm > $MINDI_TMP/lvm.res 1265 1254 if [ $? -ne 0 ]; then … … 1367 1356 current_partition=$actual_dev 1368 1357 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/fstabor 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" 1370 1359 fi 1371 1360 # This part tries to retrieve the correct device from a UUID line in /etc/fstab … … 1643 1632 1644 1633 1645 1646 OfferToCopyImagesToDisks() {1647 local imagesdir i imagename dev count boot_dev data_dev1648 imagesdir=$11649 boot_dev=$21650 data_dev=$31651 1652 echo -en "Would you like to create boot+data floppy disks now (y/[n]) ?"1653 read i1654 [ "$i" != "y" ] && [ "$i" != "Y" ] && return1655 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" ] ; then1662 CopyImageToDisk $j $data_dev "boot disk"1663 CopyImageToDisk $i $data_dev "root disk"1664 else1665 CopyImageToDisk $j $boot_dev "boot/root disk"1666 fi1667 count=11668 for i in `find $imagesdir | grep -F mindi-data` ; do1669 CopyImageToDisk $i $data_dev "data disk #$count"1670 count=$(($count+1))1671 done1672 }1673 1674 1675 1634 OfferToMakeBootableISO() { 1676 1635 local i old_pwd … … 1680 1639 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0 1681 1640 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" 1685 1643 fi 1686 1644 rm -Rf $MINDI_TMP/iso … … 1697 1655 cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k" 1698 1656 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 1700 1660 fi 1701 1661 done 1702 1662 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?" 1705 1664 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 1707 1670 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1708 1671 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?" 1710 1673 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 1713 1675 fi 1714 1676 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?" 1716 1678 cp $ISOLINUX ../ 2>> $LOGFILE 1717 1679 fi 1718 1680 cd $MINDI_TMP/iso 1719 1681 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 fi1722 [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun .2>> $LOGFILE1723 if [ "$ARCH" != "ia64" ] ; then1724 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.log1725 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.log1682 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 1727 1689 fi 1728 1690 if [ "$?" -ne "0" ] ; then 1729 echo "----------- mkisofs's errors --------------" >> $LOGFILE1691 echo "----------- $ISO_CMD's errors --------------" >> $LOGFILE 1730 1692 cat $MINDI_TMP/mkisofs.log >> $LOGFILE 1731 echo " mkisofsreturned the following errors:-"1693 echo "$ISO_CMD returned the following errors:-" 1732 1694 cat $MINDI_TMP/mkisofs.log 1733 1695 LogIt "Failed to create ISO image." … … 1872 1834 1873 1835 MakeMessageFile() { 1874 local disksize1875 disksize=$11876 1836 if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then 1877 1837 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`"/ … … 1879 1839 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`/ 1880 1840 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" 1891 1849 fi 1892 1850 fi … … 1901 1859 1902 1860 1903 write_full_floppy_of_kernel() {1904 local mtpt image old_pwd res disksize1905 1906 res=01907 old_pwd=`pwd`1908 KERN_DISK_MADE=11909 disksize=$31910 rand1=$RANDOM1911 rand2=$RANDOM1912 image=$MINDI_TMP/$rand1.$rand2.img1913 mtpt=$MINDI_TMP/$rand1.$rand2.mtpt1914 dd if=/dev/zero of=$image bs=1k count=$disksize &> /dev/null1915 mke2fs -N 26 -F $image &> /dev/null1916 mkdir -p $mtpt1917 mount -o loop $image $mtpt1918 cd $mtpt1919 mkdir -p {dev,tmp,boot}1920 cp -f $1 vmlinuz 2>> $LOGFILE1921 if [ "$?" -ne "0" ] ; then1922 LogIt "Failed to copy $1 to ramdisk"1923 cd $old_pwd1924 umount $mtpt1925 rmdir $mtpt1926 rm $image1927 return 11928 fi1929 1930 rdev vmlinuz 2,01931 rdev -R vmlinuz 01932 rdev -r vmlinuz 491521933 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/null1937 #[ "$?" -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.b1939 1940 MakeLiloConfFile $disksize >> bdlilo.conf1941 1942 chmod 644 bdlilo.conf1943 MakeMessageFile $disksize > message1944 lilo -v -C bdlilo.conf -r $mtpt1945 res=$?1946 1947 cd $old_pwd1948 umount $mtpt1949 mv -f $image $21950 rmdir $mtpt1951 1952 return $res1953 }1954 1955 1956 1861 MakeLiloConfFile() { 1957 local disksize options i ooo 1958 disksize=$1 1862 local options i ooo 1959 1863 options="" 1960 1864 1961 1865 if [ "$ARCH" != "ia64" ] ; then 1962 1866 echo -en "boot=/dev/loop0\ndisk=/dev/loop0\n" 1963 fi1964 if [ "$disksize" -eq "2880" ] ; then1965 echo -en "bios=0x00\nsectors=36\nheads=2\ncylinders=80\n"1966 elif [ "$disksize" -eq "1722" ] ; then1967 echo -en "bios=0x00\nsectors=21\nheads=2\ncylinders=82\n"1968 elif [ "$disksize" -gt "2880" ] ; then1969 /bin/true1970 else1971 echo -en "bios=0x00\nsectors=18\nheads=2\ncylinders=80\n"1972 fi1973 if [ "$ARCH" != "ia64" ] ; then1974 1867 echo -en "install=/boot.b\nmap=/boot.map\n" 1975 1868 fi 1976 1869 if [ "$CDRECOVERY" = "yes" ] ; then 1977 1870 echo -en "default=RESTORE\n" 1978 elif [ "$disksize" -gt "2880" ] && [ _"$MONDO_SHARE" != _"" ]; then1871 elif [ _"$MONDO_SHARE" != _"" ]; then 1979 1872 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1980 1873 echo -en "default=iso\n" … … 1996 1889 if [ "$CDRECOVERY" = "yes" ] ; then 1997 1890 options="RESTORE expert" 1998 el if [ "$disksize" -gt "2880" ] ; then1999 if [ _"$MONDO_SHARE" != _"" ] 1891 else 1892 if [ _"$MONDO_SHARE" != _"" ]; then 2000 1893 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 2001 1894 options="iso" … … 2007 1900 options="expert" 2008 1901 fi 2009 else2010 options="expert"2011 1902 fi 2012 1903 for i in $options ; do … … 2022 1913 outstr=$outstr" $ooo_mode" 2023 1914 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" 2029 1916 done 2030 1917 } … … 2032 1919 2033 1920 PrepareBootDiskImage_LILO() { 2034 local disksizeimagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf1921 local imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf 2035 1922 imagesdir=$1 2036 disksize=$2 2037 kernelpath=$3 2038 ramdisksize=$4 1923 kernelpath=$2 1924 ramdisksize=$3 2039 1925 2040 1926 retval=0 2041 1927 [ ! -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?" 2047 1930 echo -en "..." 2048 imagefile=$imagesdir/mindi-bootroot.$ disksize.img1931 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img 2049 1932 mountpoint=$MINDI_TMP/mountpoint.$$ 2050 1933 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" 2052 1935 if [ "$ARCH" = "ia64" ] ; then 2053 1936 mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE … … 2077 1960 CopyBootBFile $mountpoint/boot.b 2078 1961 2079 MakeLiloConfFile $disksize> $liloconf1962 MakeLiloConfFile > $liloconf 2080 1963 2081 1964 # Copy it so that CD-ROM menu entry is satisfied … … 2109 1992 retval=$(($retval+1)) 2110 1993 fi 2111 MakeMessageFile $disksize> $mountpoint/message1994 MakeMessageFile > $mountpoint/message 2112 1995 2113 1996 mkdir -p $mountpoint/tmp … … 2124 2007 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` 2125 2008 cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2> /dev/null 2126 if [ "$?" -ne "0" ] || [ "$FORCE_DUAL_FLOPPIES" = "yes" ]; then2009 if [ "$?" -ne "0" ] ; then 2127 2010 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE 2128 2011 du -sk $mountpoint/* >> $LOGFILE 2129 2012 echo "--- end of list of files ---" >> $LOGFILE 2130 2013 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" >> $LOGFILE2014 Sorry, your kernel is too big for your image.\n" >> $LOGFILE 2132 2015 rm -f $mountpoint/vmlinuz 2133 2016 cd $old_pwd … … 2135 2018 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" 2136 2019 # losetup /dev/loop0 -d 2137 res=02138 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 14402139 res=$(($res+$?))2140 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 2>> $LOGFILE2141 res=$(($res+$?))2142 2020 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 2148 2022 fi 2149 2023 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` 2150 2024 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 2151 echo "Free space left on floppy= $free_space KB" >> $LOGFILE2152 echo "Max kernel size on $ disksize KB floppy(est'd) = $max_kernel_size K" >> $LOGFILE2025 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 2153 2027 # make it bootable 2154 2028 rm -f $mountpoint/zero 2155 2029 [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE 2156 if [ "$disksize" -gt "2880" ] && [! "$KERN_DISK_MADE" ] ; then2030 if [ ! "$KERN_DISK_MADE" ] ; then 2157 2031 if [ "$ARCH" != "ia64" ] ; then 2158 2032 $LILO_EXE $LILO_OPTIONS -r $mountpoint >> $LOGFILE 2>> $LOGFILE … … 2160 2034 /bin/true 2161 2035 fi 2162 elif [ ! "$KERN_DISK_MADE" ] ; then2163 # 12/28/2001 - if 1.72MB floppy then don't use LILO's optimizations at all2164 $LILO_EXE -r $mountpoint >> $LOGFILE 2>> $LOGFILE2165 2036 else 2166 2037 echo "Not running LILO. It's not that kind of disk." >> $LOGFILE … … 2187 2058 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" 2188 2059 if [ "$retval" -eq "0" ] ; then 2189 echo -en "...$DONE\ r"2060 echo -en "...$DONE\n" 2190 2061 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" 2196 2067 rm -f $imagefile 2197 2068 fi … … 2202 2073 2203 2074 PrepareBootDiskImage_SYSLINUX() { 2204 local disksizeimagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage2075 local imagesdir dev imagefile mountpoint fname i kernelpath ramdisksize cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootimage 2205 2076 imagesdir=$1 2206 disksize=$2 2207 kernelpath=$3 2208 ramdisksize=$4 2077 kernelpath=$2 2078 ramdisksize=$3 2209 2079 do_boot_root_thingy="" 2210 2080 local retval old_pwd … … 2212 2082 2213 2083 [ ! -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?" 2217 2086 echo -en "..." 2218 imagefile=$imagesdir/mindi-bootroot.$ disksize.img2087 imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img 2219 2088 mountpoint=$MINDI_TMP/mountpoint.$$ 2220 2089 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 2234 2095 mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)" 2235 2096 … … 2241 2102 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root" 2242 2103 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 2245 2105 fi 2246 2106 cd $old_pwd … … 2264 2124 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` 2265 2125 cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null 2266 if [ "$?" -ne "0" ] || [ "$FORCE_DUAL_FLOPPIES" = "yes" ]; then2126 if [ "$?" -ne "0" ] ; then 2267 2127 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE 2268 2128 du -sk $mountpoint/* >> $LOGFILE 2269 2129 echo "--- end of list of files ---" >> $LOGFILE 2270 2130 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" >> $LOGFILE2131 Sorry, your kernel is too big for your image.\n" >> $LOGFILE 2272 2132 rm -f $mountpoint/vmlinuz 2273 2133 cd $old_pwd … … 2275 2135 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" 2276 2136 2277 res=02278 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 14402279 res=$(($res+$?))2280 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 2>> $LOGFILE2281 res=$(($res+$?))2282 2137 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 2288 2139 fi 2289 2140 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` 2290 2141 max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`)) 2291 echo "Free space left on floppy= $free_space KB" >> $LOGFILE2292 echo "Max kernel size on $ disksize KB floppy(est'd) = $max_kernel_size K" >> $LOGFILE2142 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 2293 2144 2294 2145 # make it bootable … … 2301 2152 2302 2153 if [ "$retval" -eq "0" ] ; then 2303 echo -en "...$DONE\ r"2154 echo -en "...$DONE\n" 2304 2155 if [ "$KERN_DISK_MADE" ] ; then 2305 2156 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" 2311 2162 rm -f $imagefile 2312 2163 fi … … 2317 2168 2318 2169 PrepareDataDiskImages() { 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 2320 2171 2321 2172 imagesdir=$1 … … 2328 2179 tardir=$MINDI_TMP/tardir 2329 2180 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 2332 2184 res=$? 2333 2185 if [ "$YOUR_KERNEL_SUCKS" ]; then … … 2365 2217 FindAndAddUserKeyboardMappingFile 2366 2218 mkdir -p $bigdir/tmp 2367 if [ _"$MONDO_SHARE" != _"" ] 2219 if [ _"$MONDO_SHARE" != _"" ]; then 2368 2220 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 2369 2221 cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null … … 2414 2266 noof_disks=$? 2415 2267 [ "$noof_disks" -eq "0" ] && Die "Too much stuff!" 2416 # if [ "$noof_disks" -ge "8" ] ; then2417 # 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 # fi2421 2268 MakeMountlist $MINDI_TMP/mountlist.txt 2422 2269 mkdir -p $minidir_root/$noof_disks/tmp 2423 2270 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 2425 2274 [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm || LVM="false" 2426 2275 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE … … 2792 2641 2793 2642 TurnTgzIntoRdz() { 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 w2643 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 2795 2644 2796 2645 tgz_dir_fname=$1 2797 2646 rdz_fname=$2 2798 2647 ramdisksize=$3 2799 disksize=$4 2800 kernelsize=$5 2801 maxsize=$(($disksize-$kernelsize)) 2648 kernelsize=$4 2649 maxsize=$(($BOOT_SIZE-$kernelsize)) 2802 2650 maxsize=$(($maxsize*2)); # to allow for compression of 50% 2803 2651 tempfile=$MINDI_TMP/temp.rd … … 2903 2751 fi 2904 2752 2905 for w in cdrom floppygroovy-stuff ; do2753 for w in cdrom groovy-stuff ; do 2906 2754 mkdir -p mnt/$w 2907 2755 done … … 2922 2770 if [ "$YOUR_KERNEL_SUCKS" ] ; then 2923 2771 cd $MINDI_TMP 2924 floppy_modules_path=lib/modules/$FAILSAFE_KVER2772 needed_modules_path=lib/modules/$FAILSAFE_KVER 2925 2773 else 2926 2774 cd / 2927 ###2928 ### Sq-Modification... Use kernel name in module path if specified.2929 ###2930 #floppy_modules_path=lib/modules/`uname -r`2931 2775 if [ "${kernelname}" != "" ] 2932 2776 then 2933 floppy_modules_path=lib/modules/${kernelname}2777 needed_modules_path=lib/modules/${kernelname} 2934 2778 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 2947 2786 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 2948 2787 # For PXE boot … … 2957 2796 done 2958 2797 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." 2960 2799 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 ; do2800 needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`" 2801 done 2802 for i in $needed_modules ; do 2964 2803 [ -e "$i" ] && s=`du -sk $i | cut -f1` || s="" 2965 2804 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i … … 2976 2815 2977 2816 # 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" 2979 2818 2980 2819 # For all modules supported, create symlinks under the mountpoint … … 2985 2824 (cd $mountpoint ; ln -s $i . 2>/dev/null) 2986 2825 done 2987 if [ ! -e "/sbin/devfsd" ] || [ "$ disksize" -lt "2880" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then2826 if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then 2988 2827 echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE 2989 2828 [ ! -e "/sbin/devfsd" ] && echo "...because /sbin/devfsd not found" >> $LOGFILE 2990 [ "$disksize" -lt "2880" ] && echo "...because disksize = $disksize" >> $LOGFILE2991 2829 [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE 2992 2830 rm -f $mountpoint/sbin/devfsd … … 2996 2834 dd if=/dev/zero of=$mountpoint/zero &> /dev/null 2997 2835 rm -f $mountpoint/zero 2998 if [ _"$MONDO_SHARE" != _"" ] ; then 2836 mkdir -p $mountpoint/tmp 2837 if [ _"$MONDO_SHARE" != _"" ]; then 2999 2838 MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg 3000 2839 cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null … … 3007 2846 [ "$USE_STAR" = "yes" ] && echo -en "Using star. Hooray." >> $mountpoint/tmp/USING-STAR 3008 2847 fi 3009 mkdir -p $mountpoint/tmp3010 2848 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 3013 2850 # Determine what filesystem to use for initrd image 3014 2851 echo "Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." >> $LOGFILE … … 3112 2949 ############################################################################## 3113 2950 2951 # Now we can create what we need 2952 mkdir -p $MINDI_TMP 2953 2954 # Purge from potential old run 2955 if [ _"$MINDI_CACHE" = _"" ]; then 2956 Die "MINDI_CACHE undefined" 2957 fi 2958 rm -rf $MINDI_CACHE/* 2> /dev/null 2959 mkdir -p $MINDI_CACHE 2960 2961 if [ "$1" = "--printvar" ] ; then 2962 shift 2963 if [ _"$1" != _"" ] ; then 2964 set | grep -Ew "^$1" | cut -d= -f2 2965 fi 2966 MindiExit 0 2967 fi 3114 2968 3115 2969 > $LOGFILE … … 3129 2983 # Log some capital variables 3130 2984 [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly." 2985 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 3131 2986 echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE 3132 2987 echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE 3133 2988 [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly." 3134 2989 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE 3135 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 2990 if [ -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 2996 fi 2997 3136 2998 3137 2999 trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT … … 3175 3037 fi 3176 3038 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. 3040 if [ -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)" 3044 else 3045 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1` 3046 fi 3178 3047 3179 3048 if ! which mkfs.vfat 1> /dev/null 2> /dev/null ; then … … 3193 3062 FindLiloBinary 3194 3063 fi 3195 # BERLIOS: Remove as too dangerous and now useless3196 #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 reason3197 3064 trap "Aborted" SIGTERM 3198 3065 DONE="\r\t\t\t\t\t\t\t\tDone. " … … 3495 3362 fi 3496 3363 if [ _"$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]) ?" 3498 3365 read ch 3499 3366 if [ "$ch" != "y" ] && [ "$ch" != "Y" ] ; then … … 3504 3371 fi 3505 3372 if [ "$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 3514 3398 YOUR_KERNEL_SUCKS="Your kernel sucks" 3515 3399 fi … … 3527 3411 echo "Ramdisk will be $ramdisk_size KB" >> $LOGFILE 3528 3412 if [ "$ARCH" = "ia64" ] ; then 3529 PrepareBootDiskImage_LILO $MINDI_CACHE $ BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppydisk image."3413 PrepareBootDiskImage_LILO $MINDI_CACHE $kernelpath $ramdisk_size || Die "Failed to create ia64 image disk image." 3530 3414 else 3531 3415 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." 3551 3419 fi 3552 3420 fi … … 3557 3425 if [ _"$MONDO_SHARE" = _"" ]; then 3558 3426 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 3566 3428 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ]; then 3567 3429 OfferToMakeBootableUSB $MINDI_CACHE 3568 3430 fi 3569 OfferToMakeBootableISO $MINDI_CACHE3570 3431 LogIt "Finished." 3571 3432 elif [ "$TAPEDEV" ] ; then 3433 rm -f $MINDI_CACHE/{*img,*gz,*iso} 3572 3434 OfferToMakeBootableISO $MINDI_CACHE 3573 3435 if [ -e "$MINDI_CACHE/all.tar.gz" ] ; then -
branches/2.2.5/mindi/rootfs/README
r1611 r1885 6 6 which may be found at <http://www.mondorescue.org>. 7 7 8 This CD (or, this set of floppy disks)contains the tools required to do8 This media image contains the tools required to do 9 9 basic system maintenance, e.g. formatting, moving files, mounting partitions. 10 10 -
branches/2.2.5/mindi/rootfs/sbin/find-and-mount-cdrom
r1826 r1885 75 75 exit 0 76 76 fi 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; 79 78 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ] ; then 80 79 LogIt "Because you are using cdstream, I won't try to mount CD." 81 80 exit 0 82 81 fi 83 mount /dev/fd0 -t ext2 -o ro /mnt/floppy 2> /dev/null84 if [ "$?" -eq "0" ] ; then85 umount /mnt/floppy 2> /dev/null86 exit 187 else88 LogIt "Please go to another PC, mount this CD and copy the data disk images" 189 LogIt "from the CD's /images directory to blank 1.44MB floppy disks. You should" 190 LogIt "use something like 'dd if=/mnt/cdrom/images/mindi-data-1.img of=/dev/fd0'" 191 LogIt "for the first data disk, mindi-data-2.img for the second, and so on." 192 LogIt "(If you are already booting from a floppy, please ignore this message.)" 193 exit 294 fi95 82 96 97 98 83 LogIt "Unable to find and mount your CD-ROM" 1 84 LogIt "You probably miss the correct driver to support your CD-ROM drive" 1 85 exit 2 -
branches/2.2.5/mindi/rootfs/sbin/init
r1863 r1885 124 124 LogIt "$tapedev failed to act as extended data disk for booting." 1 125 125 LogIt "Please specify an alternate tape device," 1 126 LogIt "or hit <Enter> to boot from CD/floppies." 1126 LogIt "or hit <Enter> to boot from another media." 1 127 127 echo -en "---> " 128 128 read tapedev … … 140 140 if [ "$res" -ne "0" ] ; then 141 141 cd / 142 LogIt "Failed to use tape as extended datadisk. Reverting to floppies." 1143 HandleCDROM orFloppies142 LogIt "Failed to use tape as extended datadisk. Reverting to another media." 1 143 HandleCDROM 144 144 res=$? 145 145 else … … 155 155 156 156 157 HandleCDROM orFloppies() {157 HandleCDROM() { 158 158 # Just in case we have an iLO ensure we will map it correctly 159 159 echo "$DENY_MODS" | grep -q "usb-storage " … … 186 186 LogIt "OK, I am running on a CD-ROM. Good." 3 187 187 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 201 193 CD_MOUNTED_OK="" 202 194 fi … … 619 611 mount -o remount rw / 620 612 [ ! "$GROOVY" ] && Die "I'm not groovy!" 621 for i in $GROOVY /mnt/ floppy /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do613 for i in $GROOVY /mnt/cdrom /mnt/isodir /var/local/petris /tmp/isodir; do 622 614 mkdir -p $i 623 615 done … … 698 690 ExtractDataDisksAndLoadModules 699 691 else 700 HandleCDROM orFloppies692 HandleCDROM 701 693 ExtractDataDisksAndLoadModules 702 694 # We need to get here exported variables from start-nfs … … 781 773 else 782 774 LogIt "backup-media-type is not specified in config file." 783 LogIt "I think this CD/floppyhas no archives on it."775 LogIt "I think this media has no archives on it." 784 776 fi 785 777 if grep "RESTORE" /proc/cmdline > /dev/null 2> /dev/null ; then -
branches/2.2.5/mindi/rootfs/sbin/untar
r1734 r1885 14 14 # ---------------------- main ---------------------- 15 15 16 mountpoint=/ mnt/floppy16 mountpoint=/dev/null 17 17 [ -e "/tmp/CDROM-LIVES-HERE" ] && mountpoint=/mnt/cdrom/images 18 18 [ "$#" -eq "2" ] || Die "untar <tarball> <untar_to>" … … 22 22 if [ -e "/tmp/CDROM-LIVES-HERE" ] ; then 23 23 [ -e "$tarball" ] || LogIt "Can't find CD's $tarball" 1 24 else25 while [ ! -f "$tarball" ] ; do26 echo -e -n "Please insert data (floppy) disk #$diskno and press ENTER."27 read line28 mount /dev/fd0 -t ext2 -o ro $mountpoint29 [ -f "$tarball" ] || umount $mountpoint ; # unmount if tarball not on disk30 echo -en "Working..."31 done32 24 fi 33 25 -
branches/2.2.5/mondo-doc/mindi.8
r1691 r1885 39 39 .PP 40 40 .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. 41 creates a bootable ISO/USB image using files from the system it runs on. 43 42 .B mindi 44 43 will try hard to reproduce the environment of its host system including loaded … … 48 47 is used by 49 48 .B monodarchive(8) 50 to produce the required boot/root floppy or USB/ISO images but can also be used 51 stand-alone. 49 to produce the required USB/ISO images but can also be used stand-alone. 52 50 53 51 For stand-alone usage, … … 157 155 .I /var/cache/mindi/mindi-boot.F.img 158 156 .B mindi 159 boot floppyof size F [KB].157 boot media of size F [KB]. 160 158 .TP 161 159 .I /var/cache/mindi/mindi-root.F.img 162 160 .B mindi 163 root floppyof size F [KB].161 root media of size F [KB]. 164 162 .TP 165 163 .I /var/cache/mindi/mindi-data.N.img 166 164 .B mindi 167 data floppy number N for boot/root floppies.165 data media number N for boot/root media. 168 166 .TP 169 167 .I /var/cache/mindi/mindi.iso -
branches/2.2.5/mondo-doc/mondoarchive.8
r1762 r1885 46 46 With 47 47 .BR \-O , 48 it backs up your filesystem to CD, tape, ISO images or NFS share. Boot floppies48 it backs up your filesystem to CD, tape, ISO images or NFS share. Boot media 49 49 or a special boot CD will be created to allow you to restore from bare metal if 50 50 necessary. … … 69 69 To restore data, either run 70 70 .I mondorestore 71 from the command line or boot from the emergency CD/floppiesgenerated during71 from the command line or boot from the emergency media generated during 72 72 the backup process. The latter will come in handy if a gremlin wipes your hard 73 73 disk. … … 209 209 .TP 210 210 .BI "-o " 211 Use LILO as boot loader of boot floppy/CDinstead of SYSLINUX/ISOLINUX. By212 default, SYSLINUX is used for floppiesand ISOLINUX for CD's. Use LILO if you211 Use LILO as boot loader of boot media instead of SYSLINUX/ISOLINUX. By 212 default, SYSLINUX is used for USB and ISOLINUX for CD's. Use LILO if you 213 213 prefer 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/floppiescreated214 use to boot your PC, merely the boot loader used by the media created 215 215 by Mondo. Use ELILO instead which is mandatory for IA64 machines. 216 216 … … 249 249 250 250 .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 .TP257 251 .BI "-H " 258 252 When 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 31 31 other supported filesystem partitions to/from CD/DVD-+R/RW media, tape, 32 32 NFS, ... and Mindi Linux provides the bootable emergency restore 33 CD/floppy setwhich Mondo uses at boot-time.33 media which Mondo uses at boot-time. 34 34 </para> 35 35 </abstract> … … 421 421 </entry> 422 422 <entry> 423 Mondo calls Mindi. Mindi generates bootable floppy disk imagesand423 Mondo calls Mindi. Mindi generates bootable media image and 424 424 auxiliary data disk images which are based on your existing Linux 425 425 distribution and filesystem. That way, you can be sure Mondo's … … 445 445 </entry> 446 446 </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 a456 tape or NFS user. No, if you are using CD/DVD-R[W]'s and your computer457 supports bootable CD's. Tape users only need one floppy but other458 users may need more. Mondo will advise accordingly.459 </entry>460 </row>461 447 </tbody></tgroup></informaltable> 462 448 463 449 <itemizedlist> 464 450 <listitem> 465 <para>Try to boot from the first CD of the backup (or the first466 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. 452 Choose 'Compare Mode' by typing compare at the boot screen. 453 </para> 468 454 </listitem> 469 455 <listitem> … … 471 457 checkout the compatibility of your system. (see 472 458 <link linkend="test-mindi">Testing Mindi</link> for more 473 details). Remove the CD/floppy; boot your computer as usual;459 details). Remove the media; boot your computer as usual; 474 460 execute as root</para> 475 461 <para></para> … … 553 539 The '-gF' means you are going to see the pretty yellow-on-blue 554 540 screen instead of the boring white-on-black screen. :) It also 555 means Mondo will not offer to create physical boot floppiesfor541 means Mondo will not offer to create physical boot media for 556 542 you. It is assumed that you are able to boot from the CD which 557 543 Mondo has generated.</para> … … 612 598 If you find this to be the case for your computer, please use '-L' 613 599 to 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 boot600 for its media. (NB: This has nothing to do with which boot 615 601 loader your hard drive uses.) Also, it is a good habit to specify 616 602 your tape streamer with '-d <device>'. You don't usually need … … 691 677 <title>Mindi</title> 692 678 <para> 693 Mindi Linux creates a set of boot/root floppy diskimages679 Mindi Linux creates a set of boot/root media images 694 680 that will let you perform basic system maintenance on your Linux 695 681 distro. The principal virtues of Mindi's boot disks are the fact … … 757 743 <listitem> 758 744 <para>If you are not backing up to CD, please create boot 759 floppieswhen prompted.</para>745 media when prompted.</para> 760 746 </listitem> 761 747 </itemizedlist> … … 766 752 command-line options.</para> 767 753 </listitem> 768 <listitem><para>Insert the CD or the first boot floppywhen prompted.754 <listitem><para>Insert the media when prompted. 769 755 Press <Enter>. Wait a moment.</para></listitem> 770 756 <listitem><para>Select a subset of files to restore, e.g. /usr/local/man … … 778 764 <itemizedlist> 779 765 <listitem> 780 <para>Boot from CD/floppies.</para>766 <para>Boot from media.</para> 781 767 </listitem> 782 768 <listitem><para>Select 'Interactive Mode' at boot-time. (Type … … 916 902 </listitem> 917 903 <listitem> 918 <para>floppy disk support (built in)</para>919 </listitem>920 <listitem>921 904 <para>ext2 file system support (built-in)</para> 922 905 </listitem> … … 929 912 also</para> 930 913 <para>vfat support in the active kernel - mindi needs this when creating 931 syslinux boot floppies</para>914 syslinux boot media</para> 932 915 </listitem> 933 916 </itemizedlist> … … 940 923 module. It does require that your kernel support the initrd 941 924 initial ramdisk facility. Typically this is supported by the Linux 942 kernel. Modules used are needed to support the CD, floppy disks,925 kernel. Modules used are needed to support the CD, 943 926 hard disks, etc. If the support is modular, then the modules will 944 927 be incorporated in a boot disk by Mindi. If the support is built-in … … 1233 1216 Do you want to use your own kernel to build the boot disk (y/n) ?y 1234 1217 Would you like to use LILO (instead of syslinux) 1235 for your boot CD/floppies(y/n) ?n1218 for your boot media (y/n) ?n 1236 1219 Analyzing dependency requirements Done. 1237 1220 Making complete dependency list Done. … … 1265 1248 Failed to copy /boot/vmlinuz-2.6.12-15mdk-i686-up-4GB to ramdisk 1266 1249 1267 Warning - failed to create 1.44MB boot/root floppies1268 1269 Warning - failed to create 1.72MB boot image. Please reduce your kernel's size1270 1271 if you want to make a 1.72MB floppy disk.1272 1273 1250 Making 2880KB boot disk...........................mkfs.vfat 2.10 (22 Sep 2003) 1274 1251 ... 2880 KB boot disks were created OK Done. 1275 1252 In the directory '/root/images/mindi' you will find the images:- 1276 1253 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) ?n1278 1254 Shall I make a bootable CD image? (y/n) y 1279 1255 NB: Mindi's bootable CD always uses isolinux. … … 1290 1266 1291 1267 <para>If your kernel is too large (more than about 900KB) then you 1292 cannot make boot floppies, although you can still make a bootable1268 cannot make boot media, although you can still make a bootable 1293 1269 CD image. The easiest way to test Mindi in either case is to say 1294 1270 'n' to its first question and 'y' to its second, then use the … … 1537 1513 isn't a good idea unless you're a Mondo expert because they'll try 1538 1514 to 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 floppies1515 archives are on the CD's). Or, you can boot from the Mindi media 1540 1516 (or mondorescue.iso) and hit ENTER a few times to restore.</para> 1541 1517 <para>Those ISO images can also be used for a PXE restore. For this … … 1914 1890 </para> 1915 1891 <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 floppydisk1917 images to give you the same functionality as th e CD(minus the1918 archives, of course) on floppies. Remember, your Mondo CD is a1892 take heart: the first backup media of each set contains disk 1893 images to give you the same functionality as this media (minus the 1894 archives, of course) on other boot media. Remember, your Mondo CD is a 1919 1895 fully functional CD-based mini-distribution as well as a recovery 1920 1896 CD.</para> … … 2018 1994 <listitem> 2019 1995 <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 the1996 to your hard disk, USB key, ..., gzip it and e-mail it to the 2021 1997 &ML;.</para> 2022 1998 </listitem> … … 2361 2337 <para>It is now possible to restore to a live filesystem using 2362 2338 Mondo. In other words, you do not have to boot your PC from your 2363 CD/floppyin order to restore files. Mondo was originally designed2339 media in order to restore files. Mondo was originally designed 2364 2340 for disaster recovery - situations in which you cannot boot your 2365 2341 PC. If you can boot your PC, it is not really a disaster, is it? :) … … 2390 2366 Choose your type of backup media. The live restoration process is 2391 2367 very similar to what you'll experience if you type mondorestore 2392 with no parameters after booting from a Mondo CD/floppy.2368 with no parameters after booting from a Mondo media. 2393 2369 </entry> 2394 2370 </row> … … 2404 2380 tape backup, the tape itself should be enough. If you generated a 2405 2381 CD backup, the first CD should be enough. Otherwise, you may need 2406 the boot floppy.2382 the boot media. 2407 2383 </entry> 2408 2384 </row> … … 2663 2639 </qandaentry> 2664 2640 <qandaentry> 2665 <question><para>Q: Why do you insist on putting floppy2641 <question><para>Q: Why do you insist on putting media 2666 2642 disk images on Mondo CD? They waste space and I never use them. The 2667 CD works just fine, so why keep the floppydisk images?</para>2643 CD works just fine, so why keep the media disk images?</para> 2668 2644 </question> 2669 2645 <answer> … … 2743 2719 your kernel does not support these things, Mondo will not boot from 2744 2720 your 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 2721 kernel instead of your own. 2722 </para> 2723 </answer> 2724 </qandaentry> 2725 <qandaentry> 2726 <question><para>Q: The LILO Mondo media takes ages to 2754 2727 boot. How can I speed it up?</para></question> 2755 2728 <answer> … … 2773 2746 </qandaentry> 2774 2747 <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? 2791 2749 It says my kernel is flawed/outdated/ whatever, and when I wrote to 2792 2750 the ML, they told me the same thing... but I still don't get it. I … … 2808 2766 aside for a large tarball containing the data disks, a list of all 2809 2767 files backed up, and other sundries. If Mondo and Mindi do their 2810 respective jobs then you won't need additional floppies, just the2811 boot floppyand the tape(s).</para>2768 respective jobs then you won't need additional media, just the 2769 boot media and the tape(s).</para> 2812 2770 <para>For the moment mondorescue doesn't support OBDR for tapes. 2813 2771 Feel free to produce patches for it :-)</para> … … 2837 2795 at <link linkend="overview-sysrq-kernelreq">Linux Kernel support</link> to 2838 2796 see 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 are2847 created by Mondo) and also in the 'images' directory on the first2848 CD of your backup set, if you have backed up to CD. You can copy2849 the images to disk as follows:-</para>2850 <informaltable><tgroup cols="1"><tbody>2851 <row>2852 <entry>2853 Put an empty Boot floppy2854 </entry>2855 </row>2856 <row>2857 <entry>2858 bash# fdformat /dev/fd0u17222859 </entry>2860 </row>2861 <row>2862 <entry>2863 bash# dd if=/root/images/mindi/mindi-boot.1722.img of=/dev/fd0u17222864 </entry>2865 </row>2866 <row>2867 <entry>2868 Put an empty Data floppy2869 </entry>2870 </row>2871 <row>2872 <entry>2873 bash# fdformat /dev/fd02874 </entry>2875 </row>2876 <row>2877 <entry>2878 bash# dd if=/root/images/mindi/mindi-data-N.img of=/dev/fd02879 </entry>2880 </row>2881 <row>2882 <entry>2883 Replace N with 1, 2, etc.2884 2885 </entry>2886 </row>2887 </tbody></tgroup></informaltable>2888 2797 </answer> 2889 2798 </qandaentry> … … 3013 2922 </qandaentry> 3014 2923 <qandaentry> 3015 <question><para>Q: How do I copy the floppy images from3016 the CD to floppy disks?</para></question>3017 <answer>3018 <para>A: Mount the CD-ROM, e.g. at /mnt/cdrom. Insert a blank3019 floppy. Type:</para>3020 <para></para>3021 <informaltable><tgroup cols="1"><tbody>3022 <row>3023 <entry>3024 3025 bash# cd /mnt/cdrom/images3026 </entry>3027 </row>3028 <row>3029 <entry>3030 bash# dd if=mindi-boot.1722.img of=/dev/fd0u17223031 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/fd0u17223043 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>3052 2924 <question><para>Q: Sometimes, my laptop won't mount 3053 2925 Mondo CD properly, or something. Umm...</para></question> … … 3213 3085 <para>A: Yes. Just backup as usual but add '-d /mnt/nfs' or 3214 3086 wherever your partition is mounted; don't use '-Oc' or '-Ot' at 3215 all; just '-Oi -d /root'. Then, after booting from the floppies3087 all; just '-Oi -d /root'. Then, after booting from the media 3216 3088 which Mondo generates, you need to type 'ISO' at the 3217 3089 console.</para> … … 3314 3186 <qandaentry> 3315 3187 <question><para id="SEGF">Q: When I restore after 3316 booting from the CD/floppies, I sometimes get errors like, "Running3188 booting from the media, I sometimes get errors like, "Running 3317 3189 out of memory" or "Segmentation fault". What is going on?</para></question> 3318 3190 <answer><para>A: It sounds as if you are running out of disk -
branches/2.2.5/mondo/distributions/conf/mondorescue.conf
r1522 r1885 92 92 93 93 # 94 # Write boot floppies (yes|no) ?95 #96 write_boot_floppy=no97 98 #99 94 # Write mindi CD (yes|no) ? 100 95 # -
branches/2.2.5/mondo/src/common/libmondo-archive-EXT.h
r1647 r1885 22 22 extern int _move_files_to_stream( 23 23 char *files_to_add, ...); 24 extern int offer_to_write_boot_floppies_to_physical_disks();25 24 extern void pause_and_ask_for_cdr(int, bool *); 26 25 extern int slice_up_file_etc( -
branches/2.2.5/mondo/src/common/libmondo-archive.c
r1878 r1885 195 195 196 196 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 #else204 #define DEFAULT_1722MB_DISK "/dev/fd0u1722"205 #define BACKUP_1722MB_DISK "/dev/fd0H1722"206 197 #ifndef _SEMUN_H 207 198 #define _SEMUN_H … … 1032 1023 log_OS_error("Unable to make images directory"); 1033 1024 } 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 }1039 1025 sprintf(tmp, "BTW, I'm telling Mindi your kernel is '%s'", 1040 1026 bkpinfo->kernel_path); … … 1456 1442 } 1457 1443 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_disk1467 * @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's1493 impossible to parse. It looks like1494 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVF-------------------1495 where V means verified, E means error, F means formatted, and - means1496 not done yet.1497 */1498 return (run_program_and_log_to_screen(cmd, title));1499 #endif1500 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 device1549 * parameter and a @c title of Formatting disk @c device. If the format1550 * fails, the user will be given the option of retrying.1551 *1552 * @param device The floppy drive to write to.1553 * @see format_disk_SUB1554 * @return The exit code of fdformat/superformat.1555 * @ingroup deviceGroup1556 */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 #else1577 sprintf(command, "fdformat %s", device);1578 #endif1579 }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 }1590 1444 1591 1445 /** … … 2879 2733 2880 2734 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 the2888 * @c backup_media_type field is used in this function.2889 * @param imagesdir The directory containing the floppy images (usually2890 * /root/images/mindi).2891 *2892 * @return The number of errors encountered (0 for success)2893 * @see write_image_to_floppy2894 * @see format_disk2895 * @ingroup MLarchiveGroup2896 */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_no2926 ("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 floppy2932 system("/usr/sbin/fdcontrol -F 1722 /dev/fd0.1722");2933 #endif2934 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_no2950 ("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 #else2970 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_OK2983 ("Cannot write boot/root floppies. Files not found.");2984 log_to_screen2985 ("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_NEW3005 ("Writing root floppy", tmp);3006 // res += write_image_to_floppy (datadisk_dev, rootdisk_file);3007 }3008 }3009 #endif3010 }3011 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {3012 log_to_screen3013 ("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 only3050 * 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_floppies3054 * @ingroup MLarchiveGroup3055 */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 #else3070 if (!does_file_exist(MINDI_CACHE"/mindi-bootroot.1722.img") && !does_file_exist(MINDI_CACHE"/mindi-boot.1440.img"))3071 #endif3072 {3073 mvaddstr_and_log_it(g_currentY++, 74, "No Imgs");3074 if (does_file_exist(MINDI_CACHE"/mondorescue.iso")) {3075 popup_and_OK3076 ("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_OK3085 ("Since you opted for a nonbootable backup, no boot floppies were created.");3086 }3087 3088 return (res);3089 }3090 3091 3092 3093 3094 2735 /** 3095 2736 * @addtogroup LLarchiveGroup … … 4107 3748 4108 3749 4109 4110 4111 4112 /**4113 * @addtogroup utilityGroup4114 * @{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_floppy4122 */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_SUB4211 */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 4230 3750 void setenv_mondo_share(void) { 4231 3751 -
branches/2.2.5/mondo/src/common/libmondo-archive.h
r1647 r1885 24 24 int _move_files_to_stream(char *files_to_add, 25 25 ...); 26 int offer_to_write_boot_floppies_to_physical_disks();27 26 void pause_and_ask_for_cdr(int, bool *); 28 27 void set_bit_N_of_array(char *array, int N, bool true_or_false); … … 33 32 int verify_data(); 34 33 void 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);37 34 int write_iso_and_go_on(bool last_cd); 38 35 int write_final_iso_if_necessary(); -
branches/2.2.5/mondo/src/common/libmondo-devices.c
r1858 r1885 1890 1890 } 1891 1891 if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) { 1892 popup_and_OK("Please remove CD/floppyfrom drive(s)");1892 popup_and_OK("Please remove media from drive(s)"); 1893 1893 } 1894 1894 log_msg(3, "media type = %s", -
branches/2.2.5/mondo/src/common/my-stuff.h
r1821 r1885 232 232 #define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg" 233 233 /** 234 * The location where mindi CD and floppyimages are stored.234 * The location where mindi media images are stored. 235 235 */ 236 236 #define MINDI_CACHE "/var/cache/mindi" -
branches/2.2.5/mondo/src/mondoarchive/main.c
r1784 r1885 484 484 } 485 485 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 494 486 /* Report result of entire operation (success? errors?) */ 495 487 if (!retval) { -
branches/2.2.5/mondo/src/mondoarchive/mondo-cli.c
r1848 r1885 969 969 ("Your kernel appears not to support vfat filesystems. I am therefore"); 970 970 log_to_screen 971 ("using LILO instead of SYSLINUX as the CD/floppy'sboot loader.");971 ("using LILO instead of SYSLINUX as the media boot loader."); 972 972 } 973 973 if (run_program_and_log_output("which mkfs.vfat", 2)) { -
branches/2.2.5/mondo/src/mondorestore/mondo-restore.c
r1881 r1885 141 141 * The message to display if we detect that the user is using a Compaq Proliant. 142 142 */ 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/floppyin 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." 144 144 145 145 … … 928 928 if (!g_restoring_live_from_cd) { 929 929 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."); 931 931 sleep(1); 932 932 } … … 2937 2937 2938 2938 run_program_and_log_output("mkdir -p " MNT_CDROM, FALSE); 2939 run_program_and_log_output("mkdir -p /mnt/floppy", FALSE);2940 2939 2941 2940 malloc_string(tmp); … … 3274 3273 mvaddstr_and_log_it(g_currentY++, 3275 3274 0, 3276 "Run complete. Please remove floppy/CD/media and reboot.");3275 "Run complete. Please remove media and reboot."); 3277 3276 } else { 3278 3277 run_program_and_log_output("sync", FALSE); -
branches/2.2.5/mondo/src/mondorestore/mondo-rstr-tools.c
r1873 r1885 2313 2313 int res = 0; 2314 2314 int fd = 0; 2315 struct floppy_struct fdprms;2316 2315 2317 2316 bool try_plan_B; … … 2348 2347 log_msg(2, "mountpt = %s; cfg_file=%s", mountpt, cfg_file); 2349 2348 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 OK2360 res = ioctl(fd, FDGETPRM, &fdprms);2361 if (res >= 0) {2362 // media OK to mount2363 sprintf(command, "mount /dev/fd0u1722 %s", mountpt);2364 res = run_program_and_log_output(command, FALSE);2365 } else {2366 //skip mount2367 res = 1;2368 }2369 } else {2370 fd = open("/dev/fd0H1440", O_RDONLY);2371 if (fd > 0) {2372 // open OK2373 res = ioctl(fd, FDGETPRM, &fdprms);2374 if (res >= 0) {2375 // media OK to mount2376 sprintf(command, "mount /dev/fd0H1440 %s", mountpt);2377 res = run_program_and_log_output(command, FALSE);2378 } else {2379 //skip mount2380 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 }2408 2349 if (!does_file_exist(cfg_file)) { 2409 2350 log_msg(2, "gcffa --- we don't have cfg file yet."); … … 2453 2394 2454 2395 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"); 2456 2397 return (1); 2457 2398 } -
branches/2.2.5/pbconf/mondo-doc/du/mondo-doc.doc-base
r1674 r1885 6 6 effortlessly backup and interactively restore Linux, Windows and other 7 7 supported filesystem partitions to/from CD-R/RW media, tape, NFS, ... and 8 Mindi Linux provides the bootable emergency restore CD/floppyset which Mondo8 Mindi Linux provides the bootable emergency restore media set which Mondo 9 9 uses at boot-time. 10 10 Section: PBGRP
Note:
See TracChangeset
for help on using the changeset viewer.