Changeset 940 in MondoRescue for branches/stable/mindi
- Timestamp:
- Nov 17, 2006, 2:24:29 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r938 r940 90 90 " 91 91 FDISK=$MINDI_SBIN/parted2fdisk 92 FDISKLOG=$MONDOTMP/parted2fdisk.log93 touch $FDISKLOG94 92 95 93 # Using a config file allow to overwrite some values … … 100 98 101 99 # Now we can create what we nedd 102 MONDOTMP=`mktemp -d $TMPDIR/mondobuild.XXXXXXXXXX` 103 mkdir -p $MONDOTMP 100 MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX` 101 mkdir -p $MINDI_TMP 102 103 FDISKLOG=$MINDI_TMP/parted2fdisk.log 104 touch $FDISKLOG 105 106 # Purge from potential old run 107 rm -rf $CACHE_LOC/* 2> /dev/null 104 108 mkdir -p $CACHE_LOC 105 109 # ---------------------------------------------------------------------------- … … 266 270 267 271 sliceno=0 268 scratchfile=$M ONDOTMP/blah.$$.dat272 scratchfile=$MINDI_TMP/blah.$$.dat 269 273 cp -f $filename $scratchfile || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?" 270 274 [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-" … … 418 422 noof_disks=$4 419 423 420 mountpoint=$M ONDOTMP/mountpoint.$$424 mountpoint=$MINDI_TMP/mountpoint.$$ 421 425 mkdir -p $mountpoint 422 426 dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI)\n" 423 mke2fs -N 12 -F $imagefile > $M ONDOTMP/mke2fs.$$ 2>> $MONDOTMP/mke2fs.$$424 [ "$?" -ne "0" ] && cat $M ONDOTMP/mke2fs.$$425 rm -f $M ONDOTMP/mke2fs.$$427 mke2fs -N 12 -F $imagefile > $MINDI_TMP/mke2fs.$$ 2>> $MINDI_TMP/mke2fs.$$ 428 [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.$$ 429 rm -f $MINDI_TMP/mke2fs.$$ 426 430 mount -t ext2 -o loop $imagefile $mountpoint || Die "Can't loopmount $imagefile to $mountpoint! The reason may be missing support for loopfs or ext2 (or both) in the running kernel." 427 431 mv $tarball $mountpoint/ … … 459 463 my_partitions=`mount | grep -F $$ | cut -f1 -d' '` 460 464 [ "$my_partitions" != "" ] && umount $my_partitions 461 # Clean temporary files 462 rm -Rf $MONDOTMP $FDISKLOG 465 # Clean temporary files only when standalone mindi 466 if [ $MINDI_TMP != $MONDO_TMP ]; then 467 rm -Rf $MINDI_TMP 468 fi 463 469 exit $1 464 470 } … … 474 480 # Creates a tar file containing all required files 475 481 for i in /etc/fstab /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log $FDISKLOG ; do 476 [ -e "$i" ] && cp -f $i $M ONDOTMP482 [ -e "$i" ] && cp -f $i $MINDI_TMP 477 483 done 478 484 rm -f $TMPDIR/mindi.err.*.tgz 479 tar -cf - $M ONDOTMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz485 tar -cf - $MINDI_TMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz 480 486 LogIt "Please e-mail a copy of $TMPDIR/mindi.err.$$.tgz to the mailing list.\n" 481 487 LogIt "See http://www.mondorescue.org for more information.\n" … … 671 677 pwd=`pwd` 672 678 if [ "$YOUR_KERNEL_SUCKS" ] ; then 673 cd $M ONDOTMP679 cd $MINDI_TMP 674 680 else 675 681 cd / … … 694 700 echo -en "Analyzing dependency requirements" 695 701 outfile=$1 696 tempfile=$M ONDOTMP/$$.txt702 tempfile=$MINDI_TMP/$$.txt 697 703 incoming=`ReadLine` 698 704 … … 817 823 mkdir -p $bigdir/sbin 818 824 mkdir -p $bigdir/bin 819 if [ -e "$M ONDOTMP/post-nuke.tgz" ] ; then825 if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then 820 826 LogIt "\nIncorporating post-nuke tarball\n" 821 827 old_pwd=`pwd` 822 828 cd $bigdir 823 tar -zxf $M ONDOTMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball\n"829 tar -zxf $MINDI_TMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball\n" 824 830 cd $old_pwd 825 831 fi 826 if cp -f $M ONDOTMP/mondo*restore $bigdir/usr/bin ; then832 if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin ; then 827 833 LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre 828 834 else 829 LogIt "Cannot find mondo*restore in mondo's tempdir, $M ONDOTMP\n"835 LogIt "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP\n" 830 836 LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system.\n" 831 837 LogIt "If Mindi was called by Mondo then send me a bug report.\n It not, type 'ps ax' to see which Mondo-related process is still running;\n then kill it. :-)\n Finally, run Mindi again." 832 838 Die "Odd." 833 839 fi 834 cp -f $M ONDOTMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n"835 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then840 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n" 841 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 836 842 LogIt "Incorporating NFS-related settings\n" 837 843 for r in NFS-* ISO-PREFIX ; do 838 cp -f $M ONDOTMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?"844 cp -f $MINDI_TMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?" 839 845 echo "Copying $r to ramdisk" >> $LOGFILE 840 846 done … … 903 909 incoming=`ReadLine` 904 910 pwd=`pwd` 905 cd $M ONDOTMP911 cd $MINDI_TMP 906 912 while [ "$incoming" != "" ] ; do 907 913 stub=`basename $incoming` … … 1070 1076 echo "datestamp `date`" >> $outfile 1071 1077 [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile 1072 AddFileToCfgIfExists $M ONDOTMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile1073 AddFileToCfgIfExists $M ONDOTMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile1074 AddFileToCfgIfExists $M ONDOTMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile1075 AddFileToCfgIfExists $M ONDOTMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile1076 AddFileToCfgIfExists $M ONDOTMP/NFS-SERVER-MOUNT nfs-server-mount $outfile1077 AddFileToCfgIfExists $M ONDOTMP/NFS-SERVER-PATH nfs-server-path $outfile1078 AddFileToCfgIfExists $M ONDOTMP/NFS-DEV nfs-dev $outfile1079 AddFileToCfgIfExists $M ONDOTMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile1080 AddFileToCfgIfExists $M ONDOTMP/ISO-DEV iso-dev $outfile1081 AddFileToCfgIfExists $M ONDOTMP/ISO-MNT iso-mnt $outfile1082 AddFileToCfgIfExists $M ONDOTMP/ISO-PREFIX iso-prefix $outfile1083 AddFileToCfgIfExists $M ONDOTMP/ISODIR isodir $outfile1084 AddFileToCfgIfExists $M ONDOTMP/BOOTLOADER.DEVICE bootloader.device $outfile1085 AddFileToCfgIfExists $M ONDOTMP/BOOTLOADER.NAME bootloader.name $outfile1086 AddFileToCfgIfExists $M ONDOTMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile1087 AddFileToCfgIfExists $M ONDOTMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile1088 AddFileToCfgIfExists $M ONDOTMP/BACKUP-MEDIA-TYPE backup-media-type $outfile1089 AddFileToCfgIfExists $M ONDOTMP/DIFFERENTIAL differential $outfile1078 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile 1079 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile 1080 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile 1081 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile 1082 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-MOUNT nfs-server-mount $outfile 1083 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-PATH nfs-server-path $outfile 1084 AddFileToCfgIfExists $MINDI_TMP/NFS-DEV nfs-dev $outfile 1085 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile 1086 AddFileToCfgIfExists $MINDI_TMP/ISO-DEV iso-dev $outfile 1087 AddFileToCfgIfExists $MINDI_TMP/ISO-MNT iso-mnt $outfile 1088 AddFileToCfgIfExists $MINDI_TMP/ISO-PREFIX iso-prefix $outfile 1089 AddFileToCfgIfExists $MINDI_TMP/ISODIR isodir $outfile 1090 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile 1091 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME bootloader.name $outfile 1092 AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile 1093 AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile 1094 AddFileToCfgIfExists $MINDI_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile 1095 AddFileToCfgIfExists $MINDI_TMP/DIFFERENTIAL differential $outfile 1090 1096 } 1091 1097 … … 1100 1106 if [ "$YOUR_KERNEL_SUCKS" ] ; then 1101 1107 kver=$FAILSAFE_KVER 1102 cd $M ONDOTMP1108 cd $MINDI_TMP 1103 1109 searchpath=lib/modules/$kver 1104 1110 else … … 1124 1130 # Make temporary modprobe.conf file if we are told so 1125 1131 if [ $tmpmodprobe_flag == "Y" ] ; then 1126 infile="$M ONDOTMP/modprobe.conf.mindi"1132 infile="$MINDI_TMP/modprobe.conf.mindi" 1127 1133 find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile 1128 1134 else … … 1165 1171 1166 1172 # scratchdir, mountlist(OUT) 1167 scratchdir=$M ONDOTMP1173 scratchdir=$MINDI_TMP 1168 1174 mountlist=$1 1169 1175 … … 1439 1445 rm -f $1.tmp 1440 1446 if [ "$CDRECOVERY" != "yes" ] ; then 1441 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then1447 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1442 1448 echo -en "Press <enter> to continue.\n" >> $1 1443 elif [ ! "$M ONDOTMP" ] ; then1449 elif [ ! "$MINDI_TMP" ] ; then 1444 1450 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" >> $1 1445 1451 if [ -e "$MINDI_LIB/memtest.img" ] ; then … … 1522 1528 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0 1523 1529 fi 1524 if [ ! "$M ONDOTMP" ] ; then1530 if [ ! "$MINDI_TMP" ] ; then 1525 1531 LogIt "NB: Mindi's bootable CD always uses isolinux.\n" 1526 1532 LogIt "For a bootable CD w/LILO, please use Mondo.\n" 1527 1533 fi 1528 rm -Rf $M ONDOTMP/iso1529 mkdir -p $M ONDOTMP/iso/{images,archives,isolinux}1530 cp -f $1/*.img $1/*.gz $M ONDOTMP/iso/images || LogIt "OfferToMakeBootableISO: Cannot copy $i to $MONDOTMP/iso/images\n"1534 rm -Rf $MINDI_TMP/iso 1535 mkdir -p $MINDI_TMP/iso/{images,archives,isolinux} 1536 cp -f $1/*.img $1/*.gz $MINDI_TMP/iso/images || LogIt "OfferToMakeBootableISO: Cannot copy $i to $MINDI_TMP/iso/images\n" 1531 1537 old_pwd=`pwd` 1532 cd $M ONDOTMP/iso1538 cd $MINDI_TMP/iso 1533 1539 mkdir -p $MONDO_ROOT/iso/isolinux 1534 1540 echo "mindi_lib = $MINDI_LIB" >> $LOGFILE … … 1536 1542 for i in memdisk memtest.bin memtest.img ; do 1537 1543 j=$MINDI_LIB/$i 1538 k=$M ONDOTMP/iso/isolinux1544 k=$MINDI_TMP/iso/isolinux 1539 1545 if [ -e "$j" ] ; then 1540 1546 LogIt "Copying $j to $k\n" 1541 1547 cp -f $j $k || Die "Failed to copy $j to $k" 1542 cp -f $j $M ONDOTMP || Die "Failed to copy $j to $k"1543 fi 1544 done 1545 MakeSyslinuxMessageFile $M ONDOTMP/iso/isolinux/message.txt1546 cp $kernelpath $M ONDOTMP/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?"1547 cp $M ONDOTMP/mindi.rdz $MONDOTMP/iso/isolinux/initrd.img1548 cp $M ONDOTMP/mindi.rdz $CACHE_LOC/initrd.img1548 cp -f $j $MINDI_TMP || Die "Failed to copy $j to $k" 1549 fi 1550 done 1551 MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt 1552 cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?" 1553 cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 1554 cp $MINDI_TMP/mindi.rdz $CACHE_LOC/initrd.img 1549 1555 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" 1550 cd $M ONDOTMP/iso/isolinux1551 cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $M ONDOTMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg from mindi_home to tmp_root - did you run out of disk space?"1552 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then1556 cd $MINDI_TMP/iso/isolinux 1557 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?" 1558 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1553 1559 mv isolinux.cfg isolinux.cfg.old 1554 1560 sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg … … 1558 1564 cp $ISOLINUX ../ 1559 1565 fi 1560 cd $M ONDOTMP/iso1566 cd $MINDI_TMP/iso 1561 1567 if [ "$ARCH" != "ia64" ] ; then 1562 cp -f $M ONDOTMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?"1568 cp -f $MINDI_TMP/iso/isolinux/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT || Die "Cannot copy core files to ramdisk for boot disk. Did you run out of disk space?" 1563 1569 fi 1564 1570 [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun . 1565 1571 if [ "$ARCH" != "ia64" ] ; then 1566 mkisofs -U -J -r -o $CACHE_LOC/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $M ONDOTMP/mkisofs.log1567 else 1568 mkisofs -J -r -o $CACHE_LOC/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $M ONDOTMP/mkisofs.log1572 mkisofs -U -J -r -o $CACHE_LOC/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 1573 else 1574 mkisofs -J -r -o $CACHE_LOC/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log 1569 1575 fi 1570 1576 if [ "$?" -ne "0" ] ; then 1571 1577 echo "----------- mkisofs's errors --------------" >> $LOGFILE 1572 cat $M ONDOTMP/mkisofs.log >> $LOGFILE1578 cat $MINDI_TMP/mkisofs.log >> $LOGFILE 1573 1579 echo "mkisofs returned the following errors:-" 1574 cat $M ONDOTMP/mkisofs.log1580 cat $MINDI_TMP/mkisofs.log 1575 1581 LogIt "Failed to create ISO image.\n" 1576 1582 else 1577 1583 echo "Created bootable ISO image at $CACHE_LOC/mindi.iso" >> $LOGFILE 1578 1584 fi 1579 rm -f $M ONDOTMP/mkisofs.log1585 rm -f $MINDI_TMP/mkisofs.log 1580 1586 cd $old_pwd 1581 1587 } … … 1598 1604 if [ "`DidMondoCallMe`" ] ; then 1599 1605 if [ "$CDRECOVERY" != "yes" ] ; then 1600 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then1606 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1601 1607 echo -en "Press <enter> to continue.\n" 1602 elif [ ! "$M ONDOTMP" ] ; then1608 elif [ ! "$MINDI_TMP" ] ; then 1603 1609 echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" 1604 1610 else … … 1626 1632 rand1=$RANDOM 1627 1633 rand2=$RANDOM 1628 image=$M ONDOTMP/$rand1.$rand2.img1629 mtpt=$M ONDOTMP/$rand1.$rand2.mtpt1634 image=$MINDI_TMP/$rand1.$rand2.img 1635 mtpt=$MINDI_TMP/$rand1.$rand2.mtpt 1630 1636 dd if=/dev/zero of=$image bs=1k count=$disksize 1631 1637 mke2fs -N 26 -F $image > /dev/null … … 1692 1698 echo -en "default=RESTORE\n" 1693 1699 elif [ "$disksize" -gt "2880" ] && [ "`DidMondoCallMe`" ] ; then 1694 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then1700 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1695 1701 echo -en "default=iso\n" 1696 1702 else … … 1713 1719 elif [ "$disksize" -gt "2880" ] ; then 1714 1720 if [ "`DidMondoCallMe`" ] ; then 1715 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then1721 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1716 1722 options="iso" 1717 1723 else … … 1756 1762 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1757 1763 echo -en "Making "$disksize"KB boot disk..." 1758 TurnTgzIntoRdz $MINDI_LIB/rootfs $M ONDOTMP/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"1764 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?" 1759 1765 if [ "$ARCH" != "ia64" ] ; then 1760 1766 [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size" … … 1762 1768 echo -en "..." 1763 1769 imagefile=$imagesdir/mindi-bootroot.$disksize.img 1764 mountpoint=$M ONDOTMP/mountpoint.$$1770 mountpoint=$MINDI_TMP/mountpoint.$$ 1765 1771 mkdir -p $mountpoint 1766 1772 dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file" 1767 1773 if [ "$ARCH" = "ia64" ] ; then 1768 mkdosfs $imagefile > $M ONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log1774 mkdosfs $imagefile > $MINDI_TMP/mke2fs.log 2>> $MINDI_TMP/mke2fs.log 1769 1775 t=vfat 1770 1776 else 1771 mke2fs -N 26 -m 0 -F $imagefile > $M ONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log1777 mke2fs -N 26 -m 0 -F $imagefile > $MINDI_TMP/mke2fs.log 2>> $MINDI_TMP/mke2fs.log 1772 1778 t=ext2 1773 1779 fi 1774 [ "$?" -ne "0" ] && cat $M ONDOTMP/mke2fs.log1775 rm -f $M ONDOTMP/mke2fs.log1780 [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.log 1781 rm -f $MINDI_TMP/mke2fs.log 1776 1782 mount -t $t -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)\n\n" 1777 1783 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it … … 1794 1800 MakeLiloConfFile $disksize > $liloconf 1795 1801 1796 echo "Copying $M ONDOTMP/mindi.rdz to $mountpoint..." >> $LOGFILE1797 cp -f $M ONDOTMP/mindi.rdz $mountpoint 2>> $LOGFILE1802 echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint..." >> $LOGFILE 1803 cp -f $MINDI_TMP/mindi.rdz $mountpoint 2>> $LOGFILE 1798 1804 if [ "$?" -ne "0" ] ; then 1799 LogIt "Failed to copy $M ONDOTMP/mindi.rdz to $mountpoint\n"1800 cat $M ONDOTMP/mtpt.$$ >> $LOGFILE1805 LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint\n" 1806 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1801 1807 LogIt "Please unload some of your modules and try again.\n" 1802 rm -f $M ONDOTMP/mtpt.$$1808 rm -f $MINDI_TMP/mtpt.$$ 1803 1809 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n" 1804 1810 retval=$(($retval+1)) … … 1807 1813 1808 1814 mkdir -p $mountpoint/tmp 1809 cp -f $M ONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null1815 cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null 1810 1816 if [ -e "$MINDI_LIB/memtest.img" ] ; then 1811 1817 echo -en "image=/memtest.bin\nlabel=memtest\nn" >> $liloconf … … 1833 1839 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440 1834 1840 res=$(($res+$?)) 1835 cp -f $M ONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img1841 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 1836 1842 res=$(($res+$?)) 1837 1843 rm -f $imagefile … … 1874 1880 retval=$(($retval+1)) 1875 1881 fi 1876 cp -f $liloconf $M ONDOTMP/lilo.conf1882 cp -f $liloconf $MINDI_TMP/lilo.conf 1877 1883 if [ "$ARCH" = "ia64" ] ; then 1878 1884 cp `dirname $kernelpath`/*.efi $mountpoint … … 1908 1914 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1909 1915 echo -en "Making "$disksize"KB boot disk..." 1910 TurnTgzIntoRdz $MINDI_LIB/rootfs $M ONDOTMP/mindi.rdz $ramdisksize $disksize `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into mindi.rdz; are you SURE your kernel supports loopfs?"1916 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?" 1911 1917 [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size" 1912 1918 echo -en "..." 1913 1919 imagefile=$imagesdir/mindi-bootroot.$disksize.img 1914 mountpoint=$M ONDOTMP/mountpoint.$$1920 mountpoint=$MINDI_TMP/mountpoint.$$ 1915 1921 mkdir -p $mountpoint 1916 1922 # If I format a 1722KB data file & run syslinux on it, the resultant image … … 1935 1941 [ -e "$sys_cfg_file" ] || Die "Obi Wan, word up?" 1936 1942 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root" 1937 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then1943 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 1938 1944 mv syslinux.cfg syslinux.cfg.orig 1939 1945 sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg 1940 1946 fi 1941 1947 cd $old_pwd 1942 echo "Copying $M ONDOTMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE1943 cp -f $M ONDOTMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE1948 echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE 1949 cp -f $MINDI_TMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE 1944 1950 if [ "$?" -ne "0" ] ; then 1945 LogIt "Failed to copy $M ONDOTMP/mindi.rdz to $mountpoint\n"1946 cat $M ONDOTMP/mtpt.$$ >> $LOGFILE1951 LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint\n" 1952 cat $MINDI_TMP/mtpt.$$ >> $LOGFILE 1947 1953 LogIt "Please unload some of your modules and try again.\n" 1948 rm -f $M ONDOTMP/mtpt.$$1954 rm -f $MINDI_TMP/mtpt.$$ 1949 1955 LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n" 1950 1956 retval=$(($retval+1)) … … 1952 1958 1953 1959 mkdir -p $mountpoint/tmp 1954 cp -f $M ONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null1960 cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null 1955 1961 1956 1962 # copy the kernel across … … 1973 1979 write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440 1974 1980 res=$(($res+$?)) 1975 cp -f $M ONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img1981 cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img 1976 1982 res=$(($res+$?)) 1977 1983 rm -f $imagefile … … 2016 2022 imagesdir=$1 2017 2023 rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso 2018 needlist=$M ONDOTMP/what-we-need.txt2019 bigdir=$M ONDOTMP/bigdir2020 minidir_root=$M ONDOTMP/minidir2024 needlist=$MINDI_TMP/what-we-need.txt 2025 bigdir=$MINDI_TMP/bigdir 2026 minidir_root=$MINDI_TMP/minidir 2021 2027 mkdir -p $minidir_root 2022 2028 mkdir -p $bigdir/usr/bin 2023 tardir=$M ONDOTMP/tardir2029 tardir=$MINDI_TMP/tardir 2024 2030 2025 2031 lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l` … … 2028 2034 if [ "$YOUR_KERNEL_SUCKS" ]; then 2029 2035 pwd=`pwd` 2030 cd $M ONDOTMP2036 cd $MINDI_TMP 2031 2037 for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do 2032 2038 cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir" … … 2061 2067 mkdir -p $bigdir/tmp 2062 2068 if [ "`DidMondoCallMe`" ] ; then 2063 MakeMondoConfigFile $M ONDOTMP/mondo-restore.cfg2064 cp -f $M ONDOTMP/mondo-restore.cfg $bigdir/tmp &> /dev/null2069 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 2070 cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null 2065 2071 fi 2066 2072 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO … … 2077 2083 2078 2084 # master boot record, too 2079 i=`cat $M ONDOTMP/BOOTLOADER.DEVICE 2> /dev/null`2085 i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null` 2080 2086 if [ "$i" ] ; then 2081 2087 LogIt "Backing up $i's MBR\n" … … 2114 2120 # EXTRA_SPACE=$(($EXTRA_SPACE*2)) 2115 2121 # fi 2116 MakeMountlist $M ONDOTMP/mountlist.txt2122 MakeMountlist $MINDI_TMP/mountlist.txt 2117 2123 mkdir -p $minidir_root/$noof_disks/tmp 2118 cp -f $M ONDOTMP/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $MONDOTMP to data disk"2119 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $M ONDOTMP/.2124 cp -f $MINDI_TMP/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $MINDI_TMP to data disk" 2125 [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/. 2120 2126 [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm 2121 2127 cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE … … 2265 2271 local tempfile 2266 2272 2267 tempfile=$M ONDOTMP/$$.strip.txt2273 tempfile=$MINDI_TMP/$$.strip.txt 2268 2274 cp -f $1 $tempfile 2269 2275 $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1 … … 2296 2302 local tmpfile 2297 2303 2298 tmpfile=$M ONDOTMP/stripped.$$.dat2304 tmpfile=$MINDI_TMP/stripped.$$.dat 2299 2305 [ -d "$1" ] || [ -h "$1" ] && return 2300 2306 cp -f $1 $tmpfile … … 2484 2490 maxsize=$(($disksize-$kernelsize)) 2485 2491 maxsize=$(($maxsize*2)); # to allow for compression of 50% 2486 tempfile=$M ONDOTMP/temp.rd2487 mountpoint=$M ONDOTMP/mnt12492 tempfile=$MINDI_TMP/temp.rd 2493 mountpoint=$MINDI_TMP/mnt1 2488 2494 res=0 2489 2495 echo -en "..." … … 2492 2498 mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE 2493 2499 2494 [ "$?" -ne "0" ] && cat $M ONDOTMP/mke2fs.log2495 rm -f $M ONDOTMP/mke2fs.log2500 [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.log 2501 rm -f $MINDI_TMP/mke2fs.log 2496 2502 echo -en "..." 2497 2503 mkdir -p $mountpoint … … 2535 2541 old_pwd=`pwd` 2536 2542 if [ "$YOUR_KERNEL_SUCKS" ] ; then 2537 cd $M ONDOTMP2543 cd $MINDI_TMP 2538 2544 floppy_modules_path=lib/modules/$FAILSAFE_KVER 2539 2545 else … … 2559 2565 list_of_groovy_mods="$CDROM_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`" 2560 2566 fi 2561 if [ -e "$M ONDOTMP/NFS-DEV" ] ; then2567 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then 2562 2568 # For PXE boot 2563 2569 list_of_groovy_mods="$list_of_groovy_mods $NET_MODS" … … 2569 2575 for i in $floppy_modules ; do 2570 2576 [ -e "$i" ] && s=`du -sk $i | cut -f1` || s="" 2571 [ "$YOUR_KERNEL_SUCKS" ] && i=$M ONDOTMP/$i2577 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2572 2578 echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE 2573 2579 cp -df $i $mountpoint/ || LogIt "Unable to copy $i to $mountpoint\n" … … 2587 2593 if [ "`DidMondoCallMe`" ] ; then 2588 2594 MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg 2589 cp -f $mountpoint/tmp/mondo-restore.cfg $M ONDOTMP &> /dev/null2590 cp -f $M ONDOTMP/mountlist.txt $mountpoint/tmp/ || Die "Cannot copy mountlist to ramdisk"2595 cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null 2596 cp -f $MINDI_TMP/mountlist.txt $mountpoint/tmp/ || Die "Cannot copy mountlist to ramdisk" 2591 2597 echo -en "$FILES_IN_FILELIST" > $mountpoint/tmp/FILES-IN-FILELIST 2592 2598 echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER … … 2644 2650 if [ "`DidMondoCallMe`" ] ; then 2645 2651 for q in filelist.full.gz biggielist.txt ; do 2646 [ ! -e "$M ONDOTMP/$q" ] && Die "Cannot find $MONDOTMP/$q"2647 cp -pRdf $M ONDOTMP/$q tmp/2652 [ ! -e "$MINDI_TMP/$q" ] && Die "Cannot find $MINDI_TMP/$q" 2653 cp -pRdf $MINDI_TMP/$q tmp/ 2648 2654 done 2649 2655 mkdir -p $minidir_root/all/tmp … … 2708 2714 fi 2709 2715 # BERLIOS: Remove as too dangerous and now useless 2710 #grep -F " $M ONDOTMP " /proc/mounts | grep -F tmpfs > /dev/null 2> /dev/null && MONDOTMP=/home/tmpmondo && mkdir -p $MONDOTMP && LogIt "Changing MONDOTMP to $MONDOTMP because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason2716 #grep -F " $MINDI_TMP " /proc/mounts | grep -F tmpfs > /dev/null 2> /dev/null && MINDI_TMP=/home/tmpmondo && mkdir -p $MINDI_TMP && LogIt "Changing MINDI_TMP to $MINDI_TMP because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason 2711 2717 trap "Aborted" SIGTERM 2712 2718 DONE="\r\t\t\t\t\t\t\t\tDone. " … … 2762 2768 MindiExit 0 2763 2769 elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then 2764 MONDOTMP=$2 2770 MONDO_TMP=$2 2771 # Change MINDI_TMP for the one provided by mondo 2772 # So that it can get back the built files 2773 rm -rf $MINDI_TMP 2774 MINDI_TMP=$MONDO_TMP 2765 2775 CACHE_LOC=$3 2766 2776 if [ _"$CACHE_LOC" != _"" ]; then … … 2869 2879 if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then 2870 2880 LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else.\n" 2871 MakeMondoConfigFile $M ONDOTMP/mondo-restore.cfg2872 MakeMountlist $M ONDOTMP/mountlist.txt2873 mkdir -p $M ONDOTMP/small-all/tmp2874 cd $M ONDOTMP/small-all2875 cp -f $M ONDOTMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp || Die "Cannot copy small all.tar.gz"2876 tar -cv tmp | gzip -9 > $M ONDOTMP/all.tar.gz || Die "Cannot make small all.tar.gz"2881 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 2882 MakeMountlist $MINDI_TMP/mountlist.txt 2883 mkdir -p $MINDI_TMP/small-all/tmp 2884 cd $MINDI_TMP/small-all 2885 cp -f $MINDI_TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp || Die "Cannot copy small all.tar.gz" 2886 tar -cv tmp | gzip -9 > $MINDI_TMP/all.tar.gz || Die "Cannot make small all.tar.gz" 2877 2887 sleep 2 2878 2888 LogIt "Done. Exiting.\n" … … 2915 2925 LogIt "disks then it may still be a result of a problem with your kernel.\n" 2916 2926 pwd=`pwd` 2917 cd $M ONDOTMP2927 cd $MINDI_TMP 2918 2928 bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2" 2919 2929 cd $pwd 2920 2930 YOUR_KERNEL_SUCKS="Your kernel sucks" 2921 2931 fi 2922 echo -e "Mindi's temp dir = $M ONDOTMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE2932 echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE 2923 2933 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty...\n" 2924 2934 … … 2981 2991 OfferToMakeBootableISO $CACHE_LOC 2982 2992 if [ -e "$CACHE_LOC/all.tar.gz" ] ; then 2983 cp -f $CACHE_LOC/all.tar.gz $M ONDOTMP/2993 cp -f $CACHE_LOC/all.tar.gz $MINDI_TMP/ 2984 2994 else 2985 2995 Die "Cannot find all.tar.gz, to be written to tape" … … 2989 2999 fi 2990 3000 # cleanup 2991 rm -Rf $MONDOTMP $FDISKLOG2992 3001 LogIt "$FRIENDLY_OUTSTRING\n" 2993 3002 for mtpt in $FLOPPY_WAS_MOUNTED ; do
Note:
See TracChangeset
for help on using the changeset viewer.