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


Ignore:
Timestamp:
Nov 17, 2006, 2:24:29 PM (17 years ago)
Author:
Bruno Cornec
Message:

Temp dir of mindi should now only be removed when not called by mondo.
mondo will do it on its side later on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r938 r940  
    9090"
    9191FDISK=$MINDI_SBIN/parted2fdisk
    92 FDISKLOG=$MONDOTMP/parted2fdisk.log
    93 touch $FDISKLOG
    9492
    9593# Using a config file allow to overwrite some values
     
    10098
    10199# Now we can create what we nedd
    102 MONDOTMP=`mktemp -d $TMPDIR/mondobuild.XXXXXXXXXX`
    103 mkdir -p $MONDOTMP
     100MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX`
     101mkdir -p $MINDI_TMP
     102
     103FDISKLOG=$MINDI_TMP/parted2fdisk.log
     104touch $FDISKLOG
     105
     106# Purge from potential old run
     107rm -rf $CACHE_LOC/* 2> /dev/null
    104108mkdir -p $CACHE_LOC
    105109# ----------------------------------------------------------------------------
     
    266270
    267271    sliceno=0
    268     scratchfile=$MONDOTMP/blah.$$.dat
     272    scratchfile=$MINDI_TMP/blah.$$.dat
    269273    cp -f $filename $scratchfile || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?"
    270274    [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"
     
    418422    noof_disks=$4
    419423
    420     mountpoint=$MONDOTMP/mountpoint.$$
     424    mountpoint=$MINDI_TMP/mountpoint.$$
    421425    mkdir -p $mountpoint
    422426    dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI)\n"
    423     mke2fs -N 12 -F $imagefile > $MONDOTMP/mke2fs.$$ 2>> $MONDOTMP/mke2fs.$$
    424     [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.$$
    425     rm -f $MONDOTMP/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.$$
    426430    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."
    427431    mv $tarball $mountpoint/
     
    459463    my_partitions=`mount | grep -F $$ | cut -f1 -d' '`
    460464    [ "$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
    463469    exit $1
    464470}
     
    474480    # Creates a tar file containing all required files
    475481    for i in /etc/fstab /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log $FDISKLOG ; do
    476         [ -e "$i" ] && cp -f $i $MONDOTMP
     482        [ -e "$i" ] && cp -f $i $MINDI_TMP
    477483    done
    478484    rm -f $TMPDIR/mindi.err.*.tgz
    479     tar -cf - $MONDOTMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz
     485    tar -cf - $MINDI_TMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz
    480486    LogIt "Please e-mail a copy of $TMPDIR/mindi.err.$$.tgz to the mailing list.\n"
    481487    LogIt "See http://www.mondorescue.org for more information.\n"
     
    671677    pwd=`pwd`
    672678    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    673         cd $MONDOTMP
     679        cd $MINDI_TMP
    674680    else
    675681        cd /
     
    694700    echo -en "Analyzing dependency requirements"
    695701    outfile=$1
    696     tempfile=$MONDOTMP/$$.txt
     702    tempfile=$MINDI_TMP/$$.txt
    697703    incoming=`ReadLine`
    698704
     
    817823        mkdir -p $bigdir/sbin
    818824        mkdir -p $bigdir/bin
    819         if [ -e "$MONDOTMP/post-nuke.tgz" ] ; then
     825        if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then
    820826            LogIt "\nIncorporating post-nuke tarball\n"
    821827            old_pwd=`pwd`
    822828            cd $bigdir
    823             tar -zxf $MONDOTMP/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"
    824830            cd $old_pwd
    825831        fi
    826         if cp -f $MONDOTMP/mondo*restore $bigdir/usr/bin ; then
     832        if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin ; then
    827833            LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre
    828834        else
    829             LogIt "Cannot find mondo*restore in mondo's tempdir, $MONDOTMP\n"
     835            LogIt "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP\n"
    830836            LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system.\n"
    831837            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."
    832838            Die "Odd."
    833839        fi
    834         cp -f $MONDOTMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n"
    835         if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     840        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
    836842            LogIt "Incorporating NFS-related settings\n"
    837843            for r in NFS-* ISO-PREFIX ; do
    838                 cp -f $MONDOTMP/$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?"
    839845                echo "Copying $r to ramdisk" >> $LOGFILE
    840846            done
     
    903909    incoming=`ReadLine`
    904910    pwd=`pwd`
    905     cd $MONDOTMP
     911    cd $MINDI_TMP
    906912    while [ "$incoming" != "" ] ; do
    907913        stub=`basename $incoming`
     
    10701076    echo "datestamp `date`" >> $outfile
    10711077    [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile
    1072     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile
    1073     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile
    1074     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile
    1075     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-DEFGW  nfs-client-defgw  $outfile
    1076     AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-MOUNT  nfs-server-mount  $outfile
    1077     AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-PATH   nfs-server-path   $outfile
    1078     AddFileToCfgIfExists $MONDOTMP/NFS-DEV           nfs-dev           $outfile
    1079     AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile
    1080     AddFileToCfgIfExists $MONDOTMP/ISO-DEV           iso-dev           $outfile
    1081     AddFileToCfgIfExists $MONDOTMP/ISO-MNT           iso-mnt           $outfile
    1082     AddFileToCfgIfExists $MONDOTMP/ISO-PREFIX        iso-prefix        $outfile
    1083     AddFileToCfgIfExists $MONDOTMP/ISODIR            isodir            $outfile
    1084     AddFileToCfgIfExists $MONDOTMP/BOOTLOADER.DEVICE bootloader.device $outfile
    1085     AddFileToCfgIfExists $MONDOTMP/BOOTLOADER.NAME   bootloader.name   $outfile
    1086     AddFileToCfgIfExists $MONDOTMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile
    1087     AddFileToCfgIfExists $MONDOTMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile
    1088     AddFileToCfgIfExists $MONDOTMP/BACKUP-MEDIA-TYPE backup-media-type $outfile
    1089     AddFileToCfgIfExists $MONDOTMP/DIFFERENTIAL      differential      $outfile
     1078    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
    10901096}
    10911097
     
    11001106    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    11011107        kver=$FAILSAFE_KVER
    1102         cd $MONDOTMP
     1108        cd $MINDI_TMP
    11031109        searchpath=lib/modules/$kver
    11041110    else
     
    11241130    # Make temporary modprobe.conf file if we are told so
    11251131    if [ $tmpmodprobe_flag == "Y" ] ; then
    1126         infile="$MONDOTMP/modprobe.conf.mindi"
     1132        infile="$MINDI_TMP/modprobe.conf.mindi"
    11271133        find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile
    11281134    else
     
    11651171
    11661172# scratchdir, mountlist(OUT)
    1167     scratchdir=$MONDOTMP
     1173    scratchdir=$MINDI_TMP
    11681174    mountlist=$1
    11691175
     
    14391445    rm -f $1.tmp
    14401446    if [ "$CDRECOVERY" != "yes" ] ; then
    1441         if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1447        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    14421448            echo -en "Press <enter> to continue.\n" >> $1
    1443         elif [ ! "$MONDOTMP" ] ; then
     1449        elif [ ! "$MINDI_TMP" ] ; then
    14441450            echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" >> $1
    14451451            if [ -e "$MINDI_LIB/memtest.img" ] ; then
     
    15221528        [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0
    15231529    fi
    1524     if [ ! "$MONDOTMP" ] ; then
     1530    if [ ! "$MINDI_TMP" ] ; then
    15251531        LogIt "NB: Mindi's bootable CD always uses isolinux.\n"
    15261532        LogIt "For a bootable CD w/LILO, please use Mondo.\n"
    15271533    fi
    1528     rm -Rf $MONDOTMP/iso
    1529     mkdir -p $MONDOTMP/iso/{images,archives,isolinux}
    1530     cp -f $1/*.img $1/*.gz $MONDOTMP/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"
    15311537    old_pwd=`pwd`
    1532     cd $MONDOTMP/iso
     1538    cd $MINDI_TMP/iso
    15331539    mkdir -p $MONDO_ROOT/iso/isolinux
    15341540    echo "mindi_lib = $MINDI_LIB" >> $LOGFILE
     
    15361542    for i in memdisk memtest.bin memtest.img ; do
    15371543    j=$MINDI_LIB/$i
    1538     k=$MONDOTMP/iso/isolinux
     1544    k=$MINDI_TMP/iso/isolinux
    15391545    if [ -e "$j" ] ; then
    15401546        LogIt "Copying $j to $k\n"
    15411547        cp -f $j $k || Die "Failed to copy $j to $k"
    1542         cp -f $j $MONDOTMP || Die "Failed to copy $j to $k"
    1543     fi
    1544     done
    1545     MakeSyslinuxMessageFile $MONDOTMP/iso/isolinux/message.txt
    1546     cp $kernelpath $MONDOTMP/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?"
    1547     cp $MONDOTMP/mindi.rdz $MONDOTMP/iso/isolinux/initrd.img
    1548     cp $MONDOTMP/mindi.rdz $CACHE_LOC/initrd.img
     1548        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
    15491555    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    1550     cd $MONDOTMP/iso/isolinux
    1551     cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $MONDOTMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg from mindi_home to tmp_root - did you run out of disk space?"
    1552     if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1556    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
    15531559        mv isolinux.cfg isolinux.cfg.old
    15541560        sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg
     
    15581564        cp $ISOLINUX ../
    15591565    fi
    1560     cd $MONDOTMP/iso
     1566    cd $MINDI_TMP/iso
    15611567    if [ "$ARCH" != "ia64" ] ; then
    1562         cp -f $MONDOTMP/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?"
    15631569    fi
    15641570    [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun .   
    15651571    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> $MONDOTMP/mkisofs.log
    1567     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> $MONDOTMP/mkisofs.log
     1572        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
    15691575    fi
    15701576    if [ "$?" -ne "0" ] ; then
    15711577        echo "----------- mkisofs's errors --------------" >> $LOGFILE
    1572         cat $MONDOTMP/mkisofs.log >> $LOGFILE
     1578        cat $MINDI_TMP/mkisofs.log >> $LOGFILE
    15731579        echo "mkisofs returned the following errors:-"
    1574         cat $MONDOTMP/mkisofs.log
     1580        cat $MINDI_TMP/mkisofs.log
    15751581        LogIt "Failed to create ISO image.\n"
    15761582    else
    15771583        echo "Created bootable ISO image at $CACHE_LOC/mindi.iso" >> $LOGFILE
    15781584    fi
    1579     rm -f $MONDOTMP/mkisofs.log
     1585    rm -f $MINDI_TMP/mkisofs.log
    15801586    cd $old_pwd
    15811587}
     
    15981604        if [ "`DidMondoCallMe`" ] ; then
    15991605            if [ "$CDRECOVERY" != "yes" ] ; then
    1600                 if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1606                if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    16011607                    echo -en "Press <enter> to continue.\n"
    1602                 elif [ ! "$MONDOTMP" ] ; then
     1608                elif [ ! "$MINDI_TMP" ] ; then
    16031609                    echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
    16041610                else
     
    16261632    rand1=$RANDOM
    16271633    rand2=$RANDOM
    1628     image=$MONDOTMP/$rand1.$rand2.img
    1629     mtpt=$MONDOTMP/$rand1.$rand2.mtpt
     1634    image=$MINDI_TMP/$rand1.$rand2.img
     1635    mtpt=$MINDI_TMP/$rand1.$rand2.mtpt
    16301636    dd if=/dev/zero of=$image bs=1k count=$disksize
    16311637    mke2fs -N 26 -F $image > /dev/null
     
    16921698        echo -en "default=RESTORE\n"
    16931699    elif [ "$disksize" -gt "2880" ] && [ "`DidMondoCallMe`" ] ; then
    1694         if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1700        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    16951701            echo -en "default=iso\n"
    16961702        else
     
    17131719    elif [ "$disksize" -gt "2880" ] ; then
    17141720        if [ "`DidMondoCallMe`" ] ; then
    1715             if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1721            if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    17161722                options="iso"
    17171723            else
     
    17561762    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    17571763    echo -en "Making "$disksize"KB boot disk..."
    1758     TurnTgzIntoRdz $MINDI_LIB/rootfs $MONDOTMP/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?"
    17591765    if [ "$ARCH" != "ia64" ] ; then
    17601766        [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size"
     
    17621768    echo -en "..."
    17631769    imagefile=$imagesdir/mindi-bootroot.$disksize.img
    1764     mountpoint=$MONDOTMP/mountpoint.$$
     1770    mountpoint=$MINDI_TMP/mountpoint.$$
    17651771    mkdir -p $mountpoint
    17661772    dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file"
    17671773    if [ "$ARCH" = "ia64" ] ; then
    1768         mkdosfs $imagefile > $MONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log
     1774        mkdosfs $imagefile > $MINDI_TMP/mke2fs.log 2>> $MINDI_TMP/mke2fs.log
    17691775    t=vfat
    17701776    else
    1771         mke2fs -N 26 -m 0 -F $imagefile > $MONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log
     1777        mke2fs -N 26 -m 0 -F $imagefile > $MINDI_TMP/mke2fs.log 2>> $MINDI_TMP/mke2fs.log
    17721778    t=ext2
    17731779    fi
    1774     [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.log
    1775     rm -f $MONDOTMP/mke2fs.log
     1780    [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.log
     1781    rm -f $MINDI_TMP/mke2fs.log
    17761782    mount -t $t -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)\n\n"
    17771783# copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it
     
    17941800    MakeLiloConfFile $disksize > $liloconf
    17951801
    1796     echo "Copying $MONDOTMP/mindi.rdz to $mountpoint..." >> $LOGFILE
    1797     cp -f $MONDOTMP/mindi.rdz $mountpoint 2>> $LOGFILE
     1802    echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint..." >> $LOGFILE
     1803    cp -f $MINDI_TMP/mindi.rdz $mountpoint 2>> $LOGFILE
    17981804    if [ "$?" -ne "0" ] ; then
    1799         LogIt "Failed to copy $MONDOTMP/mindi.rdz to $mountpoint\n"
    1800         cat $MONDOTMP/mtpt.$$ >> $LOGFILE
     1805        LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint\n"
     1806        cat $MINDI_TMP/mtpt.$$ >> $LOGFILE
    18011807        LogIt "Please unload some of your modules and try again.\n"
    1802         rm -f $MONDOTMP/mtpt.$$
     1808        rm -f $MINDI_TMP/mtpt.$$
    18031809        LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n"
    18041810        retval=$(($retval+1))
     
    18071813
    18081814    mkdir -p $mountpoint/tmp
    1809     cp -f $MONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
     1815    cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
    18101816    if [ -e "$MINDI_LIB/memtest.img" ] ; then
    18111817        echo -en "image=/memtest.bin\nlabel=memtest\nn" >> $liloconf
     
    18331839        write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440
    18341840        res=$(($res+$?))
    1835         cp -f $MONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img
     1841        cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img
    18361842        res=$(($res+$?))
    18371843        rm -f $imagefile
     
    18741880        retval=$(($retval+1))
    18751881    fi
    1876     cp -f $liloconf $MONDOTMP/lilo.conf
     1882    cp -f $liloconf $MINDI_TMP/lilo.conf
    18771883    if [ "$ARCH" = "ia64" ] ; then
    18781884        cp `dirname $kernelpath`/*.efi $mountpoint
     
    19081914    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    19091915    echo -en "Making "$disksize"KB boot disk..."
    1910     TurnTgzIntoRdz $MINDI_LIB/rootfs $MONDOTMP/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?"
    19111917    [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size"
    19121918    echo -en "..."
    19131919    imagefile=$imagesdir/mindi-bootroot.$disksize.img
    1914     mountpoint=$MONDOTMP/mountpoint.$$
     1920    mountpoint=$MINDI_TMP/mountpoint.$$
    19151921    mkdir -p $mountpoint
    19161922# If I format a 1722KB data file & run syslinux on it, the resultant image
     
    19351941    [ -e "$sys_cfg_file" ] || Die "Obi Wan, word up?"
    19361942    cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root"
    1937     if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1943    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    19381944        mv syslinux.cfg syslinux.cfg.orig
    19391945        sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg
    19401946    fi
    19411947    cd $old_pwd
    1942     echo "Copying $MONDOTMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE
    1943     cp -f $MONDOTMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE
     1948    echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE
     1949    cp -f $MINDI_TMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE
    19441950    if [ "$?" -ne "0" ] ; then
    1945         LogIt "Failed to copy $MONDOTMP/mindi.rdz to $mountpoint\n"
    1946         cat $MONDOTMP/mtpt.$$ >> $LOGFILE
     1951        LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint\n"
     1952        cat $MINDI_TMP/mtpt.$$ >> $LOGFILE
    19471953        LogIt "Please unload some of your modules and try again.\n"
    1948         rm -f $MONDOTMP/mtpt.$$
     1954        rm -f $MINDI_TMP/mtpt.$$
    19491955        LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n"
    19501956        retval=$(($retval+1))
     
    19521958
    19531959    mkdir -p $mountpoint/tmp
    1954     cp -f $MONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
     1960    cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
    19551961
    19561962    # copy the kernel across
     
    19731979        write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440
    19741980        res=$(($res+$?))
    1975         cp -f $MONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img
     1981        cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img
    19761982        res=$(($res+$?))
    19771983        rm -f $imagefile
     
    20162022    imagesdir=$1
    20172023    rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
    2018     needlist=$MONDOTMP/what-we-need.txt
    2019     bigdir=$MONDOTMP/bigdir
    2020     minidir_root=$MONDOTMP/minidir
     2024    needlist=$MINDI_TMP/what-we-need.txt
     2025    bigdir=$MINDI_TMP/bigdir
     2026    minidir_root=$MINDI_TMP/minidir
    20212027    mkdir -p $minidir_root
    20222028    mkdir -p $bigdir/usr/bin
    2023     tardir=$MONDOTMP/tardir
     2029    tardir=$MINDI_TMP/tardir
    20242030
    20252031    lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l`
     
    20282034    if [ "$YOUR_KERNEL_SUCKS" ]; then
    20292035        pwd=`pwd`
    2030         cd $MONDOTMP
     2036        cd $MINDI_TMP
    20312037        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    20322038            cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
     
    20612067    mkdir -p $bigdir/tmp
    20622068    if [ "`DidMondoCallMe`" ] ; then
    2063         MakeMondoConfigFile $MONDOTMP/mondo-restore.cfg
    2064         cp -f $MONDOTMP/mondo-restore.cfg $bigdir/tmp &> /dev/null
     2069        MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg
     2070        cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null
    20652071    fi
    20662072    [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     
    20772083
    20782084    # master boot record, too
    2079     i=`cat $MONDOTMP/BOOTLOADER.DEVICE 2> /dev/null`
     2085    i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null`
    20802086    if [ "$i" ] ; then
    20812087        LogIt "Backing up $i's MBR\n"
     
    21142120#        EXTRA_SPACE=$(($EXTRA_SPACE*2))
    21152121#    fi
    2116     MakeMountlist $MONDOTMP/mountlist.txt
     2122    MakeMountlist $MINDI_TMP/mountlist.txt
    21172123    mkdir -p $minidir_root/$noof_disks/tmp
    2118     cp -f $MONDOTMP/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 $MONDOTMP/.
     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/.
    21202126    [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    21212127    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     
    22652271    local tempfile
    22662272
    2267     tempfile=$MONDOTMP/$$.strip.txt
     2273    tempfile=$MINDI_TMP/$$.strip.txt
    22682274    cp -f $1 $tempfile
    22692275    $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1
     
    22962302    local tmpfile
    22972303
    2298     tmpfile=$MONDOTMP/stripped.$$.dat
     2304    tmpfile=$MINDI_TMP/stripped.$$.dat
    22992305    [ -d "$1" ] || [ -h "$1" ] && return
    23002306    cp -f $1 $tmpfile
     
    24842490    maxsize=$(($disksize-$kernelsize))
    24852491    maxsize=$(($maxsize*2)); # to allow for compression of 50%
    2486     tempfile=$MONDOTMP/temp.rd
    2487     mountpoint=$MONDOTMP/mnt1
     2492    tempfile=$MINDI_TMP/temp.rd
     2493    mountpoint=$MINDI_TMP/mnt1
    24882494    res=0
    24892495    echo -en "..."
     
    24922498    mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE
    24932499
    2494     [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.log
    2495     rm -f $MONDOTMP/mke2fs.log
     2500    [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.log
     2501    rm -f $MINDI_TMP/mke2fs.log
    24962502    echo -en "..."
    24972503    mkdir -p $mountpoint
     
    25352541    old_pwd=`pwd`
    25362542    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    2537         cd $MONDOTMP
     2543        cd $MINDI_TMP
    25382544        floppy_modules_path=lib/modules/$FAILSAFE_KVER
    25392545    else
     
    25592565        list_of_groovy_mods="$CDROM_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`"
    25602566    fi
    2561     if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     2567    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    25622568        # For PXE boot
    25632569        list_of_groovy_mods="$list_of_groovy_mods $NET_MODS"
     
    25692575    for i in $floppy_modules ; do
    25702576        [ -e "$i" ] && s=`du -sk $i | cut -f1` || s=""
    2571         [ "$YOUR_KERNEL_SUCKS" ] && i=$MONDOTMP/$i
     2577        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
    25722578        echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    25732579        cp -df $i $mountpoint/ || LogIt "Unable to copy $i to $mountpoint\n"
     
    25872593    if [ "`DidMondoCallMe`" ] ; then
    25882594        MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg
    2589         cp -f $mountpoint/tmp/mondo-restore.cfg $MONDOTMP &> /dev/null
    2590         cp -f $MONDOTMP/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"
    25912597        echo -en "$FILES_IN_FILELIST" > $mountpoint/tmp/FILES-IN-FILELIST
    25922598        echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER
     
    26442650    if [ "`DidMondoCallMe`" ] ; then
    26452651        for q in filelist.full.gz biggielist.txt ; do
    2646             [ ! -e "$MONDOTMP/$q" ] && Die "Cannot find $MONDOTMP/$q"
    2647             cp -pRdf $MONDOTMP/$q tmp/
     2652            [ ! -e "$MINDI_TMP/$q" ] && Die "Cannot find $MINDI_TMP/$q"
     2653            cp -pRdf $MINDI_TMP/$q tmp/
    26482654        done
    26492655        mkdir -p $minidir_root/all/tmp
     
    27082714fi
    27092715# BERLIOS: Remove as too dangerous and now useless
    2710 #grep -F " $MONDOTMP " /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 reason
     2716#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
    27112717trap "Aborted" SIGTERM
    27122718DONE="\r\t\t\t\t\t\t\t\tDone.         "
     
    27622768        MindiExit 0
    27632769    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
    27652775        CACHE_LOC=$3
    27662776        if [ _"$CACHE_LOC" != _"" ]; then
     
    28692879if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then
    28702880    LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else.\n"
    2871     MakeMondoConfigFile $MONDOTMP/mondo-restore.cfg
    2872     MakeMountlist $MONDOTMP/mountlist.txt
    2873     mkdir -p $MONDOTMP/small-all/tmp
    2874     cd $MONDOTMP/small-all
    2875     cp -f $MONDOTMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp || Die "Cannot copy small all.tar.gz"
    2876     tar -cv tmp | gzip -9 > $MONDOTMP/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"
    28772887    sleep 2
    28782888    LogIt "Done. Exiting.\n"
     
    29152925    LogIt "disks then it may still be a result of a problem with your kernel.\n"
    29162926    pwd=`pwd`
    2917     cd $MONDOTMP
     2927    cd $MINDI_TMP
    29182928    bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2"
    29192929    cd $pwd
    29202930    YOUR_KERNEL_SUCKS="Your kernel sucks"
    29212931fi
    2922 echo -e "Mindi's temp dir = $MONDOTMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE
     2932echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE
    29232933[ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty...\n"
    29242934
     
    29812991    OfferToMakeBootableISO $CACHE_LOC
    29822992    if [ -e "$CACHE_LOC/all.tar.gz" ] ; then
    2983         cp -f $CACHE_LOC/all.tar.gz $MONDOTMP/
     2993        cp -f $CACHE_LOC/all.tar.gz $MINDI_TMP/
    29842994    else
    29852995        Die "Cannot find all.tar.gz, to be written to tape"
     
    29892999fi
    29903000# cleanup
    2991 rm -Rf $MONDOTMP $FDISKLOG
    29923001LogIt "$FRIENDLY_OUTSTRING\n"
    29933002for mtpt in $FLOPPY_WAS_MOUNTED ; do
Note: See TracChangeset for help on using the changeset viewer.