Changeset 1885 in MondoRescue for branches/2.2.5/mindi
- Timestamp:
- Mar 2, 2008, 12:38:35 AM (16 years ago)
- Location:
- branches/2.2.5/mindi
- Files:
-
- 1 deleted
- 5 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
Note:
See TracChangeset
for help on using the changeset viewer.