Changeset 538 in MondoRescue


Ignore:
Timestamp:
May 13, 2006, 6:39:55 PM (18 years ago)
Author:
bcornec
Message:

Begining of modifications => DOS NOT WORK FOR NOW.
This is done to be merged in trunk. stable will later point back to current 2.0.8 content

Use of mindi conf file in mindi + /var/cache/mindi as a default place
Use of mondo conf file in mondo + separation of messages.
Ultimate goal is to have a cleaner design of files vs functions.

Location:
branches/stable
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/contrib/backup-kungfu/backup-kungfu

    r354 r538  
    6868function remove_garbage {
    6969    echo -e "Removing the files left from previous mondoarchive run...\n"
    70     rm -rf /root/images
     70    rm -rf /var/cache/mondo
    7171    rm -rf ${backup_dir}/mondo*
    7272    rm -rf ${backup_dir}/tmp*
     
    107107    echo -e "Creating the new backup directory and moving the files there...\n"
    108108    mkdir -p ${backup_dir}/${comp_name}_${date}/images
    109     cp /root/images/mindi/* ${backup_dir}/${comp_name}_${date}/images/
     109    cp /var/cache/mindi/* ${backup_dir}/${comp_name}_${date}/images/
    110110   
    111111    # If you want just move the iso files without renaming them just uncomment the next line
  • branches/stable/mindi/distributions/conf/mindi.conf

    r473 r538  
    6464#mindi_kernel="/boot/vmlinuz.special"
    6565
     66# TBC
     67
    6668#
    6769# Additinal modules to support
     
    7072mindi_additional_modules=""
    7173
     74# TBC
     75
    7276#
    7377# Boot loader to use
  • branches/stable/mindi/mindi

    r526 r538  
    7979# TBC
    8080if [ "$mindi_images_dir" == "" ]; then
    81     CACHE_LOC="/var/cache/mindi"
     81    CACHEDIR="/var/cache/mindi"
    8282else
    83     CACHE_LOC="$mindi_images_dir"
     83    CACHEDIR="$mindi_images_dir"
    8484fi
    8585if [ "$mindi_dual_floppies" == "" ]; then
     
    219219Aborted() {
    220220    trap SIGHUP SIGTERM SIGTRAP SIGINT
    221     [ "$imagesdir" != "" ] && rm -f $imagesdir/mindi*img $imagesdir/*gz $imagesdir/mindi.iso
     221    rm -f $CACHEDIR/mindi*img $CACHEDIR/*gz $CACHEDIR/mindi.iso
    222222    [ "$minidir_root" != "" ] && rm -Rf $minidir_root/*
    223223    Die "User abort."
     
    510510    if [ "$?" -ne "0" ] ; then
    511511    umount $mountpoint
    512     Die "Tarball $tarball is too big for disk! (CODI)\nTell Hugo to adjust MAX_COMPRESSED_SIZE"
     512    Die "Tarball $tarball is too big for disk! (CODI)\nTell dev team to adjust MAX_COMPRESSED_SIZE"
    513513    fi
    514514    [ "$diskno" -eq "$noof_disks" ] && echo "This is the last disk ($diskno=$noof_disks)" >> $mountpoint/LAST-DISK
     
    684684    echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
    685685    echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
    686     mkdir -p $CACHE_LOC
     686    mkdir -p $CACHEDIR
    687687}
    688688
     
    16261626
    16271627
    1628 OfferToCopyImagesToDisks() {
    1629     local imagesdir i imagename dev count boot_dev data_dev
    1630     imagesdir=$1
    1631     boot_dev=$2
    1632     data_dev=$3
    1633     echo -en "Would you like to create boot+data floppy disks now (y/n) ?"
    1634     read i
    1635     [ "$i" != "y" ] && [ "$i" != "Y" ] && return
    1636     mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first."
    1637     echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS."
    1638     [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?"
    1639     [ ! -e "$data_dev" ] && Die "Cannot find $data_dev - is your Linux distro broken?"
    1640     i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null`
    1641     j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'`
    1642 #    echo "i=$i"
    1643 #    echo "j=$j"
    1644     if [ "$i" ] ; then
    1645         CopyImageToDisk $j $data_dev "boot disk"
    1646         CopyImageToDisk $i $data_dev "root disk"
    1647     else
    1648         CopyImageToDisk $j $boot_dev "boot/root disk"
    1649     fi
    1650     count=1
    1651     for i in `find $imagesdir | fgrep mindi-data` ; do
    1652         CopyImageToDisk $i $data_dev "data disk #$count"
    1653         count=$(($count+1))
    1654     done
    1655 }
    1656 
    16571628
    16581629
     
    16881659    cp $kernelpath $TMP_ROOT/iso/isolinux/vmlinuz || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/isolinux/vmlinuz). Did you run out of disk space?"
    16891660    cp $TMP_ROOT/mindi.rdz $TMP_ROOT/iso/isolinux/initrd.img
    1690     cp $TMP_ROOT/mindi.rdz $imagesdir/initrd.img
     1661    cp $TMP_ROOT/mindi.rdz $CACHEDIR/initrd.img
    16911662    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
    16921663    cd $TMP_ROOT/iso/isolinux
     
    17091680    fi
    17101681    if [ "$ARCH" != "ia64" ] ; then
    1711         mkisofs -U -J -r -o $imagesdir/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
    1712     else
    1713         mkisofs -J -r -o $imagesdir/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> /tmp/$$.mk
     1682        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
     1683    else
     1684        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
    17141685    fi
    17151686    if [ "$?" -ne "0" ] ; then
     
    17201691    LogIt "Failed to create ISO image.\n"
    17211692    else
    1722     echo "Created bootable ISO image at $imagesdir/mindi.iso" >> $LOGFILE
     1693    echo "Created bootable ISO image at $CACHEDIR/mindi.iso" >> $LOGFILE
    17231694    fi
    17241695    rm -f /tmp/$$.mk
     
    21742145    [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero\n"
    21752146    return $retval
    2176 }
    2177 
    2178 
    2179 
    2180 
    2181 PrepareDataDiskImages() {
    2182     local needlist bigdir minidir_root tardir diskdir imagesdir res i j k old_pwd lines
    2183 
    2184     imagesdir=$1
    2185     rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
    2186     needlist=$TMP_ROOT/what-we-need.txt
    2187     bigdir=$TMP_ROOT/bigdir
    2188     minidir_root=$TMP_ROOT/minidir
    2189     mkdir -p $minidir_root
    2190     mkdir -p $bigdir/usr/bin
    2191     tardir=$TMP_ROOT/tardir
    2192 
    2193     lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | grep -vx "" | wc -l`
    2194     cat $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | GenerateGiantDependencyList $needlist $lines
    2195     res=$?
    2196     if [ "$YOUR_KERNEL_SUCKS" ]; then
    2197     pwd=`pwd`
    2198     cd $TMP_ROOT
    2199         for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    2200         cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
    2201         if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
    2202         cp --parents -pRdf $i $bigdir
    2203         else
    2204         ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
    2205         BIGNO=$(($BIGNO+1))
    2206         fi
    2207     done
    2208     for i in $EXTRA_MODS ; do
    2209         j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null`
    2210         [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE
    2211         for k in $j ; do
    2212         if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
    2213             cp --parents -pRdf $k $bigdir
    2214         else
    2215             ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
    2216             BIGNO=$(($BIGNO+1))
    2217         fi
    2218         echo "Added failsafe module $k to ramdisk" >> $LOGFILE
    2219         done
    2220     done
    2221     cd $pwd
    2222     else
    2223     ListKernelModulePaths >> $needlist
    2224     fi
    2225     if [ "$res" -ne "0" ] ; then
    2226         Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem."
    2227     fi
    2228     FindAndAddUserKeyboardMappingFile
    2229     mkdir -p $bigdir/tmp
    2230     if [ "`DidMondoCallMe`" ] ; then
    2231         MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg
    2232         cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null
    2233         cp -f $TMP_ROOT/mondo-restore.cfg $CACHE_LOC &> /dev/null
    2234     fi
    2235     [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
    2236     DropOptimizedLibraries $needlist $bigdir
    2237     echo -en "Assembling dependency files"
    2238     CopyDependenciesToDirectory < $needlist $bigdir
    2239 
    2240 # also copy io.sys and msdos.sys, if we can find them
    2241     for i in `mount | cut -d' ' -f3` ; do
    2242     for j in io.sys msdos.sys ; do
    2243         [ -e "$i/$j" ] && cp -f $i/$j $bigdir
    2244     done
    2245     done
    2246 
    2247 # master boot record, too
    2248     i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null`
    2249     if [ "$i" ] ; then
    2250     LogIt "Backing up $i's MBR\n"
    2251     dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
    2252 # < < E O F
    2253     sleep 1
    2254     sync
    2255 #        [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE
    2256     j=$i
    2257     [ -h "$j" ] && j=`ResolveSoftlink $j`
    2258     LogIt "Creating /dev/boot_device ($j)\n"
    2259     mkdir -p $bigdir/dev
    2260     cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk"
    2261     fi
    2262 
    2263 # more stuff
    2264 #    cp -f $MINDI_LIB/embleer* $bigdir
    2265     old_pwd=`pwd`
    2266     cd $bigdir
    2267 
    2268     [ -e "$MINDI_LIB/aux-tools" ] || Die "aux-tools not found in Mindi's home dir. Do you have multiple copies of Mindi lying around? Please delete them. No, don't e-mail me and ask how. ;) Use 'rm'."
    2269     cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
    2270     if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then
    2271     tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
    2272     fi
    2273     if [ -e "$MONDO_SHARE/restore-scripts" ] ; then
    2274         cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
    2275         [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
    2276     fi
    2277     [ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
    2278     cd $old_pwd
    2279     echo -e "$DONE"
    2280     TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
    2281     SplitDirectoryIntoMinidirs $bigdir $minidir_root
    2282     noof_disks=$?
    2283     [ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
    2284     MakeMountlist $TMP_ROOT/mountlist.txt
    2285     mkdir -p $minidir_root/$noof_disks/tmp
    2286     cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
    2287     cp -f $TMP_ROOT/mountlist.txt $CACHE_LOC
    2288     [ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
    2289     [ -d "/proc/lvm" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    2290     [ -d "/dev/mapper" ] && $MINDI_LIB/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
    2291     cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
    2292     ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
    2293     CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks
    2294     FRIENDLY_OUTSTRING="Boot and data disk images were created."
    2295 # One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images
    2296     rmdir $tardir $bigdir
    2297     rm -f $needlist
    2298     return $noof_disks
    22992147}
    23002148
     
    29252773    while [ "$diskno" -le "$noof_disks" ] ; do
    29262774        cd $minidir_root/$diskno || LogIt "Warning - cannot cd to $minidir_root/$diskno\n"
    2927         tar -cf - . 2>> $LOGFILE | gzip -9 > $tardir/$diskno.tar.gz || Die "Can't tar/gzip disk#$diskno; please tell Hugo -exactly- what the errors where."
     2775        tar -cf - . 2>> $LOGFILE | gzip -9 > $tardir/$diskno.tar.gz || Die "Can't tar/gzip disk#$diskno; please tell dev team -exactly- what the errors where."
    29282776        diskno=$(($diskno+1))
    29292777        echo -n "..."
     
    29752823if [ "$1" = "-V" ] || [ "$1" = "-v" ] || [ "$1" = "--version" ] || [ "$1" = "-version" ] ; then
    29762824    echo "mindi v$MINDI_VERSION"
     2825    exit 0
     2826fi
     2827
     2828if [ "$1" = "-printvar" ] ; then
     2829    shift
     2830    if [ _"$1" != _"" ] ; then
     2831        set | egrep "^$1" | cut -d= -f2
     2832    fi
    29772833    exit 0
    29782834fi
     
    30262882BIGNO=0
    30272883MAX_COMPRESSED_SIZE=1300
    3028 imagesdir=/root/images/mindi
    3029 mkdir -p $imagesdir
     2884imagesdir=$CACHEDIR
    30302885kernelpath=""
    30312886MONDO_ROOT=/tmp/mindilinux/mondo-root
     
    30622917        exit $?
    30632918    elif [ "$1" = " --version" ] || [ "$1" = "-v" ] ; then
    3064     echo "Mindi v$MINDI_VERSION"
     2919        echo "Mindi v$MINDI_VERSION"
    30652920        exit 0
    30662921    elif [ "$#" -ge "9" ] && [ "$1" = "--custom" ] ; then
    3067     TMP_ROOT=$2
    3068     MONDO_TMP=$2
    3069     imagesdir=$3
    3070     kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
     2922        TMP_ROOT=$2
     2923        MONDO_TMP=$2
     2924        imagesdir=$3
     2925        kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
    30712926###
    30722927### Sq-Modification...
     
    30752930###
    30762931        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    3077     LogIt "kernelname = $kernelname\n"
    3078     LogIt "kernelpath = $kernelpath\n"
     2932        LogIt "kernelname = $kernelname\n"
     2933        LogIt "kernelpath = $kernelpath\n"
    30792934        if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
    30802935        then
     
    30882943### end of Sq-Modification
    30892944###
    3090     TAPEDEV=$5
    3091     TAPESIZE=$6
    3092     FILES_IN_FILELIST=$7
    3093     USE_LZO=$8
    3094     CDRECOVERY=$9
     2945        TAPEDEV=$5
     2946        TAPESIZE=$6
     2947        FILES_IN_FILELIST=$7
     2948        USE_LZO=$8
     2949        CDRECOVERY=$9
    30952950        if [ "${10}" = "(null)" ] || [ "${10}" = "" ] ; then
    30962951            IMAGE_DEVS=""
     
    30982953            IMAGE_DEVS="`echo "${10}" | tr '|' ' '`"
    30992954        fi
    3100     if [ "${11}" ] ; then
    3101         LILO_OPTIONS=""
     2955        if [ "${11}" ] ; then
     2956            LILO_OPTIONS=""
    31022957#       LogIt "LILO will use conservative settings, to be compatible with older BIOSes."
    3103     fi
    3104     LAST_FILELIST_NUMBER=${12}
     2958        fi
     2959        LAST_FILELIST_NUMBER=${12}
    31052960        ESTIMATED_TOTAL_NOOF_SLICES=${13}
    31062961        EXCLUDE_DEVS="${14}"
    31072962        USE_COMP="${15}"
    31082963        USE_LILO="${16}"
    3109     USE_STAR="${17}"
    3110     INTERNAL_TAPE_BLOCK_SIZE="${18}"
     2964        USE_STAR="${17}"
     2965        INTERNAL_TAPE_BLOCK_SIZE="${18}"
    31112966        DIFFERENTIAL="${19}"
    31122967        NOT_BOOT="${20}"
    31132968        [ "$USE_COMP" = "" ] && USE_COMP=yes
    31142969        [ "$NOT_BOOT" = "" ] && NOT_BOOT=no
    3115     [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine.\n"
    3116     [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
     2970        [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine.\n"
     2971        [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
    31172972        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    31182973        if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
     
    31242979           LogIt "Using modules for kernel: ${kernelname}\n"
    31252980        fi
    3126     [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
     2981        [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time"
    31272982        MONDO_ROOT=`echo $imagesdir | sed 's/\(.*\)\/.*/\1/'`
    3128     [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined"
    3129     else
    3130     echo "Syntax: mindi (--custom ....)" >> /dev/stderr
    3131     exit 1
     2983        [ "$MONDO_ROOT" = "" ] && Die "MONDO_ROOT is undefined"
     2984    else
     2985        echo "Syntax: mindi (--custom ....)" >> /dev/stderr
     2986        exit 1
    31322987    fi
    31332988fi
     
    31432998
    31442999
    3145 
    3146 
    3147 #ReplaceIndividualLine /tmp/init `grep -n "#WHOLIVESINAPINEAPPLEUNDERTHESEA#" /tmp/init | cut -d':' -f1` "$RUN_AFTER_INITIAL_BOOT_PHASE"
    3148 #exit 0
    3149 
    3150 
    3151 #ListKernelModules
    3152 #exit 0
    3153 
    3154 
    3155 
    3156 
    31573000[ -e "$iso_cfg_file" ] || Die "Cannot find $iso_cfg_file"
    31583001rm -Rf $TMP_ROOT/mindilinux/*
    31593002TMP_ROOT=$TMP_ROOT/mindilinux/$$
    31603003mkdir -p $TMP_ROOT
    3161 mkdir -p $imagesdir
    31623004if [ ! "`DidMondoCallMe`" ] ; then
    31633005    LogIt "Mindi Linux mini-distro generator v$MINDI_VERSION\n"
    3164     LogIt "Latest Mindi is available from http://mondorescue.berlios.de\n"
     3006    LogIt "Latest Mindi is available from http://www.mondorescue.org\n"
    31653007    LogIt "BusyBox sources are available from http://www.busybox.net\n"
    31663008    LogIt "------------------------------------------------------------------------------"
     
    32043046    fi
    32053047    if [ "$USE_OWN_KERNEL" = "yes" ]; then
    3206     YOUR_KERNEL_SUCKS=""
    3207     kernelpath=`TryToFindKernelPath`
    3208     if [ "$kernelpath" = "" ] ; then
    3209         echo -n "Please enter kernel path : "
    3210         read kernelpath
    3211     fi
    3212     else
    3213     YOUR_KERNEL_SUCKS="That's why you're using mine, dude. :-)"
     3048        YOUR_KERNEL_SUCKS=""
     3049        kernelpath=`TryToFindKernelPath`
     3050        if [ "$kernelpath" = "" ] ; then
     3051            echo -n "Please enter kernel path : "
     3052            read kernelpath
     3053        fi
     3054    else
     3055        YOUR_KERNEL_SUCKS="That's why you're using mine, dude. :-)"
    32143056    fi
    32153057fi
     
    32403082[ "$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."
    32413083
    3242 rm -f /root/images/mindi/{*img,*gz,*iso}
    3243 
    3244 PrepareDataDiskImages $imagesdir
     3084rm -f $CACHEDIR/{*img,*gz,*iso}
     3085
     3086rm -f $imagesdir/mindi-*.img $imagesdir/[0-9]*.tar.gz $imagesdir/mindi.iso
     3087needlist=$TMP_ROOT/what-we-need.txt
     3088bigdir=$TMP_ROOT/bigdir
     3089minidir_root=$TMP_ROOT/minidir
     3090mkdir -p $minidir_root
     3091mkdir -p $bigdir/usr/bin
     3092tardir=$TMP_ROOT/tardir
     3093
     3094lines=`grep -vx " *#.*" $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | grep -vx "" | wc -l`
     3095cat $MINDI_CONF/deplist.txt $DEPLIST_DIR/* | GenerateGiantDependencyList $needlist $lines
     3096res=$?
     3097if [ "$YOUR_KERNEL_SUCKS" ]; then
     3098    pwd=`pwd`
     3099    cd $TMP_ROOT
     3100    for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
     3101        cp --parents -pRdf ./$i $bigdir || Die "PDDI can't cp $i->$bigdir"
     3102        if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
     3103            cp --parents -pRdf $i $bigdir
     3104        else
     3105            ChopUpAndCopyFile $i $bigdir $CHOPSIZE $BIGNO
     3106            BIGNO=$(($BIGNO+1))
     3107        fi
     3108    done
     3109    for i in $EXTRA_MODS ; do
     3110        j=`find lib/modules/$FAILSAFE_KVER -name $i.*o 2> /dev/null`
     3111        [ ! "$j" ] && echo "Warning - cannot find failsafe module $i.o" >> $LOGFILE
     3112        for k in $j ; do
     3113            if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
     3114                    cp --parents -pRdf $k $bigdir
     3115        else
     3116                ChopUpAndCopyFile $k $bigdir $CHOPSIZE $BIGNO
     3117                BIGNO=$(($BIGNO+1))
     3118            fi
     3119            echo "Added failsafe module $k to ramdisk" >> $LOGFILE
     3120        done
     3121    done
     3122    cd $pwd
     3123else
     3124    ListKernelModulePaths >> $needlist
     3125fi
     3126if [ "$res" -ne "0" ] ; then
     3127    Die "You have $res file`PluralOrNot $res` present in dependency list\nbut absent from filesystem."
     3128fi
     3129FindAndAddUserKeyboardMappingFile
     3130mkdir -p $bigdir/tmp
     3131if [ "`DidMondoCallMe`" ] ; then
     3132    MakeMondoConfigFile $TMP_ROOT/mondo-restore.cfg
     3133    cp -f $TMP_ROOT/mondo-restore.cfg $bigdir/tmp &> /dev/null
     3134    cp -f $TMP_ROOT/mondo-restore.cfg $CACHEDIR &> /dev/null
     3135fi
     3136[ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     3137DropOptimizedLibraries $needlist $bigdir
     3138echo -en "Assembling dependency files"
     3139CopyDependenciesToDirectory < $needlist $bigdir
     3140
     3141# also copy io.sys and msdos.sys, if we can find them
     3142for i in `mount | cut -d' ' -f3` ; do
     3143    for j in io.sys msdos.sys ; do
     3144        [ -e "$i/$j" ] && cp -f $i/$j $bigdir
     3145    done
     3146done
     3147
     3148# master boot record, too
     3149i=`cat $MONDO_TMP/BOOTLOADER.DEVICE 2> /dev/null`
     3150if [ "$i" ] ; then
     3151    LogIt "Backing up $i's MBR\n"
     3152    dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
     3153# < < E O F
     3154    sleep 1
     3155    sync
     3156#        [ "$?" -ne "0" ] && echo "Failed to save $i's MBR to bigdir" >> $LOGFILE
     3157    j=$i
     3158    [ -h "$j" ] && j=`ResolveSoftlink $j`
     3159    LogIt "Creating /dev/boot_device ($j)\n"
     3160    mkdir -p $bigdir/dev
     3161    cp -pRdf $j $bigdir/dev/boot_device || Die "Unable to create /dev/boot_device on ramdisk"
     3162fi
     3163
     3164# more stuff
     3165#    cp -f $MINDI_LIB/embleer* $bigdir
     3166old_pwd=`pwd`
     3167cd $bigdir
     3168
     3169[ -e "$MINDI_LIB/aux-tools" ] || Die "aux-tools not found in Mindi's home dir. Do you have multiple copies of Mindi lying around? Please delete them. No, don't e-mail me and ask how. ;) Use 'rm'."
     3170cp -Rdf $MINDI_LIB/aux-tools/* . 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping aux-tools\n"
     3171if [ -e "$MINDI_LIB/x11-tools.tgz" ] ; then
     3172    tar -zxf $MINDI_LIB/x11-tools.tgz 2>> $LOGFILE || LogIt "Warning - error occurred while unzipping x11-tools.tgz\n"
     3173fi
     3174if [ -e "$MONDO_SHARE/restore-scripts" ] ; then
     3175    cp -Rdf $MONDO_SHARE/restore-scripts/* . 2>> $LOGFILE
     3176    [ "$?" -ne "0" ] && [ "`DidMondoCallMe`" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     3177fi
     3178[ -d "/lib/dev-state" ] && cp --parents -pRdf /lib/dev-state .
     3179cd $old_pwd
     3180echo -e "$DONE"
     3181TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
     3182SplitDirectoryIntoMinidirs $bigdir $minidir_root
    32453183noof_disks=$?
     3184[ "$noof_disks" -eq "0" ] && Die "Too much stuff!"
     3185MakeMountlist $TMP_ROOT/mountlist.txt
     3186mkdir -p $minidir_root/$noof_disks/tmp
     3187cp -f $TMP_ROOT/mountlist.txt $minidir_root/$noof_disks/tmp/mountlist.txt || Die "Cannot copy mountlist.txt from $TMP_ROOT to data disk"
     3188cp -f $TMP_ROOT/mountlist.txt $CACHEDIR
     3189[ "`DidMondoCallMe`" ] && cp -f $minidir_root/$noof_disks/tmp/mountlist.txt $MONDO_TMP/.
     3190[ -d "/proc/lvm" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     3191[ -d "/dev/mapper" ] && $MINDI_SBIN/analyze-my-lvm > $minidir_root/$noof_disks/tmp/i-want-my-lvm
     3192cat $minidir_root/$noof_disks/tmp/mountlist.txt >> $LOGFILE
     3193ZipMinidirsIntoTarballs $minidir_root $tardir $noof_disks
     3194CreateDataDiskImagesFromTarballs $tardir $imagesdir $noof_disks
     3195FRIENDLY_OUTSTRING="Boot and data disk images were created."
     3196# One 1.72MB boot disk, one 2.88MB boot disk and $noof_disks data disk images
     3197rmdir $tardir $bigdir
     3198rm -f $needlist
     3199#return $noof_disks
     3200
    32463201ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE))
    32473202rds=$(($ramdisk_size-$((ramdisk_size%4096))))
     
    32883243    [ ! -e "$boot_dev" ] && mknod $boot_dev b 2 60
    32893244    [ ! -e "$boot_dev" ] && boot_dev=/dev/fd0H1722
    3290     [ ! -e "$boot_dev" ] && Die "Oh Lord, will you PLEASE tell the vendor to create the 1.72MB devices in /dev?"
     3245    [ ! -e "$boot_dev" ] && Die "Will you PLEASE tell your distribution maker to create the 1.72MB devices in /dev?"
    32913246    if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then
    3292         OfferToCopyImagesToDisks $imagesdir $boot_dev $FDDEVICE
     3247        echo -en "Would you like to create boot+data floppy disks now (y/n) ?"
     3248        read i
     3249        [ "$i" != "y" ] && [ "$i" != "Y" ] && return
     3250        mount | fgrep /dev/fd > /dev/null && Die "Please unmount your floppies first."
     3251        echo "WARNING! THIS WILL ERASE YOUR FLOPPY DISKS."
     3252        [ ! -e "$boot_dev" ] && Die "Cannot find $boot_dev - is your Linux distro broken?"
     3253        [ ! -e "$FDDEVICE" ] && Die "Cannot find $FDDEVICE - is your Linux distro broken?"
     3254        i=`find $imagesdir -type f | fgrep "/mindi-root.1" 2> /dev/null`
     3255        j=`find $imagesdir -type f | fgrep "/mindi-boot" | egrep -v '2880|5760'`
     3256        if [ "$i" ] ; then
     3257            CopyImageToDisk $j $FDDEVICE "boot disk"
     3258            CopyImageToDisk $i $FDDEVICE "root disk"
     3259        else
     3260            CopyImageToDisk $j $boot_dev "boot/root disk"
     3261        fi
     3262        count=1
     3263        for i in `find $imagesdir | fgrep mindi-data` ; do
     3264            CopyImageToDisk $i $FDDEVICE "data disk #$count"
     3265            count=$(($count+1))
     3266        done
    32933267    fi
    32943268    OfferToMakeBootableISO $imagesdir
    32953269    LogIt "Finished.\n"
    32963270elif [ "$TAPEDEV" ] ; then
    3297     mkdir -p /root/images/mindi
    3298     rm -f /root/images/mindi/{*img,*gz,*iso}
     3271    rm -f $CACHEDIR/{*img,*gz,*iso}
    32993272    OfferToMakeBootableISO $imagesdir
    33003273    if [ -e "$imagesdir/all.tar.gz" ] ; then
     
    33053278else
    33063279    OfferToMakeBootableISO $imagesdir
    3307 fi
    3308 if [ "$imagesdir" != "/root/images/mindi" ] ; then
    3309     for i in `find $imagesdir -maxdepth 1 -name "*.iso" -o -name "*.img"` ; do
    3310     cp -f $i /root/images/mindi || LogIt "[line 3260] Cannot copy $i to /root/images/mindi\n"
    3311     done
    33123280fi
    33133281[ "$TMP_ROOT" != "/tmp" ] && rm -Rf $TMP_ROOT
  • branches/stable/mondo/distributions/conf/mondo.conf

    r532 r538  
    1313# as they will be generated by mondoarchive
    1414#
    15 iso_creation_cmd="/usr/bin/mkisofs"
     15mondo_iso_creation_cmd="/usr/bin/mkisofs"
    1616#iso_creation_cmd="/usr/bin/growisofs"
    1717
     
    2020# do not specify the -o, -c or the -b options, nor the directory to backup
    2121#
    22 iso_creation_options="-J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_"
     22mondo_iso_creation_options="-J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_"
    2323#iso_creation_options="-use-the-force-luke -v  -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_"
    2424
     
    2626# ISO Burning CLI command to use
    2727#
    28 iso_burning_cmd="/usr/bin/cdrecord"
     28mondo_iso_burning_cmd="/usr/bin/cdrecord"
    2929
    3030#
    3131#  ISO Burning CLI command options
    32 iso_burning_options="-eject dev=%s speed=%d fs=24m driveropts=burnfree"
     32mondo_iso_burning_options="-eject dev=%s speed=%d fs=24m driveropts=burnfree"
    3333
    3434#
    3535# ISO Burning Speed (optional)
    3636#
    37 #iso_burning_speed=1
     37#mondo_iso_burning_speed=1
    3838
    3939#
     
    4242# Use 4380 for DVDs, 650 or 700 for CDs
    4343#
    44 media_size=4380
     44mondo_media_size=4380
    4545
    4646#
     
    4949# Use /dev/hdc, /dev/sr0, /dev/st0, ATAPI:0,0,0, ...
    5050#
    51 media_device="/dev/hdc"
     51mondo_media_device="/dev/hdc"
    5252
    5353#
    5454# Is the CD tray manual ? (yes|no)
    5555#
    56 manual_tray=no
     56mondo_manual_tray=no
    5757
    5858#
    5959# Default log level
    6060#
    61 log_level=4
     61mondo_log_level=4
    6262
    6363#
    6464# default prefix for ISO names
    6565#
    66 prefix=mondorescue
     66mondo_prefix=mondorescue
    6767
    6868#
    6969# External tape blocksize
    7070#
    71 external_tape_blocksize=131072
     71mondo_external_tape_blocksize=131072
    7272
    7373#
    7474# Internal tape blocksize
    7575#
    76 internal_tape_blocksize=8192
     76mondo_internal_tape_blocksize=8192
    7777
    7878#
    7979# Size of the slices for biggiefiles
    8080#
    81 slice_size=4096
     81mondo_slice_size=4096
    8282
    8383#
    8484# deplist file used
    8585#
    86 deplist_file="/etc/mondorescue/deplist.txt"
     86mondo_deplist_file="/etc/mondo/deplist.txt"
    8787
    8888#
    8989# Write boot floppies (yes|no) ?
    9090#
    91 write_boot_floppy=no
     91mondo_write_boot_floppy=no
    9292
    9393#
    94 # Write mindi CD (yes|no) ?
     94# Create mindi CD (yes|no) ?
    9595#
    96 write_mindi_cd=no
     96mondo_create_mindi_cd=no
    9797
    9898#
    9999# Kernel to use (NATIVE|FAILSAFE|PATH TO THE KERNEL)
    100100#
    101 mondorescue_kernel="NATIVE"
     101mondo_kernel="NATIVE"
    102102#mondorescue_kernel="/boot/vmlinuz.special"
    103103
    104104#
    105 # Additinal modules to support
     105# Additional modules to support
    106106# (white space separated list of modules)
    107107#
    108 additional_modules=""
     108mondo_additional_modules=""
    109109
    110110#
     
    112112# (GRUB|ELILO|LILO|RAW|NATIVE)
    113113#
    114 boot_loader=NATIVE
     114mondo_boot_loader=NATIVE
    115115
    116116#
    117117# Differential backup or full (yes|no)
    118118#
    119 differential=no
     119mondo_differential=no
    120120
    121121#
    122122# Default compression tool
    123123#
    124 compression_tool="/usr/bin/bzip2"
     124mondo_compression_tool="/usr/bin/bzip2"
    125125
    126126#
    127127# Default compression level
    128128#
    129 compression_level=3
     129mondo_compression_level=3
    130130
    131131#
     
    133133# (white space separated list of paths)
    134134#
    135 exclude_files=""
     135mondo_exclude_files=""
    136136
    137137#
     
    139139# (white space separated list of paths)
    140140#
    141 include_files=""
     141mondo_include_files=""
    142142
    143143#
    144144# Activate semi-graphical mode by default (yes|no)
    145145#
    146 text_mode=no
     146mondo_text_mode=no
    147147
    148148#
     
    150150# (look at -H option in man page)
    151151#
    152 automatic_restore=no
     152mondo_automatic_restore=no
    153153
    154154#
    155155# Scratch directory
    156156#
    157 scratch_dir=""
     157mondo_scratch_dir=""
    158158#scratch_dir="/tmp/mondo/scratch"
    159159
     
    161161# Temporary directory
    162162#
    163 tmp_dir=""
     163mondo_tmp_dir=""
    164164#tmp_dir="/tmp/mondo/tmp"
    165165
     
    167167# Images creation dir
    168168#
    169 images_dir="/var/cache/mondo"
     169mondo_images_dir="/var/cache/mondo"
  • branches/stable/mondo/mondo/common/Makefile.am

    r501 r538  
    99libmondo_a_SOURCES  = libmondo-archive.c libmondo-devices.c libmondo-fifo.c \
    1010                       libmondo-filelist.c libmondo-files.c libmondo-fork.c \
    11                        libmondo-mountlist.c libmondo-raid.c \
     11                       libmondo-mountlist.c libmondo-raid.c libmondo-msg.c \
    1212                       libmondo-stream.c libmondo-string.c libmondo-tools.c \
    1313                       libmondo-verify.c newt-specific.c \
  • branches/stable/mondo/mondo/common/libmondo-archive-EXT.h

    r482 r538  
    1515extern int make_slices_and_images(struct s_bkpinfo *bkpinfo,
    1616                                  char *biggielist_fname);
    17 extern int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile);
     17extern int make_iso_fs(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *destfile);
    1818extern int make_afioballs_and_images(struct s_bkpinfo *bkpinfo);
    1919extern int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...);
  • branches/stable/mondo/mondo/common/libmondo-archive.c

    r501 r538  
    580580 * @ingroup archiveGroup
    581581 */
    582 int backup_data(struct s_bkpinfo *bkpinfo)
     582int backup_data(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
    583583{
    584584    int retval = 0, res = 0;
     
    643643    sprintf(tmp, "rm -f %s/images/*.iso", bkpinfo->scratchdir);
    644644    run_program_and_log_output(tmp, 1);
    645     retval += make_those_afios_phase(bkpinfo);  // backup regular files
     645    retval += make_those_afios_phase(bkpinfo,mrconf);   // backup regular files
    646646    retval += make_those_slices_phase(bkpinfo); // backup BIG files
    647647    retval += do_that_final_phase(bkpinfo); // clean up
     
    10141014    if (!res) {
    10151015        log_to_screen("Boot+data disks were created OK");
    1016         sprintf(command, "mkdir -p /root/images/mindi/");
     1016        sprintf(command, "mkdir -p /var/cache/mindi/");
    10171017        log_msg(2, command);
    10181018        run_program_and_log_output(command, FALSE);
    10191019        sprintf(command,
    1020                 "cp -f %s/images/mindi.iso /root/images/mindi/mondorescue.iso",
     1020                "cp -f %s/images/mindi.iso /var/cache/mindi/mondorescue.iso",
    10211021                bkpinfo->scratchdir);
    10221022        log_msg(2, command);
     
    12521252 * @ingroup MLarchiveGroup
    12531253 */
    1254 int do_that_final_phase(struct s_bkpinfo *bkpinfo)
     1254int do_that_final_phase(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
    12551255{
    12561256
     
    12731273        /* write final ISO */
    12741274    {
    1275         res = write_final_iso_if_necessary(bkpinfo);
     1275        res = write_final_iso_if_necessary(bkpinfo, mrconf);
    12761276        retval += res;
    12771277        if (res) {
     
    15631563 * @return The number of errors encountered (0 for success)
    15641564 */
    1565 int make_afioballs_and_images(struct s_bkpinfo *bkpinfo)
     1565int make_afioballs_and_images(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
    15661566{
    15671567
     
    17071707            } else {
    17081708                res =
    1709                     move_files_to_cd(bkpinfo, storing_filelist_fname,
     1709                    move_files_to_cd(bkpinfo, mrconf, storing_filelist_fname,
    17101710                                     curr_xattr_list_fname,
    17111711                                     curr_acl_list_fname,
     
    17851785 * @return The number of errors encountered (0 for success)
    17861786 */
    1787 int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile)
     1787int make_iso_fs(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *destfile)
    17881788{
    17891789    /*@ int ********************************************** */
     
    20052005#ifdef __IA64__
    20062006                log_msg(1, "IA64 --> elilo");
     2007                asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", mrconf->ia64_boot_size);
    20072008                res = eval_call_to_make_ISO(bkpinfo,
    20082009                                            //-b images/mindi-boot.2880.img
    2009                                             "mkisofs -no-emul-boot -b images/mindi-bootroot."
    2010                                             IA64_BOOT_SIZE
    2011                                             ".img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
     2010                                            tmp2,
    20122011                                            destfile,
    20132012                                            g_current_media_number,
     
    20172016// FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo
    20182017// and add ' .' at end
     2018                paranoid_free(tmp2);
    20192019                log_msg(1, "Non-ia64 --> lilo");
    20202020                res =
     
    21502150 */
    21512151int
    2152 make_slices_and_images(struct s_bkpinfo *bkpinfo, char *biggielist_fname)
     2152make_slices_and_images(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *biggielist_fname)
    21532153{
    21542154
     
    22232223        } else {
    22242224// Call ntfsclone (formerly partimagehack) if it's a /dev entry (i.e. a partition to be imaged)
    2225             log_msg(2, "bigfile_fname = %s", bigfile_fname);
     2225            log_msg(2, "bigfile_fname = '%s'", bigfile_fname);
    22262226            use_ntfsprog = FALSE;
    22272227            if (!strncmp(bigfile_fname, "/dev/", 5)
     
    22692269            }
    22702270            res =
    2271                 slice_up_file_etc(bkpinfo, bigfile_fname,
     2271                slice_up_file_etc(bkpinfo, mrconf, bigfile_fname,
    22722272                                  ntfsprog_fifo, biggie_file_number,
    22732273                                  noof_biggie_files, use_ntfsprog);
     
    23212321 * @see make_afioballs_and_images
    23222322 */
    2323 int make_afioballs_and_images_OLD(struct s_bkpinfo *bkpinfo)
     2323int make_afioballs_and_images_OLD(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
    23242324{
    23252325
     
    24032403        } else {
    24042404            res =
    2405                 move_files_to_cd(bkpinfo, curr_filelist_fname,
     2405                move_files_to_cd(bkpinfo, mrconf, curr_filelist_fname,
    24062406                                 curr_xattr_list_fname,
    24072407                                 curr_acl_list_fname, curr_afioball_fname,
     
    24482448 * @ingroup MLarchiveGroup
    24492449 */
    2450 int make_those_afios_phase(struct s_bkpinfo *bkpinfo)
     2450int make_those_afios_phase(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
    24512451{
    24522452    /*@ int ******************************************* */
     
    24652465        log_msg(1,
    24662466                "Using single-threaded make_afioballs_and_images() to suit b0rken FreeBSD 5.0");
    2467         res = make_afioballs_and_images_OLD(bkpinfo);
     2467        res = make_afioballs_and_images_OLD(bkpinfo, mrconf);
    24682468#else
    2469         res = make_afioballs_and_images_OLD(bkpinfo);
     2469        res = make_afioballs_and_images_OLD(bkpinfo, mrconf);
    24702470#endif
    24712471        write_header_block_to_stream(0, "stop-afioballs",
    24722472                                     BLK_STOP_AFIOBALLS);
    24732473    } else {
    2474         res = make_afioballs_and_images(bkpinfo);
     2474        res = make_afioballs_and_images(bkpinfo, mrconf);
    24752475    }
    24762476
     
    25752575 * transfer files over the network) or leave it as is.
    25762576 */
    2577 int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...) =
     2577int (*move_files_to_cd) (struct s_bkpinfo *, struct s_mrconf *mrconf, char *, ...) =
    25782578    _move_files_to_cd;
    25792579
     
    25962596 * @return The number of errors encountered (0 for success)
    25972597 */
    2598 int _move_files_to_cd(struct s_bkpinfo *bkpinfo, char *files_to_add, ...)
     2598int _move_files_to_cd(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *files_to_add, ...)
    25992599{
    26002600
     
    26352635    }
    26362636    if (would_occupy / 1024 > bkpinfo->media_size[g_current_media_number]) {
    2637         res = write_iso_and_go_on(bkpinfo, FALSE);  /* FALSE because this is not the last CD we'll write */
     2637        res = write_iso_and_go_on(bkpinfo, struct s_mrconf *mrconf, FALSE); /* FALSE because this is not the last CD we'll write */
    26382638        retval += res;
    26392639        if (res) {
     
    26852685 * @c backup_media_type field is used in this function.
    26862686 * @param imagesdir The directory containing the floppy images (usually
    2687  * /root/images/mindi).
     2687 * /var/cache/mindi).
    26882688 *
    26892689 * @return The number of errors encountered (0 for success)
     
    28642864    if (!bkpinfo->nonbootable_backup) {
    28652865#ifdef __FreeBSD__
    2866         if (!does_file_exist("/root/images/mindi/mindi-kern.1722.img"))
     2866        if (!does_file_exist("/var/cache/mindi/mindi-kern.1722.img"))
    28672867#else
    2868         if (!does_file_exist("/root/images/mindi/mindi-bootroot.1722.img")
    2869             && !does_file_exist("/root/images/mindi/mindi-boot.1440.img"))
     2868        if (!does_file_exist("/var/cache/mindi/mindi-bootroot.1722.img")
     2869            && !does_file_exist("/var/cache/mindi/mindi-boot.1440.img")
     2870            && !does_file_exist("/var/cache/mindi/mindi-boot.2880.img")
     2871            && !does_file_exist("/var/cache/mindi/mindi-boot.5760.img"))
    28702872#endif
    28712873        {
    28722874            mvaddstr_and_log_it(g_currentY++, 74, "No Imgs");
    2873             if (does_file_exist("/root/images/mindi/mondorescue.iso")) {
     2875            if (does_file_exist("/var/cache/mindi/mondorescue.iso")) {
    28742876                popup_and_OK
    2875                     ("Boot+data floppy creation failed. However, FYI, you may burn /root/images/mindi/mondorescue.iso to a CD and boot from that instead if you wish.");
     2877                    ("Boot+data floppy creation failed. However, FYI, you may burn /var/cache/mindi/mondorescue.iso to a CD and boot from that instead if you wish.");
    28762878                res++;
    28772879            }
    28782880        } else {
    2879             offer_to_write_floppies(bkpinfo, "/root/images/mindi");
     2881            offer_to_write_floppies(bkpinfo, "/var/cache/mindi");
    28802882            mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    28812883        }
     
    32773279 */
    32783280int
    3279 slice_up_file_etc(struct s_bkpinfo *bkpinfo, char *biggie_filename,
     3281slice_up_file_etc(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *biggie_filename,
    32803282                  char *ntfsprog_fifo, long biggie_file_number,
    32813283                  long noof_biggie_files, bool use_ntfsprog)
     
    34073409    } else {
    34083410        res =
    3409             move_files_to_cd(bkpinfo,
     3411            move_files_to_cd(bkpinfo, mrconf,
    34103412                             slice_fname(biggie_file_number, 0,
    34113413                                         bkpinfo->tmpdir, ""), NULL);
     
    35093511            res = move_files_to_stream(bkpinfo, file_to_archive, NULL);
    35103512        } else {
    3511             res = move_files_to_cd(bkpinfo, file_to_archive, NULL);
     3513            res = move_files_to_cd(bkpinfo, mrconf, file_to_archive, NULL);
    35123514        }
    35133515        retval += res;
     
    36013603 * however, this occurs rarely.
    36023604 */
    3603 int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo)
     3605int write_final_iso_if_necessary(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf)
    36043606{
    36053607    /*@ int ***************************************************** */
     
    36223624    }
    36233625#endif
    3624     res = write_iso_and_go_on(bkpinfo, TRUE);
     3626    res = write_iso_and_go_on(bkpinfo, struct s_mrconf *mrconf, TRUE);
    36253627#ifndef _XWIN
    36263628    if (!g_text_mode) {
     
    36513653 * @see make_iso_fs
    36523654 */
    3653 int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, bool last_cd)
     3655int write_iso_and_go_on(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, bool last_cd)
    36543656{
    36553657    /*@ pointers **************************************************** */
     
    37273729            g_current_media_number);
    37283730    for (that_one_was_ok = FALSE; !that_one_was_ok;) {
    3729         res = make_iso_fs(bkpinfo, isofile);
     3731        res = make_iso_fs(bkpinfo, mrconf, isofile);
    37303732        if (g_current_media_number == 1 && !res
    37313733            && (bkpinfo->backup_media_type == cdr
     
    40294031setenv("MONDO_SHARE", MONDO_SHARE, 1);
    40304032}
     4033
     4034void mrarchive_init_conf(struct s_mrconf *mrconf) {
     4035    char *command = NULL;
     4036    FILE *conffd = NULL;
     4037    FILE *fin = NULL;
     4038    int n = 0;
     4039    char *param = NULL;
     4040
     4041    mrconf = (struct s_mrconf *)malloc(sizeof(struct s_mrconf));
     4042    if (mrconf == NULL) {
     4043            fatal_error("Unable to malloc mrconf");
     4044    }
     4045    /* Default for everything int : 0 char * : NULL */
     4046
     4047    /* mindi conf parameters also needed in mondo */
     4048    mrconf->ia64_boot_size = 0;
     4049
     4050    asprintf(&command, "mindi -printvar IA64_BOOT_SIZE");
     4051    fin = popen(command, "r");
     4052    getline(&param, &n, fin);
     4053    pclose(fin);
     4054    paranoid_free(command);
     4055    mrconf->ia64_boot_size = atoi(param);
     4056    paranoid_free(param);
     4057
     4058    mrconf->iso_creation_cmd = NULL;
     4059
     4060    /* Finds mondo conf file */
     4061    mrconf_open(MONDO_CONF_DIR"/mondo.conf");
     4062
     4063    /* mondo conf parameters needed */
     4064    mrconf->iso_creation_cmd = mrconf_sread(iso_creation_cmd);
     4065
     4066    mrconf_close();
  • branches/stable/mondo/mondo/common/libmondo-archive.h

    r482 r538  
    1717int make_slices_and_images(struct s_bkpinfo *bkpinfo,
    1818                           char *biggielist_fname);
    19 int make_iso_fs(struct s_bkpinfo *bkpinfo, char *destfile);
     19int make_iso_fs(struct s_bkpinfo *bkpinfo, struct s_mrconf *mrconf, char *destfile);
    2020int make_afioballs_and_images(struct s_bkpinfo *bkpinfo);
    2121extern int (*move_files_to_cd) (struct s_bkpinfo *, char *, ...);
  • branches/stable/mondo/mondo/common/libmondo-filelist.c

    r501 r538  
    17051705                       char *userdef_filelist)
    17061706{
    1707     char sz_datefile_wildcard[] = "/var/cache/mondo-archive/difflevel.%d";
     1707    char sz_datefile_wildcard[] = "/var/cache/mondo/difflevel.%d";
    17081708    char *p, *q;
    17091709    char sz_datefile[80];
     
    17741774        sprintf(exclude_paths, " %s %s %s %s %s %s . .. \
    17751775" MNT_CDROM " " MNT_FLOPPY " /media/cdrom /media/cdrecorder \
    1776 /proc /sys /root/images/mondo /root/images/mindi ", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
     1776/proc /sys /tmp /var/cache/mondo /var/cache/mindi", excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
    17771777
    17781778        log_msg(2, "Excluding paths = '%s'", exclude_paths);
  • branches/stable/mondo/mondo/common/libmondo-tools.c

    r501 r538  
    472472#endif
    473473}
    474 
    475 
    476 /**
    477  * Log a trace message to the trace file.
    478  * @bug This function seems orphaned. Please remove.
    479  */
    480 void log_trace(char *o)
    481 {
    482     /*@ pointers **************************************************** */
    483     FILE *fout;
    484 
    485     /*@ buffers ***************************************************** */
    486     char output[MAX_STR_LEN];
    487 
    488     /*@ int    ****************************************************** */
    489     int i;
    490 
    491     /*@ end vars *************************************************** */
    492 
    493     if (o[0] == '\0') {
    494         return;
    495     }
    496     strcpy(output, o);
    497     i = (int) strlen(output);
    498     if (i <= 0) {
    499         return;
    500     }
    501     if (output[i - 1] < 32) {
    502         output[i - 1] = '\0';
    503     }
    504     if (g_text_mode
    505         /* && !strstr(last_line_of_file(MONDO_LOGFILE),output) */ ) {
    506         printf("%s\n", output);
    507     }
    508 
    509     fout = fopen(MONDO_TRACEFILE, "a");
    510     if (fout) {
    511         fprintf(fout, "%s\n", output);
    512         paranoid_fclose(fout);
    513     } else {
    514         log_OS_error("Cannot write to tracefile");
    515     }
    516 }
    517 
    518 
    519 
    520474
    521475
     
    969923        strcpy(bkpinfo->isodir, "/");
    970924    } else {
    971         strcpy(bkpinfo->isodir, "/root/images/mondo");
     925        strcpy(bkpinfo->isodir, "/var/cache/mondo/iso");
    972926    }
    973927    strcpy(bkpinfo->prefix, STD_PREFIX);
     
    10761030#endif
    10771031
    1078     if ((Lres = free_space_on_given_partition("/root")) == -1) {
     1032    if ((Lres = free_space_on_given_partition("/var/cache/mondo")) == -1) /* {
    10791033        Lres = free_space_on_given_partition("/");
    10801034    }
     1035    */
    10811036    log_it("Free space on given partition = %ld MB", Lres);
    10821037
    10831038    if (Lres < 50) {
    1084         run_program_and_log_output
    1085             ("rm -Rf /root/images/mindi; mkdir -p /home/root/images/mindi; mkdir -p /root/images; ln -sf /home/root/images/mindi /root/images/mindi",
    1086              3);
    1087         //      fatal_error("Your / (or /root) partition has <50MB free. Please adjust your partition table to something saner.");
     1039        fatal_error("Your /var/cache/mondo partition has <50MB free. Please adjust your partition table to something saner.");
    10881040    }
    10891041
     
    14911443}
    14921444
    1493 
    1494 /**
    1495  * The standard log_debug_msg() (log_msg() also due to a macro). Writes some describing
    1496  * information to the logfile.
    1497  */
    1498 void standard_log_debug_msg(int debug_level, const char *szFile,
    1499                             const char *szFunction, int nLine,
    1500                             const char *fmt, ...)
    1501 {
    1502     va_list args;
    1503     int i;
    1504     static int depth = 0;
    1505     char *tmp;
    1506     FILE *fout;
    1507 
    1508     if (depth > 5) {
    1509         depth--;
    1510         return;
    1511     }
    1512     depth++;
    1513 
    1514     malloc_string(tmp);
    1515 
    1516     if (debug_level <= g_loglevel) {
    1517         va_start(args, fmt);
    1518         if (!(fout = fopen(MONDO_LOGFILE, "a"))) {
    1519             return;
    1520         }                       // fatal_error("Failed to openout to logfile - sheesh..."); }
    1521 
    1522         // add tabs to distinguish log levels
    1523         if (debug_level > 0) {
    1524             for (i = 1; i < debug_level; i++)
    1525                 fprintf(fout, "\t");
    1526             if (getpid() == g_main_pid)
    1527                 fprintf(fout, "[Main] %s->%s#%d: ", szFile, szFunction,
    1528                         nLine);
    1529             else if (getpid() == g_buffer_pid && g_buffer_pid > 0)
    1530                 fprintf(fout, "[Buff] %s->%s#%d: ", szFile, szFunction,
    1531                         nLine);
    1532             else
    1533                 fprintf(fout, "[TH=%d] %s->%s#%d: ", getpid(), szFile,
    1534                         szFunction, nLine);
    1535         }
    1536         vfprintf(fout, fmt, args);
    1537 
    1538         // do not slow down the progran if standard debug level
    1539         // must be enabled: if no flush, the log won't be up-to-date if there
    1540         // is a segfault
    1541         //if (g_dwDebugLevel != 1)
    1542 
    1543         va_end(args);
    1544         fprintf(fout, "\n");
    1545         paranoid_fclose(fout);
    1546     }
    1547     depth--;
    1548     paranoid_free(tmp);
    1549 }
    1550 
    1551 /**
    1552  * Function pointer to the @c log_debug_msg function to use. Points to standard_log_debug_msg() by default.
    1553  */
    1554 void (*log_debug_msg) (int, const char *, const char *, int, const char *,
    1555                        ...) = standard_log_debug_msg;
    1556 
    1557 
    15581445/**
    15591446 * If @p y, malloc @p x, else free @p x.
     
    15851472        paranoid_free(g_magicdev_command);
    15861473    }
    1587 
    1588     /*
    1589        char**list_of_arrays[] = {
    1590        &g_boot_mountpt,
    1591        &g_mondo_home,
    1592        &g_tmpfs_mountpt,
    1593        &g_erase_tmpdir_and_scratchdir,
    1594        &g_serial_string,
    1595        &g_magicdev_command,
    1596        NULL};
    1597 
    1598        char**ppcurr;
    1599        int i;
    1600 
    1601        for(i=0;list_of_arrays[i];i++)
    1602        {
    1603        log_msg(5, "Allocating %d", i);
    1604        ppcurr = list_of_arrays[i];
    1605        if (mal)
    1606        { *ppcurr = malloc(MAX_STR_LEN); }
    1607        else
    1608        {
    1609        if (*ppcurr)
    1610        {
    1611        free(*ppcurr);
    1612        }
    1613        }
    1614        }
    1615        log_msg(5, "Returning");
    1616      */
    16171474}
    16181475
  • branches/stable/mondo/mondo/common/mondostructures.h

    r514 r538  
    801801    struct s_mdrec el[MAXIMUM_RAID_DEVS];
    802802};
     803
     804struct s_mrconf {
     805    int ia64_boot_size;
     806    char *iso_creation_cmd;
     807};
  • branches/stable/mondo/mondo/common/my-stuff.h

    r511 r538  
    1 /* my-stuff.h
    2    $Id$
    3 .
    4 
    5 
    6 07/14
    7 - ARCH_THREADS is now 2; buffers, 4
    8 
    9 07/10
    10 - added acl, xattr stuff
    11 
    12 06/19
    13 - added AUX_VER
    14 
    15 06/14
    16 - added DO_MBR_PLEASE
    17 
    18 04/17
    19 - replaced INTERNAL_TAPE_BLK_SIZE with g_internal_tape_block_size
    20   and DEFAULT_INTERNAL_TAPE_BLOCK_SIZE
    21 
    22 04/13
    23 - log_msg is now calling standard_log_debug_msg, not the alias (log_debug_msg)
    24 
    25 04/03/2004
    26 - added star and SELINUX support
    27 
    28 11/20/2003
    29 - boot from isolinux.bin, not mindi-boot.2880.img
    30 
    31 11/15
    32 - reduced SLICE_SIZE from 8192 to 4096
    33 
    34 10/08
    35 - set p-i-h volsize to 1GB
    36 
    37 10/21
    38 - added MNT_CDROM and FREELOADER
    39 
    40 10/11
    41 - added DEFAULT_DVD_DISK_SIZE
    42 - added PARTIMAGE_DEBUG_LEVEL
    43 
    44 09/27
    45 - better logging
    46 
    47 09/24
    48 - added MR_LOGFILE="/tmp/mondo-restore.log"
    49 
    50 09/22
    51 - added bool, FALSE, TRUE
    52 
    53 09/20
    54 - increasd PPCFG_RAMDISK_SIZE to 150
    55 
    56 09/12
    57 - reduced MAX_STR_LEN from 512 to 460
    58 
    59 09/10
    60 - moved PPCFG_RAMDISK_SIZE here
    61 
    62 09/05
    63 - better config.h stuff
    64 
    65 06/05
    66 - changed fgrep to grep
    67 
    68 05/19
    69 - added CP_BIN
    70 
    71 05/05
    72 - added #include <sys/param.h> and sys/sem.h and ioctl.h
    73 
    74 05/03
    75 - added kill_anything_like_this()
    76 
    77 04/24/2003
    78 - added *STUB #define's
    79 
    80 11/22/2002
    81 - added INTERNAL_TAPE_BLK_SIZE
    82 
    83 10/10
    84 - use #define to create XMondo-friendly log file name if appropriate
    85 
    86 08/30
    87 - changed ARBITRARY_MAXIMUM to 512
    88 
    89 08/26
    90 - set MAX_STR_LEN at 512 but halved it within many _structures_
    91 - changed ARBITRARY_MAXIMUM to 128
    92 
    93 08/08
    94 - added '#include <signal.h>'
    95 - added WELCOME_STRING
    96 
    97 06/19
    98 - changed tape block size from 8192 to 65536
    99 
    100 04/08
    101 - added manual_cd_tray flag to bkpinfo
    102 
    103 03/31
    104 - added restore_path to struct s_bkpinfo
    105 
    106 03/21
    107 - updated version# to 1.42
    108 
    109 02/20
    110 - added bkpinfo->using_cdstream
    111 
    112 02/06
    113 - added MONDO_VERSION
    114 
    115 02/02
    116 - added MONDO_CFG_FILE
    117 - added SLICE_SIZE
    118 
    119 01/31
    120 - removed MINDI_HOME: it is unnecessary
    121 - replaced MONDO_HOME with variable g_mondo_home
    122 
    123 01/25
    124 - added MONDO_HOME, MINDI_HOME
    125 
    126 01/21
    127 - added s_node{} structure
    128 
    129 01/17
    130 - added sys/shm.h, types.h, ipc.h
    131 
    132 01/02/2002
    133 - added that groovy bkpinfo{} stuff
    134 
    135 11/29/2001
    136 - added raidlist{} struct
    137 
    138 08/27
    139 - stuff
     1/*
     2 * Common defines across the project
     3 *
     4 *  $Id$
     5 */
     6
     7#ifndef _MY_STUFF_H_
     8#define _MY_STUFF_H_
     9
     10/* BERLIOS
     11#define HAVE_MALLOC 1
    14012*/
    141 
    142 #define HAVE_MALLOC 1
    143 
    14413
    14514// Extra info for ACLs and SELINUX users
     
    15827 * Create the illusion of a Boolean type.
    15928 */
    160 #define bool int
     29#define bool unsigned char
    16130#define TRUE 1
    16231#define FALSE 0
    16332#endif
    16433
    165 #ifndef _MY_STUFF_H_
    166 #define _MY_STUFF_H_
    167 
     34/* BERLIOS
    16835#ifdef HAVE_CONFIG_H
    16936#include <config.h>
    17037#endif
     38*/
    17139
    17240#ifndef __FreeBSD__
     
    18149#include <stdio.h>
    18250#include <stdlib.h>
     51/* BERLIOS
    18352#ifndef  __USE_FILE_OFFSET64
    18453#define  __USE_FILE_OFFSET64
     
    18756#define  __USE_LARGEFILE64
    18857#endif
     58*/
    18959#include <sys/stat.h>
    19060#include <fcntl.h>
     
    19666#include <unistd.h>
    19767#include <signal.h>
    198 //#include <curses.h>
    19968#include <newt.h>
    20069#include <ctype.h>
     
    20372#include <assert.h>
    20473
    205 #include "../../config.h"
    206 
     74/*
    20775#if defined(DEBUG) && !__cplusplus
    20876int count;
    209 char trace_log[255];            /*buffer for logging */
     77char trace_log[255];
    21078char *trace_log_ptr;
    211 #endif                          /* DEBUG */
    212 
    213 #define IA64_BOOT_SIZE "8192"   /* Should be coherent with mindi */
    214 #define STD_PREFIX "mondorescue"    /* Should be coherent with mindi */
     79#endif
     80*/
     81
     82#define STD_PREFIX "mondorescue"
    21583
    21684/**
     
    255123#define CRC_M16 0xA001          ///< Mask for crc16.
    256124#define CRC_MTT 0x1021          ///< Mask for crc-ccitt.
    257 
    258 #define FALSE 0                 ///< The ubiquitous FALSE macro.
    259 #define TRUE 1                  ///< The even more ubiquitous TRUE macro.
    260125
    261126#define SCREEN_LENGTH 25        ///< The default size of the screen.
  • branches/stable/mondo/mondo/mondoarchive/main.c

    r497 r538  
    247247{
    248248    struct s_bkpinfo *bkpinfo;
     249    struct s_mrconf *mrconf;
    249250    char *tmp;
    250251    int res, retval;
     
    275276    malloc_string(say_at_end);
    276277
     278    /* Initialize Configuration Structure */
     279    mrarchive_init_conf(mrconf);
     280
    277281    res = 0;
    278282    retval = 0;
     
    457461      finish(0);
    458462*/
    459         res = backup_data(bkpinfo);
     463        res = backup_data(bkpinfo, mrconf);
    460464        retval += res;
    461465        if (res) {
     
    497501    }
    498502
    499     if (does_file_exist("/root/images/mindi/mondorescue.iso")) {
     503    if (does_file_exist("/var/cache/mindi/mondorescue.iso")) {
    500504        log_to_screen
    501             (_("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it."));
     505            (_("/var/cache/mindi/mondorescue.iso, a boot/utility CD, is available if you want it."));
    502506    }
    503507
  • branches/stable/mondo/mondo/mondoarchive/mondo-cli.c

    r520 r538  
    247247        flag_set[i] = FALSE;
    248248    }
    249     //  strcpy (bkpinfo->tmpdir, "/root/images/mondo");
    250     //  strcpy (bkpinfo->scratchdir, "/home");
    251249    for (j = 1; j <= MAX_NOOF_MEDIA; j++) {
    252250        bkpinfo->media_size[j] = 650;
  • branches/stable/mondo/mondo/mondorestore/mondo-rstr-newt.c

    r497 r538  
    23282328 * @param isodir_device Where to put the device (e.g. /dev/hda4) the user enters.
    23292329 * @param isodir_format Where to put the format (e.g. ext2) the user enters.
    2330  * @param isodir_path Where to put the path (e.g. /root/images/mondo) the user enters.
     2330 * @param isodir_path Where to put the path (e.g. /var/cache/mondo) the user enters.
    23312331 * @param nuke_me_please Whether we're planning on nuking or not.
    23322332 * @return TRUE if OK was pressed, FALSE otherwise.
  • branches/stable/mondo/po/fr.po

    r501 r538  
    13141314#: mondo/mondoarchive/main.c:501
    13151315msgid ""
    1316 "/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you "
     1316"/var/cache/mindi/mondorescue.iso, a boot/utility CD, is available if you "
    13171317"want it."
    13181318msgstr ""
    1319 "/root/images/mindi/mondorescue.iso est un CD de boot/utilitaires à votre "
     1319"/var/cache/mindi/mondorescue.iso est un CD de boot/utilitaires à votre "
    13201320"disposition"
    13211321
Note: See TracChangeset for help on using the changeset viewer.