Changeset 956


Ignore:
Timestamp:
Nov 21, 2006, 1:42:46 AM (13 years ago)
Author:
bruno
Message:

merge -r938:954 $SVN_M/branches/stable

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi-busybox/ChangeLog

    r903 r956  
    33MINDI-BUSYBOX CHANGES
    44
     51.2.2 (2006-11-17)
     6- Updated based on busybox 1.2.2 (Bruno Cornec)
     7- Handles modules back again (Bruno Cornec)
     8
    591.2.1 (2006-10-04)
    610- Creation based on busybox 1.2.1 (Bruno Cornec)
  • trunk/mindi-busybox/VERSION

    r904 r956  
    1 1.2.2
     1stable
  • trunk/mindi/mindi

    r939 r956  
    6161WRITE_MINDI_CD="$mindi_write_cd"
    6262# TBC
    63 CACHEDIR="$mindi_images_dir"
     63CACHE_LOC="$mindi_images_dir"
    6464FORCE_DUAL_FLOPPIES="$mindi_dual_floppies"
    6565TMP_ROOT="$mindi_tmp_dir"
     
    102102BOOT_MEDIA_MESSAGE="$mindi_boot_msg"
    103103FDISK=$MINDI_SBIN/parted2fdisk
    104 FDISKLOG=$MONDOTMP/parted2fdisk.log
    105 touch $FDISKLOG
    106104
    107105# Using a config file allow to overwrite some values
     
    112110
    113111# Now we can create what we nedd
    114 MONDOTMP=`mktemp -d $TMPDIR/mondobuild.XXXXXXXXXX`
    115 mkdir -p $MONDOTMP
     112MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX`
     113mkdir -p $MINDI_TMP
     114
     115FDISKLOG=$MINDI_TMP/parted2fdisk.log
     116
     117# Purge from potential old run
     118rm -rf $CACHE_LOC/* 2> /dev/null
    116119mkdir -p $CACHE_LOC
    117120# ----------------------------------------------------------------------------
     
    278281
    279282    sliceno=0
    280     scratchfile=$MONDOTMP/blah.$$.dat
     283    scratchfile=$MINDI_TMP/blah.$$.dat
    281284    cp -f $filename $scratchfile || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?"
    282285    [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"
     
    341344                BIGNO=$(($BIGNO+1))
    342345            else
    343                 cp --parents -Rdf $incoming $outdir || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
     346                cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
    344347                if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] ; then
    345348                    gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming\n"
     
    430433    noof_disks=$4
    431434
    432     mountpoint=$MONDOTMP/mountpoint.$$
     435    mountpoint=$MINDI_TMP/mountpoint.$$
    433436    mkdir -p $mountpoint
    434437    dd if=/dev/zero of=$imagefile bs=1k count=1440 &> /dev/null || LogIt "Cannot dd (CODI)\n"
    435     mke2fs -N 12 -F $imagefile > $MONDOTMP/mke2fs.$$ 2>> $MONDOTMP/mke2fs.$$
    436     [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.$$
    437     rm -f $MONDOTMP/mke2fs.$$
     438    mke2fs -N 12 -F $imagefile > $MINDI_TMP/mke2fs.$$ 2>> $MINDI_TMP/mke2fs.$$
     439    [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.$$
     440    rm -f $MINDI_TMP/mke2fs.$$
    438441    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."
    439442    mv $tarball $mountpoint/
     
    471474    my_partitions=`mount | grep -F $$ | cut -f1 -d' '`
    472475    [ "$my_partitions" != "" ] && umount $my_partitions
    473     # Clean temporary files
    474     rm -Rf $MONDOTMP $FDISKLOG
     476    # Clean temporary files only when standalone mindi
     477    if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then
     478        rm -Rf $MINDI_TMP
     479    fi
    475480    exit $1
    476481}
     
    485490
    486491    # Creates a tar file containing all required files
    487     for i in /etc/fstab /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log $FDISKLOG ; do
    488         [ -e "$i" ] && cp -f $i $MONDOTMP
     492    for i in /etc/fstab /etc/lilo.conf /etc/raidtab $LOGFILE /var/log/mondo-archive.log ; do
     493        [ -e "$i" ] && cp -f $i $MINDI_TMP
    489494    done
    490495    rm -f $TMPDIR/mindi.err.*.tgz
    491     tar -cf - $MONDOTMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz
     496    tar -cf - $MINDI_TMP | gzip -9 > $TMPDIR/mindi.err.$$.tgz
    492497    LogIt "Please e-mail a copy of $TMPDIR/mindi.err.$$.tgz to the mailing list.\n"
    493498    LogIt "See http://www.mondorescue.org for more information.\n"
     
    683688    pwd=`pwd`
    684689    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    685         cd $MONDOTMP
     690        cd $MINDI_TMP
    686691    else
    687692        cd /
     
    706711    echo -en "Analyzing dependency requirements"
    707712    outfile=$1
    708     tempfile=$MONDOTMP/$$.txt
     713    tempfile=$MINDI_TMP/$$.txt
    709714    incoming=`ReadLine`
    710715
     
    829834        mkdir -p $bigdir/sbin
    830835        mkdir -p $bigdir/bin
    831         if [ -e "$MONDOTMP/post-nuke.tgz" ] ; then
     836        if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then
    832837            LogIt "\nIncorporating post-nuke tarball\n"
    833838            old_pwd=`pwd`
    834839            cd $bigdir
    835             tar -zxf $MONDOTMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball\n"
     840            tar -zxf $MINDI_TMP/post-nuke.tgz || LogIt "Error occurred when untarring post-nuke tarball\n"
    836841            cd $old_pwd
    837842        fi
    838         if cp -f $MONDOTMP/mondo*restore $bigdir/usr/bin ; then
     843        if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin ; then
    839844            LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre
    840845        else
    841             LogIt "Cannot find mondo*restore in mondo's tempdir, $MONDOTMP\n"
     846            LogIt "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP\n"
    842847            LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system.\n"
    843848            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."
    844849            Die "Odd."
    845850        fi
    846         cp -f $MONDOTMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n"
    847         if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     851        cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW.\n"
     852        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    848853            LogIt "Incorporating NFS-related settings\n"
    849854            for r in NFS-* ISO-PREFIX ; do
    850                 cp -f $MONDOTMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?"
     855                cp -f $MINDI_TMP/$r $bigdir/tmp || Die "Cannot copy $r - did you run out of disk space?"
    851856                echo "Copying $r to ramdisk" >> $LOGFILE
    852857            done
     
    915920    incoming=`ReadLine`
    916921    pwd=`pwd`
    917     cd $MONDOTMP
     922    cd $MINDI_TMP
    918923    while [ "$incoming" != "" ] ; do
    919924        stub=`basename $incoming`
     
    10821087    echo "datestamp `date`" >> $outfile
    10831088    [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile
    1084     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile
    1085     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile
    1086     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile
    1087     AddFileToCfgIfExists $MONDOTMP/NFS-CLIENT-DEFGW  nfs-client-defgw  $outfile
    1088     AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-MOUNT  nfs-server-mount  $outfile
    1089     AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-PATH   nfs-server-path   $outfile
    1090     AddFileToCfgIfExists $MONDOTMP/NFS-DEV           nfs-dev           $outfile
    1091     AddFileToCfgIfExists $MONDOTMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile
    1092     AddFileToCfgIfExists $MONDOTMP/ISO-DEV           iso-dev           $outfile
    1093     AddFileToCfgIfExists $MONDOTMP/ISO-MNT           iso-mnt           $outfile
    1094     AddFileToCfgIfExists $MONDOTMP/ISO-PREFIX        iso-prefix        $outfile
    1095     AddFileToCfgIfExists $MONDOTMP/ISODIR            isodir            $outfile
    1096     AddFileToCfgIfExists $MONDOTMP/BOOTLOADER.DEVICE bootloader.device $outfile
    1097     AddFileToCfgIfExists $MONDOTMP/BOOTLOADER.NAME   bootloader.name   $outfile
    1098     AddFileToCfgIfExists $MONDOTMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile
    1099     AddFileToCfgIfExists $MONDOTMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile
    1100     AddFileToCfgIfExists $MONDOTMP/BACKUP-MEDIA-TYPE backup-media-type $outfile
    1101     AddFileToCfgIfExists $MONDOTMP/DIFFERENTIAL      differential      $outfile
     1089    AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile
     1090    AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile
     1091    AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile
     1092    AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-DEFGW  nfs-client-defgw  $outfile
     1093    AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-MOUNT  nfs-server-mount  $outfile
     1094    AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-PATH   nfs-server-path   $outfile
     1095    AddFileToCfgIfExists $MINDI_TMP/NFS-DEV           nfs-dev           $outfile
     1096    AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile
     1097    AddFileToCfgIfExists $MINDI_TMP/ISO-DEV           iso-dev           $outfile
     1098    AddFileToCfgIfExists $MINDI_TMP/ISO-MNT           iso-mnt           $outfile
     1099    AddFileToCfgIfExists $MINDI_TMP/ISO-PREFIX        iso-prefix        $outfile
     1100    AddFileToCfgIfExists $MINDI_TMP/ISODIR            isodir            $outfile
     1101    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile
     1102    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME   bootloader.name   $outfile
     1103    AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile
     1104    AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile
     1105    AddFileToCfgIfExists $MINDI_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile
     1106    AddFileToCfgIfExists $MINDI_TMP/DIFFERENTIAL      differential      $outfile
     1107    AddFileToCfgIfExists $MINDI_TMP/ACL      acl      $outfile
     1108    AddFileToCfgIfExists $MINDI_TMP/XATTR      xattr      $outfile
    11021109}
    11031110
     
    11121119    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    11131120        kver=$FAILSAFE_KVER
    1114         cd $MONDOTMP
     1121        cd $MINDI_TMP
    11151122        searchpath=lib/modules/$kver
    11161123    else
     
    11361143    # Make temporary modprobe.conf file if we are told so
    11371144    if [ $tmpmodprobe_flag == "Y" ] ; then
    1138         infile="$MONDOTMP/modprobe.conf.mindi"
     1145        infile="$MINDI_TMP/modprobe.conf.mindi"
    11391146        find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile
    11401147    else
     
    11771184
    11781185# scratchdir, mountlist(OUT)
    1179     scratchdir=$MONDOTMP
     1186    scratchdir=$MINDI_TMP
    11801187    mountlist=$1
    11811188
     
    14511458    rm -f $1.tmp
    14521459    if [ "$CDRECOVERY" != "yes" ] ; then
    1453         if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1460        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    14541461            echo -en "Press <enter> to continue.\n" >> $1
    1455         elif [ ! "$MONDOTMP" ] ; then
     1462        elif [ ! "$MINDI_TMP" ] ; then
    14561463            echo -en "FYI, this is _not_ a Mondo Rescue CD.\n" >> $1
    14571464            if [ -e "$MINDI_LIB/memtest.img" ] ; then
     
    15331540        [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0
    15341541    fi
    1535     if [ ! "$MONDOTMP" ] ; then
     1542    if [ ! "$MINDI_TMP" ] ; then
    15361543        LogIt "NB: Mindi's bootable CD always uses isolinux.\n"
    15371544        LogIt "For a bootable CD w/LILO, please use Mondo.\n"
    15381545    fi
    1539     rm -Rf $MONDOTMP/iso
    1540     mkdir -p $MONDOTMP/iso/{images,archives,isolinux}
    1541     cp -f $1/*.img $1/*.gz $MONDOTMP/iso/images || LogIt "OfferToMakeBootableISO: Cannot copy $i to $MONDOTMP/iso/images\n"
     1546    rm -Rf $MINDI_TMP/iso
     1547    mkdir -p $MINDI_TMP/iso/{images,archives,isolinux}
     1548    cp -f $1/*.img $1/*.gz $MINDI_TMP/iso/images || LogIt "OfferToMakeBootableISO: Cannot copy $i to $MINDI_TMP/iso/images\n"
    15421549    old_pwd=`pwd`
    1543     cd $MONDOTMP/iso
     1550    cd $MINDI_TMP/iso
    15441551    mkdir -p $MONDO_ROOT/iso/isolinux
    15451552    echo "mindi_lib = $MINDI_LIB" >> $LOGFILE
    1546     cp $MINDI_LIB/mem{test,disk}* $MONDO_ROOT 2>> $LOGFILE
    15471553    for i in memdisk memtest.bin memtest.img ; do
    1548     j=$MINDI_LIB/$i
    1549     k=$MONDOTMP/iso/isolinux
    1550     if [ -e "$j" ] ; then
    1551         LogIt "Copying $j to $k\n"
    1552         cp -f $j $k || Die "Failed to copy $j to $k"
    1553         cp -f $j $MONDOTMP || Die "Failed to copy $j to $k"
    1554     fi
    1555     done
    1556     MakeSyslinuxMessageFile $MONDOTMP/iso/isolinux/message.txt
    1557     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?"
    1558     cp $MONDOTMP/mindi.rdz $MONDOTMP/iso/isolinux/initrd.img
    1559     cp $MONDOTMP/mindi.rdz $CACHE_LOC/initrd.img
     1554        j=$MINDI_LIB/$i
     1555        k=$MINDI_TMP/iso/isolinux
     1556        if [ -e "$j" ] ; then
     1557            LogIt "Copying $j to $k\n"
     1558            cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k"
     1559            cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP"
     1560            cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT"
     1561        fi
     1562    done
     1563    MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt
     1564    cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?"
     1565    cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img
     1566    cp $MINDI_TMP/mindi.rdz $CACHE_LOC/initrd.img
    15601567    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    1561     cd $MONDOTMP/iso/isolinux
    1562     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?"
    1563     if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1568    cd $MINDI_TMP/iso/isolinux
     1569    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?"
     1570    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    15641571        mv isolinux.cfg isolinux.cfg.old
    15651572        sed s/interactive/iso/ isolinux.cfg.old > isolinux.cfg
    15661573    fi
    15671574    if [ "$ARCH" != "ia64" ] ; then
    1568         cp $ISOLINUX isolinux.bin || Die "Cannot copy isolinux.bin ($ISOLINUX) to tmp_root - did you run out of disk space?"
     1575        cp $ISOLINUX isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to tmp_root - did you run out of disk space?"
    15691576        cp $ISOLINUX ../
    15701577    fi
    1571     cd $MONDOTMP/iso
     1578    cd $MINDI_TMP/iso
    15721579    if [ "$ARCH" != "ia64" ] ; then
    1573         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?"
     1580        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?"
    15741581    fi
    15751582    [ "$MONDO_SHARE" ] && cp -f $MONDO_SHARE/autorun .   
    15761583    if [ "$ARCH" != "ia64" ] ; then
    1577         mkisofs -U -J -r -o $CACHEDIR/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> /tmp/$$.mk
    1578     else
    1579         mkisofs -J -r -o $CACHEDIR/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> /tmp/$$.mk
     1584        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
     1585    else
     1586        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
    15801587    fi
    15811588    if [ "$?" -ne "0" ] ; then
    15821589        echo "----------- mkisofs's errors --------------" >> $LOGFILE
    1583         cat $MONDOTMP/mkisofs.log >> $LOGFILE
     1590        cat $MINDI_TMP/mkisofs.log >> $LOGFILE
    15841591        echo "mkisofs returned the following errors:-"
    1585         cat $MONDOTMP/mkisofs.log
     1592        cat $MINDI_TMP/mkisofs.log
    15861593        LogIt "Failed to create ISO image.\n"
    15871594    else
    1588         echo "Created bootable ISO image at $CACHEDIR/mindi.iso" >> $LOGFILE
    1589     fi
    1590     rm -f $MONDOTMP/mkisofs.log
     1595        echo "Created bootable ISO image at $CACHE_LOC/mindi.iso" >> $LOGFILE
     1596    fi
     1597    rm -f $MINDI_TMP/mkisofs.log
    15911598    cd $old_pwd
    15921599}
     
    16091616        if [ "`DidMondoCallMe`" ] ; then
    16101617            if [ "$CDRECOVERY" != "yes" ] ; then
    1611                 if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1618                if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    16121619                    echo -en "Press <enter> to continue.\n"
    1613                 elif [ ! "$MONDOTMP" ] ; then
     1620                elif [ ! "$MINDI_TMP" ] ; then
    16141621                    echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
    16151622                else
     
    16371644    rand1=$RANDOM
    16381645    rand2=$RANDOM
    1639     image=$MONDOTMP/$rand1.$rand2.img
    1640     mtpt=$MONDOTMP/$rand1.$rand2.mtpt
     1646    image=$MINDI_TMP/$rand1.$rand2.img
     1647    mtpt=$MINDI_TMP/$rand1.$rand2.mtpt
    16411648    dd if=/dev/zero of=$image bs=1k count=$disksize
    16421649    mke2fs -N 26 -F $image > /dev/null
     
    17031710        echo -en "default=RESTORE\n"
    17041711    elif [ "$disksize" -gt "2880" ] && [ "`DidMondoCallMe`" ] ; then
    1705         if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1712        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    17061713            echo -en "default=iso\n"
    17071714        else
     
    17241731    elif [ "$disksize" -gt "2880" ] ; then
    17251732        if [ "`DidMondoCallMe`" ] ; then
    1726             if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1733            if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    17271734                options="iso"
    17281735            else
     
    17671774    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    17681775    echo -en "Making "$disksize"KB boot disk..."
    1769     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?"
     1776    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?"
    17701777    if [ "$ARCH" != "ia64" ] ; then
    17711778        [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size"
     
    17731780    echo -en "..."
    17741781    imagefile=$imagesdir/mindi-bootroot.$disksize.img
    1775     mountpoint=$MONDOTMP/mountpoint.$$
     1782    mountpoint=$MINDI_TMP/mountpoint.$$
    17761783    mkdir -p $mountpoint
    17771784    dd if=/dev/zero of=$imagefile bs=1k count=$disksize &> /dev/null || Die "Cannot dd blank file"
    17781785    if [ "$ARCH" = "ia64" ] ; then
    1779         mkdosfs $imagefile > $MONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log
     1786        mkdosfs $imagefile > $MINDI_TMP/mke2fs.log 2>> $MINDI_TMP/mke2fs.log
    17801787    t=vfat
    17811788    else
    1782         mke2fs -N 26 -m 0 -F $imagefile > $MONDOTMP/mke2fs.log 2>> $MONDOTMP/mke2fs.log
     1789        mke2fs -N 26 -m 0 -F $imagefile > $MINDI_TMP/mke2fs.log 2>> $MINDI_TMP/mke2fs.log
    17831790    t=ext2
    17841791    fi
    1785     [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.log
    1786     rm -f $MONDOTMP/mke2fs.log
     1792    [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.log
     1793    rm -f $MINDI_TMP/mke2fs.log
    17871794    mount -t $t -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)\n\n"
    17881795# copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it
     
    18051812    MakeLiloConfFile $disksize > $liloconf
    18061813
    1807     echo "Copying $MONDOTMP/mindi.rdz to $mountpoint..." >> $LOGFILE
    1808     cp -f $MONDOTMP/mindi.rdz $mountpoint 2>> $LOGFILE
     1814    echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint..." >> $LOGFILE
     1815    cp -f $MINDI_TMP/mindi.rdz $mountpoint 2>> $LOGFILE
    18091816    if [ "$?" -ne "0" ] ; then
    1810         LogIt "Failed to copy $MONDOTMP/mindi.rdz to $mountpoint\n"
    1811         cat $MONDOTMP/mtpt.$$ >> $LOGFILE
     1817        LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint\n"
     1818        cat $MINDI_TMP/mtpt.$$ >> $LOGFILE
    18121819        LogIt "Please unload some of your modules and try again.\n"
    1813         rm -f $MONDOTMP/mtpt.$$
     1820        rm -f $MINDI_TMP/mtpt.$$
    18141821        LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n"
    18151822        retval=$(($retval+1))
     
    18181825
    18191826    mkdir -p $mountpoint/tmp
    1820     cp -f $MONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
     1827    cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
    18211828    if [ -e "$MINDI_LIB/memtest.img" ] ; then
    18221829        echo -en "image=/memtest.bin\nlabel=memtest\nn" >> $liloconf
     
    18441851        write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440
    18451852        res=$(($res+$?))
    1846         cp -f $MONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img
     1853        cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img
    18471854        res=$(($res+$?))
    18481855        rm -f $imagefile
     
    18851892        retval=$(($retval+1))
    18861893    fi
    1887     cp -f $liloconf $MONDOTMP/lilo.conf
     1894    cp -f $liloconf $MINDI_TMP/lilo.conf
    18881895    if [ "$ARCH" = "ia64" ] ; then
    18891896        cp `dirname $kernelpath`/*.efi $mountpoint
     
    19191926    [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
    19201927    echo -en "Making "$disksize"KB boot disk..."
    1921     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?"
     1928    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?"
    19221929    [ "$disksize" != "1722" ] && [ "$disksize" != "2880" ] && [ "$disksize" != "5760" ] && Die "PDBI - disksize is $disksize - bad size"
    19231930    echo -en "..."
    19241931    imagefile=$imagesdir/mindi-bootroot.$disksize.img
    1925     mountpoint=$MONDOTMP/mountpoint.$$
     1932    mountpoint=$MINDI_TMP/mountpoint.$$
    19261933    mkdir -p $mountpoint
    19271934# If I format a 1722KB data file & run syslinux on it, the resultant image
     
    19461953    [ -e "$sys_cfg_file" ] || Die "Obi Wan, word up?"
    19471954    cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root"
    1948     if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     1955    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    19491956        mv syslinux.cfg syslinux.cfg.orig
    19501957        sed s/interactive/iso/ syslinux.cfg.orig > syslinux.cfg
    19511958    fi
    19521959    cd $old_pwd
    1953     echo "Copying $MONDOTMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE
    1954     cp -f $MONDOTMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE
     1960    echo "Copying $MINDI_TMP/mindi.rdz to $mountpoint/initrd.img..." >> $LOGFILE
     1961    cp -f $MINDI_TMP/mindi.rdz $mountpoint/initrd.img 2>> $LOGFILE
    19551962    if [ "$?" -ne "0" ] ; then
    1956         LogIt "Failed to copy $MONDOTMP/mindi.rdz to $mountpoint\n"
    1957         cat $MONDOTMP/mtpt.$$ >> $LOGFILE
     1963        LogIt "Failed to copy $MINDI_TMP/mindi.rdz to $mountpoint\n"
     1964        cat $MINDI_TMP/mtpt.$$ >> $LOGFILE
    19581965        LogIt "Please unload some of your modules and try again.\n"
    1959         rm -f $MONDOTMP/mtpt.$$
     1966        rm -f $MINDI_TMP/mtpt.$$
    19601967        LogIt "Cannot incorporate mindi.rdz in bootdisk (kernel / modules too big?)\n"
    19611968        retval=$(($retval+1))
     
    19631970
    19641971    mkdir -p $mountpoint/tmp
    1965     cp -f $MONDOTMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
     1972    cp -f $MINDI_TMP/mondo-restore.cfg $mountpoint/tmp &> /dev/null
    19661973
    19671974    # copy the kernel across
     
    19841991        write_full_floppy_of_kernel $kernelpath $imagesdir/mindi-boot.1440.img 1440
    19851992        res=$(($res+$?))
    1986         cp -f $MONDOTMP/mindi.rdz $imagesdir/mindi-root.1440.img
     1993        cp -f $MINDI_TMP/mindi.rdz $imagesdir/mindi-root.1440.img
    19871994        res=$(($res+$?))
    19881995        rm -f $imagefile
     
    20272034    imagesdir=$1
    20282035    rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
    2029     needlist=$MONDOTMP/what-we-need.txt
    2030     bigdir=$MONDOTMP/bigdir
    2031     minidir_root=$MONDOTMP/minidir
     2036    needlist=$MINDI_TMP/what-we-need.txt
     2037    bigdir=$MINDI_TMP/bigdir
     2038    minidir_root=$MINDI_TMP/minidir
    20322039    mkdir -p $minidir_root
    20332040    mkdir -p $bigdir/usr/bin
    2034     tardir=$MONDOTMP/tardir
     2041    tardir=$MINDI_TMP/tardir
    20352042
    20362043    lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt | grep -vx "" | wc -l`
     
    20392046    if [ "$YOUR_KERNEL_SUCKS" ]; then
    20402047        pwd=`pwd`
    2041         cd $MONDOTMP
     2048        cd $MINDI_TMP
    20422049        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    20432050            cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
     
    20722079    mkdir -p $bigdir/tmp
    20732080    if [ "`DidMondoCallMe`" ] ; then
    2074         MakeMondoConfigFile $MONDOTMP/mondo-restore.cfg
    2075         cp -f $MONDOTMP/mondo-restore.cfg $bigdir/tmp &> /dev/null
     2081        MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg
     2082        cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null
    20762083    fi
    20772084    [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     
    20882095
    20892096    # master boot record, too
    2090     i=`cat $MONDOTMP/BOOTLOADER.DEVICE 2> /dev/null`
     2097    i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null`
    20912098    if [ "$i" ] ; then
    20922099        LogIt "Backing up $i's MBR\n"
     
    20982105        LogIt "Creating /dev/boot_device ($j)\n"
    20992106        mkdir -p $bigdir/dev
    2100         cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk"
     2107        cp -pRdf $j $bigdir/dev/boot_device 2> /dev/null || Die "Unable to create /dev/boot_device on ramdisk"
    21012108    fi
    21022109
     
    21252132#        EXTRA_SPACE=$(($EXTRA_SPACE*2))
    21262133#    fi
    2127     MakeMountlist $MONDOTMP/mountlist.txt
     2134    MakeMountlist $MINDI_TMP/mountlist.txt
    21282135    mkdir -p $minidir_root/$noof_disks/tmp
    2129     cp -f $MONDOTMP/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $MONDOTMP to data disk"
    2130     [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDOTMP/.
     2136    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"
     2137    [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MINDI_TMP/.
    21312138    [ $LVM != "false" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    21322139    cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     
    22762283    local tempfile
    22772284
    2278     tempfile=$MONDOTMP/$$.strip.txt
     2285    tempfile=$MINDI_TMP/$$.strip.txt
    22792286    cp -f $1 $tempfile
    22802287    $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1
     
    23072314    local tmpfile
    23082315
    2309     tmpfile=$MONDOTMP/stripped.$$.dat
     2316    tmpfile=$MINDI_TMP/stripped.$$.dat
    23102317    [ -d "$1" ] || [ -h "$1" ] && return
    23112318    cp -f $1 $tmpfile
     
    24952502    maxsize=$(($disksize-$kernelsize))
    24962503    maxsize=$(($maxsize*2)); # to allow for compression of 50%
    2497     tempfile=$MONDOTMP/temp.rd
    2498     mountpoint=$MONDOTMP/mnt1
     2504    tempfile=$MINDI_TMP/temp.rd
     2505    mountpoint=$MINDI_TMP/mnt1
    24992506    res=0
    25002507    echo -en "..."
     
    25032510    mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE
    25042511
    2505     [ "$?" -ne "0" ] && cat $MONDOTMP/mke2fs.log
    2506     rm -f $MONDOTMP/mke2fs.log
     2512    [ "$?" -ne "0" ] && cat $MINDI_TMP/mke2fs.log
     2513    rm -f $MINDI_TMP/mke2fs.log
    25072514    echo -en "..."
    25082515    mkdir -p $mountpoint
     
    25112518    old_pwd=`pwd`
    25122519    cd $mountpoint
    2513     cp -Rdf $tgz_dir_fname/* . 2>> $LOGFILE >> $LOGFILE
     2520    cp -Rdf $tgz_dir_fname/* . &>> $LOGFILE
    25142521    tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz"
    25152522    cd dev || Die "Can't cd to dev"
     
    25462553    old_pwd=`pwd`
    25472554    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    2548         cd $MONDOTMP
     2555        cd $MINDI_TMP
    25492556        floppy_modules_path=lib/modules/$FAILSAFE_KVER
    25502557    else
     
    25702577        list_of_groovy_mods="$CDROM_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`"
    25712578    fi
    2572     if [ -e "$MONDOTMP/NFS-DEV" ] ; then
     2579    if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    25732580        # For PXE boot
    25742581        list_of_groovy_mods="$list_of_groovy_mods $NET_MODS"
     
    25802587    for i in $floppy_modules ; do
    25812588        [ -e "$i" ] && s=`du -sk $i | cut -f1` || s=""
    2582         [ "$YOUR_KERNEL_SUCKS" ] && i=$MONDOTMP/$i
     2589        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
    25832590        echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    2584         cp -df $i $mountpoint/ || LogIt "Unable to copy $i to $mountpoint\n"
     2591        cp -df $i $mountpoint/ 2>/dev/null || LogIt "Unable to copy $i to $mountpoint\n"
    25852592        [ "`echo "$i" | grep -F ".gz"`" ] && gunzip -f $mountpoint/`basename $i`
    25862593    done
     
    25982605    if [ "`DidMondoCallMe`" ] ; then
    25992606        MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg
    2600         cp -f $mountpoint/tmp/mondo-restore.cfg $MONDOTMP &> /dev/null
    2601         cp -f $MONDOTMP/mountlist.txt $mountpoint/tmp/ || Die "Cannot copy mountlist to ramdisk"
     2607        cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null
     2608        cp -f $MINDI_TMP/mountlist.txt $mountpoint/tmp/ 2>/dev/null || Die "Cannot copy mountlist to ramdisk"
    26022609        echo -en "$FILES_IN_FILELIST" > $mountpoint/tmp/FILES-IN-FILELIST
    26032610        echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER
     
    26552662    if [ "`DidMondoCallMe`" ] ; then
    26562663        for q in filelist.full.gz biggielist.txt ; do
    2657             [ ! -e "$MONDOTMP/$q" ] && Die "Cannot find $MONDOTMP/$q"
    2658             cp -pRdf $MONDOTMP/$q tmp/
     2664            [ ! -e "$MINDI_TMP/$q" ] && Die "Cannot find $MINDI_TMP/$q"
     2665            cp -pRdf $MINDI_TMP/$q tmp/
    26592666        done
    26602667        mkdir -p $minidir_root/all/tmp
     
    27272734fi
    27282735# BERLIOS: Remove as too dangerous and now useless
    2729 #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
     2736#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
    27302737trap "Aborted" SIGTERM
    27312738DONE="\r\t\t\t\t\t\t\t\tDone.         "
     
    27812788        MindiExit 0
    27822789    elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then
    2783         MONDOTMP=$2
     2790        MONDO_TMP=$2
     2791        # Change MINDI_TMP for the one provided by mondo
     2792        # So that it can get back the built files
     2793        rm -rf $MINDI_TMP
     2794        MINDI_TMP=$MONDO_TMP
     2795        mkdir -p $MINDI_TMP
     2796        FDISKLOG=$MINDI_TMP/parted2fdisk.log
    27842797        CACHE_LOC=$3
    27852798        if [ _"$CACHE_LOC" != _"" ]; then
     
    28432856        fi
    28442857        [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
    2845         MONDO_ROOT=`echo $CACHEDIR | sed 's/\(.*\)\/.*/\1/'`
     2858        MONDO_ROOT=`echo $CACHE_LOC | sed 's/\(.*\)\/.*/\1/'`
    28462859        if [ _"$MONDO_ROOT" != _"" ]; then
    28472860            mkdir -p $MONDO_ROOT
     
    28882901if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then
    28892902    LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else.\n"
    2890     MakeMondoConfigFile $MONDOTMP/mondo-restore.cfg
    2891     MakeMountlist $MONDOTMP/mountlist.txt
    2892     mkdir -p $MONDOTMP/small-all/tmp
    2893     cd $MONDOTMP/small-all
    2894     cp -f $MONDOTMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp || Die "Cannot copy small all.tar.gz"
    2895     tar -cv tmp | gzip -9 > $MONDOTMP/all.tar.gz || Die "Cannot make small all.tar.gz"
     2903    MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg
     2904    MakeMountlist $MINDI_TMP/mountlist.txt
     2905    mkdir -p $MINDI_TMP/small-all/tmp
     2906    cd $MINDI_TMP/small-all
     2907    cp -f $MINDI_TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp 2>/dev/null || Die "Cannot copy small all.tar.gz"
     2908    tar -cv tmp | gzip -9 > $MINDI_TMP/all.tar.gz || Die "Cannot make small all.tar.gz"
    28962909    sleep 2
    28972910    LogIt "Done. Exiting.\n"
     
    29342947    LogIt "disks then it may still be a result of a problem with your kernel.\n"
    29352948    pwd=`pwd`
    2936     cd $MONDOTMP
     2949    cd $MINDI_TMP
    29372950    bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2"
    29382951    cd $pwd
    29392952    YOUR_KERNEL_SUCKS="Your kernel sucks"
    29402953fi
    2941 echo -e "Mindi's temp dir = $MONDOTMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE
     2954echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$CACHE_LOC" >> $LOGFILE
    29422955[ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty...\n"
    29432956
    29442957[ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it. Go to http://www.mondorescue.org and download it, then install it."
    29452958
    2946 rm -f $CACHEDIR/{*img,*gz,*iso}
    2947 
    2948 PrepareDataDiskImages $CACHEDIR
     2959rm -f $CACHE_LOC/{*img,*gz,*iso}
     2960
     2961PrepareDataDiskImages $CACHE_LOC
    29492962noof_disks=$?
    29502963[ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
     
    29522965mkdir -p $minidir_root/$noof_disks/tmp
    29532966cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
    2954 cp -f $TMP_ROOT/mountlist.txt $CACHEDIR
     2967cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC
    29552968[ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
    29562969[ -d "/proc/lvm" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     
    29582971cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
    29592972ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
    2960 CreateDataDiskImagesFromTarballs $tardir $CACHEDIR $noof_disks
     2973CreateDataDiskImagesFromTarballs $tardir $CACHE_LOC $noof_disks
    29612974FRIENDLY_OUTSTRING="Boot and data disk images were created."
    29622975# One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images
     
    30083021    [ ! -e "$boot_dev" ] && Die "Will you PLEASE tell your distribution maker to create the 1.72MB devices in /dev?"
    30093022    if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then
    3010         OfferToCopyImagesToDisks $CACHEDIR $boot_dev $FDDEVICE
     3023        OfferToCopyImagesToDisks $CACHE_LOC $boot_dev $FDDEVICE
    30113024    fi
    30123025    OfferToMakeBootableISO $CACHE_LOC
    30133026    LogIt "Finished.\n"
    30143027elif [ "$TAPEDEV" ] ; then
    3015     rm -f $CACHEDIR/{*img,*gz,*iso}
     3028    rm -f $CACHE_LOC/{*img,*gz,*iso}
    30163029    OfferToMakeBootableISO $CACHE_LOC
    30173030    if [ -e "$CACHE_LOC/all.tar.gz" ] ; then
    3018         cp -f $CACHE_LOC/all.tar.gz $MONDOTMP/
     3031        cp -f $CACHE_LOC/all.tar.gz $MINDI_TMP/
    30193032    else
    30203033        Die "Cannot find all.tar.gz, to be written to tape"
     
    30243037fi
    30253038# cleanup
    3026 rm -Rf $MONDOTMP $FDISKLOG
    30273039LogIt "$FRIENDLY_OUTSTRING\n"
    30283040for mtpt in $FLOPPY_WAS_MOUNTED ; do
  • trunk/mondo-doc/mondoarchive.8

    r914 r956  
    322322Specify the loglevel. Use 99 for full debug. Standard debug level is 4.
    323323
     324.TP
     325.BI "-z "
     326Use extended attributes and acl for each file and store them in the backup media. Use this option if you use SElinux e.g. but it will slow down backup and restore time of course.
     327
    324328
    325329.SH DIAGNOSTICS
     
    361365for its ISO's unless you exclude it, as follows:-
    362366.br
    363 .I "mondoarchive -Oi -d /mnt/foo -E \"/mnt/foo /mnt/foo2\" -p `hostname`-`date +%Y-%m-%d`"
     367.I "mondoarchive -Oi -d /mnt/foo -E '/mnt/foo /mnt/foo2' -p \`hostname\`-\`date +%Y-%m-%d\`"
    364368
    365369Backup to ISO's non-interactively, e.g. as a job running in /etc/cron.daily:
    366370.br
    367 .I "mkdir -p /bkp/`date +%A`; mondoarchive -Oi -9 -d /bkp/`date +%A` -E /bkp"
     371.I "mkdir -p /bkp/\`date +%A\`; mondoarchive -Oi -9 -d /bkp/\`date +%A\` -E /bkp"
    368372
    369373.BI DVD:
  • trunk/mondo/src/common/libmondo-archive.c

    r914 r956  
    7575extern bool g_cd_recovery;
    7676extern char *g_serial_string;
     77
     78extern char *g_getfacl;
     79extern char *g_getfattr;
     80
     81
    7782
    7883/**
     
    538543    /*@ buffer ************************************************************ */
    539544    char *tmp = NULL;
     545    char *tmp1 = NULL;
    540546    char *command = NULL;
    541547    char *use_lzo_sz = NULL;
     
    552558    char *value = NULL;
    553559    char *bootdev = NULL;
    554 
    555560
    556561
     
    802807    }
    803808    mr_free(tmp);
     809
     810    if (g_getfattr) {
     811        asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);
     812        if (write_one_liner_data_file(tmp1, "TRUE")) {
     813            log_msg(1, "%ld: Unable to write one-liner XATTR",
     814                __LINE__);
     815        }
     816        paranoid_free(tmp1);
     817    }
     818    if (g_getfacl) {
     819        asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);
     820        if (write_one_liner_data_file(tmp1, "TRUE")) {
     821            log_msg(1, "%ld: Unable to write one-liner ACL",
     822                __LINE__);
     823        }
     824        paranoid_free(tmp1);
     825    }
    804826
    805827    estimated_total_noof_slices =
     
    975997    char *archiving_filelist_fname;
    976998    char *archiving_afioball_fname;
    977     char *curr_xattr_list_fname;
     999    char *curr_xattr_list_fname = NULL;
    9781000    char *curr_acl_list_fname;
    9791001
     
    10461068        log_msg(4, "%s[%d:%d] - EXATing %d...", FORTY_SPACES, getpid(),
    10471069                this_thread_no, archiving_set_no);
    1048         mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    1049                  bkpinfo->tmpdir, archiving_set_no);
    1050         mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    1051                  bkpinfo->tmpdir, archiving_set_no);
    1052         get_fattr_list(archiving_filelist_fname, curr_xattr_list_fname);
    1053         mr_free(curr_xattr_list_fname);
    1054         get_acl_list(archiving_filelist_fname, curr_acl_list_fname);
    1055         mr_free(curr_acl_list_fname);
     1070        if (g_getfattr) {
     1071            mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     1072                bkpinfo->tmpdir, archiving_set_no);
     1073            get_fattr_list(archiving_filelist_fname, curr_xattr_list_fname);
     1074            mr_free(curr_xattr_list_fname);
     1075        }
     1076        if (g_getfacl) {
     1077            mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     1078                bkpinfo->tmpdir, archiving_set_no);
     1079            get_acl_list(archiving_filelist_fname, curr_acl_list_fname);
     1080            mr_free(curr_acl_list_fname);
     1081        }
    10561082
    10571083        log_msg(4, "%s[%d:%d] - archiving %d...", FORTY_SPACES, getpid(),
     
    14321458    int noof_threads;
    14331459    int i;
    1434     char *curr_xattr_list_fname;
     1460    char *curr_xattr_list_fname = NULL;
    14351461    char *curr_acl_list_fname;
    14361462    int misc_counter_that_is_not_important = 0;
     
    15151541            // store set N
    15161542            mr_asprintf(&storing_filelist_fname, FILELIST_FNAME_RAW_SZ,
    1517                      bkpinfo->tmpdir, storing_set_no);
     1543                    bkpinfo->tmpdir, storing_set_no);
    15181544            mr_asprintf(&storing_afioball_fname, AFIOBALL_FNAME_RAW_SZ,
    1519                      bkpinfo->tmpdir, storing_set_no, bkpinfo->zip_suffix);
    1520             mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    1521                      bkpinfo->tmpdir, storing_set_no);
    1522             mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    1523                      bkpinfo->tmpdir, storing_set_no);
     1545                    bkpinfo->tmpdir, storing_set_no, bkpinfo->zip_suffix);
     1546            if (g_getfattr) {
     1547                mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     1548                    bkpinfo->tmpdir, storing_set_no);
     1549            }
     1550            if (g_getfacl) {
     1551                mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     1552                    bkpinfo->tmpdir, storing_set_no);
     1553            }
    15241554
    15251555            log_msg(2, "Storing set %d", storing_set_no);
     
    15491579                                         NULL);
    15501580            } else {
    1551                 res =
    1552                     move_files_to_cd(bkpinfo, storing_filelist_fname,
     1581                if (g_getfacl) {
     1582                    if (g_getfattr) {
     1583                        res = move_files_to_cd(bkpinfo, storing_filelist_fname,
    15531584                                     curr_xattr_list_fname,
    15541585                                     curr_acl_list_fname,
    15551586                                     storing_afioball_fname, NULL);
     1587                    } else {
     1588                        res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1589                                    curr_acl_list_fname,
     1590                                    storing_afioball_fname, NULL);
     1591                    }
     1592                } else {
     1593                    if (g_getfattr) {
     1594                            res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1595                                    curr_xattr_list_fname,
     1596                                    storing_afioball_fname, NULL);
     1597                    } else {
     1598                            res = move_files_to_cd(bkpinfo, storing_filelist_fname,
     1599                                    storing_afioball_fname, NULL);
     1600                    }
     1601                }
    15561602            }
    15571603            mr_free(storing_filelist_fname);
     
    21652211
    21662212        log_msg(1, "EXAT'g set %ld", curr_set_no);
    2167         mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    2168                  bkpinfo->tmpdir, curr_set_no);
    2169         mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    2170                  bkpinfo->tmpdir, curr_set_no);
    2171         get_fattr_list(curr_filelist_fname, curr_xattr_list_fname);
    2172         get_acl_list(curr_filelist_fname, curr_acl_list_fname);
     2213        if (g_getfattr) {
     2214            mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     2215                bkpinfo->tmpdir, curr_set_no);
     2216            get_fattr_list(curr_filelist_fname, curr_xattr_list_fname);
     2217        }
     2218        if (g_getfacl) {
     2219            mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     2220                bkpinfo->tmpdir, curr_set_no);
     2221            get_acl_list(curr_filelist_fname, curr_acl_list_fname);
     2222        }
    21732223
    21742224        log_msg(1, "Archiving set %ld", curr_set_no);
     
    22002250            res = move_files_to_stream(bkpinfo, curr_afioball_fname, NULL);
    22012251        } else {
    2202             res =
    2203                 move_files_to_cd(bkpinfo, curr_filelist_fname,
    2204                                  curr_xattr_list_fname,
    2205                                  curr_acl_list_fname, curr_afioball_fname,
    2206                                  NULL);
     2252                if (g_getfacl) {
     2253                    if (g_getfattr) {
     2254                        res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2255                                     curr_xattr_list_fname,
     2256                                     curr_acl_list_fname,
     2257                                     curr_afioball_fname, NULL);
     2258                    } else {
     2259                        res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2260                                    curr_acl_list_fname,
     2261                                    curr_afioball_fname, NULL);
     2262                    }
     2263                } else {
     2264                    if (g_getfattr) {
     2265                            res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2266                                    curr_xattr_list_fname,
     2267                                    curr_afioball_fname, NULL);
     2268                    } else {
     2269                            res = move_files_to_cd(bkpinfo, curr_filelist_fname,
     2270                                    curr_afioball_fname, NULL);
     2271                    }
     2272                }
    22072273        }
    22082274        retval += res;
     
    23152381    mr_asprintf(&biggielist, "%s/archives/biggielist.txt",
    23162382             bkpinfo->scratchdir);
    2317     mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
    2318     mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2383    if (g_getfattr) {
     2384        mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2385    }
     2386    if (g_getfacl) {
     2387        mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2388    }
    23192389
    23202390    mr_asprintf(&command, "cp %s/biggielist.txt %s", bkpinfo->tmpdir,
     
    23312401    }
    23322402
    2333     get_fattr_list(biggielist, xattr_fname);
    2334     get_acl_list(biggielist, acl_fname);
    2335     mr_asprintf(&command, "cp %s %s/archives/", xattr_fname,
     2403    if (g_getfattr) {
     2404        get_fattr_list(biggielist, xattr_fname);
     2405        mr_asprintf(&command, "cp %s %s/archives/", xattr_fname,
     2406            bkpinfo->scratchdir);
     2407        paranoid_system(command);
     2408        mr_free(command);
     2409    }
     2410    if (g_getfacl) {
     2411        get_acl_list(biggielist, acl_fname);
     2412        mr_asprintf(&command, "cp %s %s/archives/", acl_fname,
    23362413             bkpinfo->scratchdir);
    2337     paranoid_system(command);
    2338     mr_free(command);
    2339 
    2340     mr_asprintf(&command, "cp %s %s/archives/", acl_fname,
    2341              bkpinfo->scratchdir);
    2342     paranoid_system(command);
    2343     mr_free(command);
     2414        paranoid_system(command);
     2415        mr_free(command);
     2416    }
    23442417
    23452418    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
     
    23492422        mr_free(blah);
    23502423    }
    2351     mr_free(xattr_fname);
    2352     mr_free(acl_fname);
     2424    if (g_getfattr) {
     2425        mr_free(xattr_fname);
     2426    }
     2427    if (g_getfacl) {
     2428        mr_free(acl_fname);
     2429    }
    23532430
    23542431    res = make_slices_and_images(bkpinfo, biggielist);
  • trunk/mondo/src/common/libmondo-fifo.c

    r932 r956  
    160160
    161161    sync();
     162    if (g_sz_call_to_buffer == NULL) {
     163        return;
     164    }
     165    if (strcmp(g_sz_call_to_buffer,"") == 0) {
     166        return;
     167    }
    162168    mr_asprintf(&command,
    163             "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options,
    164             g_sz_call_to_buffer);
     169            "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options, g_sz_call_to_buffer);
    165170    mr_free(g_sz_call_to_buffer);
    166171    log_msg(2, "kill_buffer() --- command = %s", command);
  • trunk/mondo/src/common/libmondo-filelist.c

    r914 r956  
    6262extern int g_noof_rows;
    6363
     64extern char *g_getfacl;
     65extern char *g_getfattr;
    6466
    6567/**
     
    9597    log_to_screen(_("Dividing filelist into sets. Please wait."));
    9698    i = 0;
    97 /*
    98   if (find_home_of_exe("getfattr"))
    99     { i++; log_to_screen ("NEW! Recording extended attributes."); }
    100   if (find_home_of_exe("getfacl"))
    101     { i++; log_to_screen ("NEW! Recording ACL information."); }
    102   if (i)
    103     { i=0; log_to_screen ("This will take more time. Please be patient."); }
    104 */
    10599    mr_asprintf(&filelist, "%s/archives/filelist.full", bkpinfo->scratchdir);
    106100    if (!does_file_exist(filelist)) {
     
    475469    int retval = 0;
    476470
    477     mr_asprintf(&command, "touch %s", facl_fname);
    478     run_program_and_log_output(command, 8);
    479     mr_free(command);
    480 
    481     tmp = find_home_of_exe("getfacl");
    482     if (tmp) {
    483 //      sort_file(filelist); // FIXME - filelist chopper sorts, so this isn't necessary
     471    if (g_getfacl != NULL) {
     472        mr_asprintf(&command, "touch %s", facl_fname);
     473        run_program_and_log_output(command, 8);
     474        mr_free(command);
     475
    484476        mr_asprintf(&command,
    485477                 "getfacl --all-effective -P %s 2>> %s | gzip -c1 > %s 2>> %s",
     
    489481        mr_free(command);
    490482    }
    491     mr_free(tmp);
    492483    return (retval);
    493484}
     
    500491    int retval = 0;
    501492
    502     mr_asprintf(&command, "touch %s", fattr_fname);
    503     run_program_and_log_output(command, 8);
    504     mr_free(command);
    505 
    506     tmp = find_home_of_exe("getfattr");
    507     if (tmp) {
    508 //      sort_file(filelist); // FIXME - filelist chopper sorts, so this isn't necessary
     493    if (g_getfattr != NULL) {
     494        mr_asprintf(&command, "touch %s", fattr_fname);
     495        run_program_and_log_output(command, 8);
     496        mr_free(command);
     497
    509498        retval =
    510499            gen_aux_list(filelist, "getfattr --en=hex -P -d \"%s\"",
    511500                         fattr_fname);
    512501    }
    513     mr_free(tmp);
    514502    return (retval);
    515503}
  • trunk/mondo/src/common/libmondo-stream.c

    r900 r956  
    2929extern int g_tape_buffer_size_MB;
    3030
     31extern char *g_getfacl;
     32extern char *g_getfattr;
     33
    3134/**
    3235 * @addtogroup globalGroup
     
    346349
    347350// xattr
    348     res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    349     if (*pctrl_chr != BLK_START_EXAT_FILE) {
    350         wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
    351     }
    352     if (!strstr(fname, "xattr")) {
    353         fatal_error("Wrong order, sunshine.");
     351    if (g_getfattr) {
     352        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
     353        if (*pctrl_chr != BLK_START_EXAT_FILE) {
     354            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
     355        }
     356        if (!strstr(fname, "xattr")) {
     357            fatal_error("Wrong order, sunshine.");
     358        }
     359        read_file_from_stream_to_file(bkpinfo, xattr_fname, *ptmp_size);
     360        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     361        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     362            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
     363        }
     364        log_msg(1, "Got xattr");
    354365    }
    355366    mr_free(fname);
     
    361372    }
    362373    // acl
    363     res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    364     if (!strstr(fname, "acl")) {
    365         fatal_error("Wrong order, sunshine.");
     374    if (g_getfacl) {
     375        res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
     376        if (!strstr(fname, "acl")) {
     377            fatal_error("Wrong order, sunshine.");
     378        }
     379        if (*pctrl_chr != BLK_START_EXAT_FILE) {
     380            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
     381        }
     382        read_file_from_stream_to_file(bkpinfo, acl_fname, *ptmp_size);
     383        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     384        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     385            wrong_marker(BLK_STOP_EXAT_FILE, *pctrl_chr);
     386        }
     387        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     388        if (*pctrl_chr != BLK_STOP_EXTENDED_ATTRIBUTES) {
     389            wrong_marker(BLK_STOP_EXTENDED_ATTRIBUTES, *pctrl_chr);
     390        }
     391        log_msg(1, "Got acl");
    366392    }
    367393    mr_free(fname);
     
    380406    }
    381407    // tarball itself
    382     res = read_header_block_from_stream(ptmp_size, fname, pctrl_chr);
    383     log_msg(1, "Got xattr and acl; now looking for afioball");
    384     tmp_fname = fname;
     408    res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
     409    log_msg(1, "now looking for afioball");
    385410    return (retval);
    386411}
     
    391416{
    392417    int res = 0;
    393     // EXATs
    394     write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    395                                  BLK_START_EXTENDED_ATTRIBUTES);
     418    if (g_getfattr) {
    396419    // xattr
    397     write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    398                                  BLK_START_EXAT_FILE);
    399     write_file_to_stream_from_file(bkpinfo, xattr_fname);
    400     write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
    401 // acl
    402     write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    403                                  BLK_START_EXAT_FILE);
    404     write_file_to_stream_from_file(bkpinfo, acl_fname);
    405     write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
    406     write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    407                                  BLK_STOP_EXTENDED_ATTRIBUTES);
     420        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     421                             BLK_START_EXTENDED_ATTRIBUTES);
     422        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     423                             BLK_START_EXAT_FILE);
     424        write_file_to_stream_from_file(bkpinfo, xattr_fname);
     425        write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
     426    }
     427    if (g_getfacl) {
     428    // acl
     429        write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
     430                             BLK_START_EXAT_FILE);
     431        write_file_to_stream_from_file(bkpinfo, acl_fname);
     432        write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
     433        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     434                             BLK_STOP_EXTENDED_ATTRIBUTES);
     435    }
    408436    return (res);
    409437}
  • trunk/mondo/src/common/libmondo-verify.c

    r914 r956  
    3232int g_last_afioball_number = -1;
    3333
     34extern char *g_getfacl;
     35extern char *g_getfattr;
    3436
    3537/**
     
    703705    assert(bkpinfo != NULL);
    704706
    705     mr_asprintf(&curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
    706              bkpinfo->tmpdir);
    707     mr_asprintf(&curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
    708              bkpinfo->tmpdir);
     707    if (g_getfattr) {
     708        mr_asprintf(&curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
     709            bkpinfo->tmpdir);
     710    }
     711    if (g_getfacl) {
     712        mr_asprintf(&curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
     713            bkpinfo->tmpdir);
     714    }
    709715    log_to_screen(_("Verifying regular archives on tape"));
    710716    total_afioballs = get_last_filelist_number(bkpinfo) + 1;
     
    733739         ctrl_chr != BLK_STOP_AFIOBALLS;
    734740         res = read_header_block_from_stream(&size, fname, &ctrl_chr)) {
    735         mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
    736                  bkpinfo->tmpdir, current_afioball_number);
    737         mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
    738                  bkpinfo->tmpdir, current_afioball_number);
     741        if (g_getfattr) {
     742            mr_asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
     743                bkpinfo->tmpdir, current_afioball_number);
     744        }
     745        if (g_getfacl) {
     746            mr_asprintf(&curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
     747                bkpinfo->tmpdir, current_afioball_number);
     748        }
    739749        if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    740750            iamhere("Reading EXAT files from tape");
     
    817827    assert(bkpinfo != NULL);
    818828
    819     mr_asprintf(&curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
    820              bkpinfo->tmpdir);
    821     mr_asprintf(&curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
    822              bkpinfo->tmpdir);
     829    if (g_getfattr) {
     830        mr_asprintf(&curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
     831            bkpinfo->tmpdir);
     832    }
     833    if (g_getfacl) {
     834        mr_asprintf(&curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
     835            bkpinfo->tmpdir);
     836    }
    823837    mr_asprintf(&comment, "Verifying all bigfiles.");
    824838    log_to_screen(comment);
  • trunk/mondo/src/mondoarchive/mondo-cli.c

    r914 r956  
    3232bool g_ISO_restore_mode = FALSE;
    3333
     34extern double g_kernel_version;
     35extern int g_current_media_number;
     36extern pid_t g_main_pid;
     37extern char *resolve_softlinks_to_get_to_actual_device_file(char *);
     38
     39/* Do we use extended attributes and acl ?
     40 * By default no, use --acl & --attr options to force their usage */
     41char *g_getfacl = NULL;
     42char *g_getfattr = NULL;
    3443
    3544/**
     
    194203    char *q = NULL;
    195204
    196     long itbs;
     205    long itbs = 0L;
    197206
    198207    struct stat buf;
     
    496505    if (flag_set['w']) {
    497506        bkpinfo->backup_media_type = cdrw;
     507    }
     508    if (flag_set['z']) {
     509        if (find_home_of_exe("getfattr")) {
     510            asprintf(&g_getfattr,"getfattr");
     511        }
     512        if (find_home_of_exe("getfacl")) {
     513            asprintf(&g_getfacl,"getfacl");
     514        }
    498515    }
    499516
     
    876893    while ((opt =
    877894            getopt(argc, argv,
    878                    "0123456789A:B:C:DE:FHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:"))
     895                   "0123456789A:B:C:DE:FHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
    879896           != -1) {
    880897        if (opt == '?') {
  • trunk/mondo/src/mondorestore/mondo-restore.c

    r932 r956  
    127127char *ps_options = "";
    128128char *ps_proc_id = "$1";
     129
     130extern char *g_getfacl;
     131extern char *g_getfattr;
    129132
    130133/* @} - end of "Restore-Time Globals" in globalGroup */
     
    16091612
    16101613    if (filelist == NULL || matches > 0) {
    1611         mr_asprintf(&xattr_fname, XATTR_LIST_FNAME_RAW_SZ,
     1614        if (g_getfattr) {
     1615            mr_asprintf(&xattr_fname, XATTR_LIST_FNAME_RAW_SZ,
    16121616                MNT_CDROM "/archives", current_tarball_number);
    1613         mr_asprintf(&acl_fname, ACL_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives",
     1617        }
     1618        if (g_getfacl) {
     1619            mr_asprintf(&acl_fname, ACL_LIST_FNAME_RAW_SZ, MNT_CDROM "/archives",
    16141620                current_tarball_number);
     1621        }
    16151622        if (strstr(tarball_fname, ".bz2")) {
    16161623            mr_asprintf(&executable, "bzip2");
     
    16891696        }
    16901697
    1691         log_msg(1, "Setting fattr list %s", xattr_fname);
    1692         if (length_of_file(xattr_fname) > 0) {
    1693             res = set_fattr_list(filelist_subset_fname, xattr_fname);
    1694             if (res) {
    1695                 log_to_screen
    1696                     (_
    1697                      ("Errors occurred while setting extended attributes"));
    1698             } else {
    1699                 log_msg(1, "I set xattr OK");
    1700             }
    1701             retval += res;
    1702         }
    1703         if (length_of_file(acl_fname) > 0) {
     1698        if (g_getfattr) {
     1699            log_msg(1, "Setting fattr list %s", xattr_fname);
     1700            if (length_of_file(xattr_fname) > 0) {
     1701                res = set_fattr_list(filelist_subset_fname, xattr_fname);
     1702                if (res) {
     1703                    log_to_screen
     1704                        ("Errors occurred while setting extended attributes");
     1705                } else {
     1706                    log_msg(1, "I set xattr OK");
     1707                }
     1708                retval += res;
     1709            }
     1710        }
     1711        if (g_getfacl) {
    17041712            log_msg(1, "Setting acl list %s", acl_fname);
    1705             res = set_acl_list(filelist_subset_fname, acl_fname);
    1706             if (res) {
    1707                 log_to_screen
    1708                     (_
    1709                      ("Errors occurred while setting access control lists"));
    1710             } else {
    1711                 log_msg(1, "I set ACL OK");
    1712             }
    1713             retval += res;
     1713            if (length_of_file(acl_fname) > 0) {
     1714                res = set_acl_list(filelist_subset_fname, acl_fname);
     1715                if (res) {
     1716                    log_to_screen
     1717                        ("Errors occurred while setting access control lists");
     1718                } else {
     1719                    log_msg(1, "I set ACL OK");
     1720                }
     1721                retval += res;
     1722            }
    17141723        }
    17151724        if (retval) {
     
    18881897        paranoid_system(command);
    18891898
    1890         iamhere("Restoring xattr, acl stuff");
    1891         res = set_fattr_list(filelist_subset_fname, xattr_fname);
    1892         if (res) {
    1893             log_msg(1, "Errors occurred while setting xattr");
    1894         } else {
    1895             log_msg(1, "I set xattr OK");
    1896         }
    1897         retval += res;
    1898 
    1899         res = set_acl_list(filelist_subset_fname, acl_fname);
    1900         if (res) {
    1901             log_msg(1, "Errors occurred while setting ACL");
    1902         } else {
    1903             log_msg(1, "I set ACL OK");
    1904         }
    1905         retval += res;
     1899        if (g_getfattr) {
     1900            iamhere("Restoring xattr stuff");
     1901            res = set_fattr_list(filelist_subset_fname, xattr_fname);
     1902            if (res) {
     1903                log_msg(1, "Errors occurred while setting xattr");
     1904            } else {
     1905                log_msg(1, "I set xattr OK");
     1906            }
     1907            retval += res;
     1908        }
     1909
     1910        if (g_getfacl) {
     1911            iamhere("Restoring acl stuff");
     1912            res = set_acl_list(filelist_subset_fname, acl_fname);
     1913            if (res) {
     1914                log_msg(1, "Errors occurred while setting ACL");
     1915            } else {
     1916                log_msg(1, "I set ACL OK");
     1917            }
     1918            retval += res;
     1919        }
    19061920
    19071921    } else {
     
    20462060    if (fbw) {
    20472061        fclose(fbw);
    2048         mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2049         mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2050         if (length_of_file(acl_fname) > 0) {
    2051             set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    2052         }
    2053         if (length_of_file(xattr_fname) > 0) {
    2054             set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
     2062        if (g_getfattr) {
     2063            mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
     2064            if (length_of_file(xattr_fname) > 0) {
     2065                set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
     2066            }
     2067        }
     2068        if (g_getfacl) {
     2069            mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
     2070            if (length_of_file(acl_fname) > 0) {
     2071                set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     2072            }
    20552073        }
    20562074        mr_free(acl_fname);
     
    22662284
    22672285    mr_asprintf(&tmp, "Reassembling large files      ");
    2268     mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
    2269     mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2286    if (g_getfattr) {
     2287        mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2288    }
     2289    if (g_getfacl) {
     2290        mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, bkpinfo->tmpdir);
     2291    }
    22702292    mvaddstr_and_log_it(g_currentY, 0, tmp);
    22712293    mr_free(tmp);
     
    23522374        if (length_of_file(biggies_whose_EXATs_we_should_set) > 2) {
    23532375            iamhere("Setting biggie-EXATs");
    2354             if (length_of_file(acl_fname) > 0) {
    2355                 log_msg(1, "set_acl_list(%s,%s)",
    2356                         biggies_whose_EXATs_we_should_set, acl_fname);
    2357                 set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    2358             }
    2359             if (length_of_file(xattr_fname) > 0) {
    2360                 log_msg(1, "set_fattr_List(%s,%s)",
     2376            if (g_getfattr) {
     2377                if (length_of_file(xattr_fname) > 0) {
     2378                    log_msg(1, "set_fattr_List(%s,%s)",
    23612379                        biggies_whose_EXATs_we_should_set, xattr_fname);
    2362                 set_fattr_list(biggies_whose_EXATs_we_should_set,
     2380                    set_fattr_list(biggies_whose_EXATs_we_should_set,
    23632381                               xattr_fname);
     2382                }
     2383            }
     2384            if (g_getfacl) {
     2385                if (length_of_file(acl_fname) > 0) {
     2386                    log_msg(1, "set_acl_list(%s,%s)",
     2387                            biggies_whose_EXATs_we_should_set, acl_fname);
     2388                    set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     2389                }
    23642390            }
    23652391        } else {
     
    24542480    while (ctrl_chr != BLK_STOP_AFIOBALLS) {
    24552481        update_progress_form(progress_str);
    2456         mr_asprintf(&xattr_fname, "%s/xattr-subset-%ld.tmp", bkpinfo->tmpdir,
     2482        if (g_getfattr) {
     2483            mr_asprintf(&xattr_fname, "%s/xattr-subset-%ld.tmp", bkpinfo->tmpdir,
    24572484                current_afioball_number);
    2458         mr_asprintf(&acl_fname, "%s/acl-subset-%ld.tmp", bkpinfo->tmpdir,
     2485            unlink(xattr_fname);
     2486        }
     2487        if (g_getfacl) {
     2488            mr_asprintf(&acl_fname, "%s/acl-subset-%ld.tmp", bkpinfo->tmpdir,
    24592489                current_afioball_number);
    2460         unlink(xattr_fname);
    2461         unlink(acl_fname);
     2490            unlink(acl_fname);
     2491        }
    24622492        if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    24632493            iamhere("Reading EXAT files from tape");
     
    25032533        res =
    25042534            read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    2505         unlink(xattr_fname);
    2506         unlink(acl_fname);
     2535        if (g_getfattr) {
     2536            unlink(xattr_fname);
     2537        }
     2538        if (g_getfacl) {
     2539            unlink(acl_fname);
     2540        }
    25072541        mr_free(xattr_fname);
    25082542        mr_free(acl_fname);
  • trunk/mondo/src/mondorestore/mondo-rstr-tools.c

    r914 r956  
    4343
    4444extern int g_partition_table_locked_up;
     45
     46/* Should we use or not extended attributes and acl when restoring */
     47char *g_getfattr = NULL;
     48char *g_getfacl = NULL;
    4549
    4650/**
     
    913917    }
    914918    mr_free(value);
     919
     920    read_cfg_var(cfg_file, "acl", value);
     921    if (strstr(value, "TRUE")) {
     922        asprintf(&g_getfacl,"setfacl");
     923        log_msg(1, "We will restore ACLs");
     924        if (! find_home_of_exe("setfacl")) {
     925            log_msg(1, "Unable to restore ACLs as no setfacl found");
     926        }
     927    }
     928    read_cfg_var(cfg_file, "xattr", value);
     929    if (strstr(value, "TRUE")) {
     930        asprintf(&g_getfattr,"setfattr");
     931        log_msg(1, "We will restore XATTRs");
     932        if (! find_home_of_exe("setfattr")) {
     933            log_msg(1, "Unable to restore XATTRs as no setfattr found");
     934        }
     935    }
    915936
    916937    if (0 == read_cfg_var(cfg_file, "internal-tape-block-size", value)) {
Note: See TracChangeset for help on using the changeset viewer.