Changeset 2963 in MondoRescue for branches/3.0/mindi/mindi


Ignore:
Timestamp:
Mar 11, 2012, 4:13:48 PM (12 years ago)
Author:
Bruno Cornec
Message:
  • Use LogFile everywhere possible as a echo replacement.
  • Improve logging info type with labels.
  • Fix #590 by adding a warning in case of McAfee detection, and checking tar files before their copy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/mindi

    r2958 r2963  
    117117fi
    118118
    119 # Last function called before exiting
    120 # Parameter is exit code value
    121 # Should be declared here as used immediately below potentialy
    122 MindiExit() {
    123     echo "Mindi $MINDI_VERSION is exiting" >> $LOGFILE
    124     echo "End date : `date`" >> $LOGFILE
    125     if [ _"$MONDO_SHARE" != _"" ] ; then
    126         echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log
    127         cat $LOGFILE >> /var/log/mondoarchive.log
    128         echo "--------------------------------------------------------------">> /var/log/mondoarchive.log
    129     fi
    130 
    131     cd /
    132     sync&
    133 
    134     # Clean temporary files only when standalone mindi
    135     if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then
    136         rm -Rf $MINDI_TMP
    137     fi
    138     exit $1
    139 }
    140 
    141 LogOnly() {
    142     echo -e "$1" >> $LOGFILE
    143     if [ _"$2" != _"" ]; then
    144         grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
    145     fi
    146     rm -f "$2"
    147 }
    148119
    149120# Function to log on screen only
     
    177148}
    178149
     150# Last function called before exiting
     151# Parameter is exit code value
     152# Should be declared here as used immediately below potentialy
     153MindiExit() {
     154    LogFile "Mindi $MINDI_VERSION is exiting" >> $LOGFILE
     155    LogFile "End date : `date`" >> $LOGFILE
     156    if [ _"$MONDO_SHARE" != _"" ] ; then
     157        echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log
     158        cat $LOGFILE >> /var/log/mondoarchive.log
     159        echo "--------------------------------------------------------------">> /var/log/mondoarchive.log
     160    fi
     161
     162    cd /
     163    sync&
     164
     165    # Clean temporary files only when standalone mindi
     166    if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then
     167        rm -Rf $MINDI_TMP
     168    fi
     169    exit $1
     170}
    179171
    180172Die() {
     
    238230    [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)"
    239231    if [ -e "$bigdir/$mappath" ] ; then
    240         echo "$mappath already added" >> $LOGFILE
     232        LogFile "$mappath already added" >> $LOGFILE
    241233        return
    242234    elif [ -d "$bigdir/$mappath" ] ; then
     
    244236        return
    245237    fi
    246     echo "Added kbd map $mappath" >> $LOGFILE
     238    LogFile "Added kbd map $mappath" >> $LOGFILE
    247239    if [ ! -e "$mappath" ] ; then
    248240            mappath=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"`
    249241        if [ ! -e "$mappath" ] ; then
    250             LogIt "Cannot add $mappath: kbd map file not found"
     242            LogIt "WARNING: Cannot add $mappath: kbd map file not found"
    251243            return
    252244        fi
     
    256248
    257249    mkdir -p $bigdir/etc
    258     tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
     250    tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "WARNING: AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
    259251    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    260252        included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     
    285277        # Non absolute file names should not arrive till here => skipped
    286278        if [ `echo "$incoming" | cut -c1` != '/' ]; then
    287             LogIt "Unable to handle $incoming"
     279            LogIt "WARNING: Unable to handle $incoming"
    288280            incoming=`ReadLine`
    289281            continue
     
    303295            # Only uncompress modules if not using udevd
    304296            if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    305                 gunzip -f $outdir/$incoming || LogIt "Cannot gunzip $outdir/$incoming"
     297                gunzip -f $outdir/$incoming || LogIt "WARNING: Cannot gunzip $outdir/$incoming"
    306298            fi
    307299            [ -x "$outdir" ] && StripExecutable $outdir "-$filename-"
     
    342334        vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
    343335        echo "$vanilla_lib_name" >> $filelist
    344         echo "Adding $vanilla_lib_name to filelist" >> $LOGFILE
     336        LogFile "INFO: Adding $vanilla_lib_name to filelist"
    345337        mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null
    346338        rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null
     
    348340        # This may return multiple files
    349341        for resolved in `ReadAllLink $vanilla_lib_name`; do
    350             echo "Adding as deps $resolved to filelist" >> $LOGFILE
     342            LogFile "INFO: Adding as deps $resolved to filelist"
    351343            vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
    352344            mkdir -p $outdir$resolved> /dev/null 2> /dev/null
    353345            rmdir $outdir$resolved > /dev/null 2> /dev/null
    354346            ln -sf $vanilla_resolved_name $outdir$resolved
    355             echo "Excluding deps $resolved" >> $LOGFILE
     347            LogFile "INFO: Excluding deps $resolved"
    356348            grep -Fvx "$resolved" "$filelist" > $filelist.tmp
    357             echo "Replacing it with $vanilla_resolved_name" >> $LOGFILE
     349            LogFile "INFO: Replacing it with $vanilla_resolved_name"
    358350            echo "$vanilla_resolved_name" >> $filelist.tmp
    359351            mv -f $filelist.tmp $filelist
     
    368360FindAndAddUserKeyboardMappingFile() {
    369361    local r res mapfile mappath included_item included_list keyfile mp locale
    370     LogIt "Analyzing your keyboard's configuration."
     362    LogIt "INFO: Analyzing your keyboard's configuration."
    371363    KEYDIR=/lib/kbd
    372364    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd     # Slackware
     
    376368    [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup
    377369    if [ ! -e "$KEYDIR" ] ; then
    378         LogIt "Keyboard mapping directory not found. I shall use default map at boot-time."
     370        LogIt "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time."
    379371        return 0
    380372    fi
    381373    if [ -e "/etc/sysconfig/keyboard" ] ; then
    382         echo "Red Hat-style config detected." >> $LOGFILE
     374        LogFile "INFO: Red Hat-style config detected."
    383375        keyfile=/etc/sysconfig/keyboard
    384376    elif [ -e "/etc/rc.d/rc.keymap" ] ; then
    385         echo "Slackware-style config detected." >> $LOGFILE
     377        LogFile "INFO: Slackware-style config detected."
    386378        keyfile=/etc/rc.d/rc.keymap
    387379    elif [ -e "/etc/rc.config" ] ; then
    388         echo "Debian-style config detected." >> $LOGFILE
     380        LogFile "INFO: Debian-style config detected."
    389381        keyfile=/etc/rc.config
    390382    elif [ -e "/etc/console/boottime.kmap.gz" ] ; then
    391         echo "Debian-style config detected." >> $LOGFILE
     383        LogFile "INFO: Debian-style config detected."
    392384        echo -en "Adding the following keyboard mapping tables: "
    393385        mkdir -p $bigdir/tmp
     
    400392        return 0
    401393    elif [ -e "/etc/console-setup/boottime.kmap.gz" ] || [ -e "/etc/console-setup/cached.kmap.gz" ] ; then
    402         echo "Ubuntu-style config detected." >> $LOGFILE
     394        LogFile "INFO: Ubuntu-style config detected."
    403395        echo -en "Adding the following keyboard mapping tables: "
    404396        mkdir -p $bigdir/tmp
     
    416408        return 0
    417409    elif [ -e "/etc/rc.conf" ] ; then
    418         echo "ArchLinux config detected." >> $LOGFILE
     410        LogFile "INFO: ArchLinux config detected."
    419411        keyfile=/etc/rc.conf
    420412    elif [ -e "/etc/conf.d/keymaps" ] ; then
    421         echo "Gentoo-style config detected." >> $LOGFILE
     413        LogFile "INFO: Gentoo-style config detected."
    422414        keyfile=/etc/conf.d/keymaps
    423415    else
     
    425417        keyfile=`find /etc -name rc.config | head -n1`
    426418        if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then
    427             LogIt "Unknown config detected. Default keyboard map will be used."
     419            LogIt "WARNING: Unknown config detected. Default keyboard map will be used."
    428420            return
    429421        else
    430             echo "Found $keyfile" >> $LOGFILE
     422            LogFile "INFO: Found $keyfile"
    431423        fi
    432424    fi
    433425    if [ ! -e "$KEYDIR/keymaps" ] ; then
    434         LogIt "Keyboard mapping directory not found. Default keyboard map will be used."
     426        LogIt "WARNING: Keyboard mapping directory not found. Default keyboard map will be used."
    435427        return
    436428    fi
    437     echo "keyfile=$keyfile" >> $LOGFILE
     429    LogFile "INFO: keyfile=$keyfile"
    438430    locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`
    439431    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    440432    [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | tr -d '"' |cut -d'=' -f2`        # Gentoo & ArchLinux
    441     echo "locale=$locale" >> $LOGFILE
     433    LogFile "INFO: locale=$locale"
    442434    #
    443435    # Process the keymaps dir once for all
     
    450442    echo "$mp" | grep -q " "
    451443    if [ $? -eq 0 ]; then
    452         echo "WARNING: Multiple keymaps found: $mp" | tee -a $LOGFILE
    453         echo "The following one will be used" >> $LOGFILE
     444        LogAll "WARNING: Multiple keymaps found: $mp"
     445        LogFile "INFO: The following one will be used"
    454446    fi
    455447    for i in $mp ; do
     
    460452        mappath=$(find / -wholename "*/kbd/keymaps/*/$locale | head -1")
    461453    fi
    462     echo "mappath = $mappath" >> $LOGFILE
     454    LogFile "INFO: mappath = $mappath"
    463455    if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then
    464         LogIt "Keyboard mapping file not found. Default keyboard map will be used."
     456        LogIt "WARNING: Keyboard mapping file not found. Default keyboard map will be used."
    465457        return
    466458    fi
     
    486478    [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"`
    487479    [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml"
    488     LogFile "Found mboot.c32 at $MBOOTC32"
     480    LogFile "INFO: Found mboot.c32 at $MBOOTC32"
    489481}
    490482
     
    498490    [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"`
    499491    [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml"
    500     echo "Found isolinux.bin at $ISOLINUX" >> $LOGFILE
     492    LogFile "INFO: Found isolinux.bin at $ISOLINUX"
    501493}
    502494
     
    543535        filelist=`GenerateListForFile "$incoming"`
    544536        r=$?
    545         [ "$r" -ne "0" ] && LogIt "$incoming not found"
     537        [ "$r" -ne "0" ] && LogIt "WARNING: $incoming not found"
    546538        res=$(($res+$r))
    547 #       echo "'$incoming' generates filelist '$filelist'" >> $LOGFILE
     539#       LogFile "INFO: '$incoming' generates filelist '$filelist'"
    548540        for fname in $filelist ; do
    549541            [ "$fname" != "" ] && echo "$fname" >> $tempfile
     
    630622    progress=0
    631623    noof_lines=`cat $tempfile | wc -l`
    632     echo "---------------------------------" >> $LOGFILE
    633     echo "List of dependencies:             " >> $LOGFILE
    634     echo "---------------------------------" >> $LOGFILE
     624    LogFile "---------------------------------"
     625    LogFile "List of dependencies:             "
     626    LogFile "---------------------------------"
    635627    for fname in `cat $tempfile` ; do
    636628        echo "$fname" | tee -a $LOGFILE >> $outfile.pre
     
    653645        mkdir -p $bigdir/bin
    654646        if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then
    655             LogIt "\nIncorporating post-nuke tarball"
     647            LogIt "\nINFO: Incorporating post-nuke tarball"
    656648            old_pwd=`pwd`
    657649            cd "$bigdir"
    658             tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogIt "Error occurred when untarring post-nuke tarball" $MINDI_TMP/$$.log
     650            tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogIt "ERROR: when untarring post-nuke tarball" $MINDI_TMP/$$.log
    659651            cd "$old_pwd"
    660652        fi
     
    662654            LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre
    663655        else
    664             LogIt "Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP"
    665             LogIt "I bet you've got a spare copy of Mondo or Mindi floating around on your system."
    666             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."
     656            LogIt "ERROR: Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP"
     657            LogIt "       I bet you've got a spare copy of Mondo or Mindi floating around on your system."
     658            LogIt "       If Mindi was called by Mondo then send me a bug report."
     659            LogIt "       It not, type 'ps ax' to see which Mondo-related process is still running then kill it. :-)"
     660            LogIt "       Finally, run Mindi again."
    667661            Die "Odd."
    668662        fi
    669         cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW."
     663        cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nINFO: Mondo v1.2x defaults to LILO as the bootloader, BTW."
    670664        if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
    671             LogIt "\nIncorporating Network-related settings"
     665            LogIt "\nINFO: Incorporating Network-related settings"
    672666            for r in NETFS-* ISO-PREFIX ; do
    673667                cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?"
    674                 echo "Copying $r to ramdisk" >> $LOGFILE
     668                LogFile "INFO: Copying $r to ramdisk"
    675669            done
    676670        fi
     
    747741
    748742    # say where we are.
    749     echo "  GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage" >> $LOGFILE
     743    LogFile "INFO:   GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"
    750744
    751745    # verify that file exists
     
    775769    fi
    776770    # say what we are using
    777     echo "  GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem.\n" >> $LOGFILE
     771    LogFile "INFO:   GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem."
    778772
    779773    # return file system to use
     
    877871            [ -f "$r" ] && echo "$r"
    878872        fi
    879         echo "module $module --> $r" >> $LOGFILE
     873        LogFile "INFO: module $module --> $r"
    880874    done
    881875    find /lib/modules/$kern/modules.* -type f 2> /dev/null
     
    891885    for fname in $incoming ; do
    892886        if [ ! -e "$fname" ] ; then
    893             echo "WARNING - $fname does not exist; cannot be LDD'd." >> $LOGFILE
     887            LogFile "WARNING - $fname does not exist; cannot be LDD'd."
    894888            if echo $fname | grep lvm &> /dev/null ; then
    895                 echo "This warning only affects you if you are using LVM." >> $LOGFILE
     889                LogFile "          This warning only affects you if you are using LVM."
    896890                if echo "$MODULES" | grep lvm &> /dev/null ; then
    897                     echo "I think you are, so please take heed!" >> $LOGFILE
     891                    LogFile "          I think you are, so please take heed!"
    898892                else
    899                     echo "I don't think you are, so don't worry about it." >> $LOGFILE
     893                    LogFile "          I don't think you are, so don't worry about it."
    900894                fi
    901895            fi
    902896        elif [ -h "$fname" ] && [ -x "$fname" ] ; then
    903             echo "$fname is softlink" >> $LOGFILE
     897            LogFile "INFO: $fname is softlink"
    904898        else
    905899            ldd $fname 2> /dev/null | ProcessLDD
     
    10371031absolute_partition old_partition_fmt current_lvolume uname skip
    10381032
    1039     echo "Your raw fstab file looks like this:" >> $LOGFILE
    1040     echo "------------------------------------" >> $LOGFILE
     1033    LogFile "Your raw fstab file looks like this:"
     1034    LogFile "------------------------------------"
    10411035    cat $MY_FSTAB >> $LOGFILE
    1042     echo "Your mountlist will look like this:" | tee -a $LOGFILE
    1043     echo "-----------------------------------" >> $LOGFILE
     1036    LogAll "Your mountlist will look like this:"
     1037    LogFile "-----------------------------------"
    10441038
    10451039# mountlist(OUT)
     
    12701264            for d in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    12711265                if  [ "`echo " $list_of_devices " | grep " $d"`" != "" ]; then
    1272                     echo "Excluding $current_partition from mountlist (due to excluded device $d)" >> $LOGFILE
     1266                    LogFile "INFO: Excluding $current_partition from mountlist (due to excluded device $d)"
    12731267                    skip=1
    12741268                    continue
     
    12991293            echo $current_lvolume | grep -q ' '
    13001294            if [ $? -eq 0 ]; then
    1301                 echo "WARNING: Multiple Logical Volumes found. Report to dev team" >> $LOGFILE 
     1295                LogFile "WARNING: Multiple Logical Volumes found. Report to dev team"
    13021296            fi
    13031297            # if it's not found, it may well be a real device such as a multipath one
     
    13311325                    [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
    13321326                    [ "$partition_size" -lt "125000" ] && partition_size=125000
    1333                     echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE
     1327                    LogFile "INFO: I'm guessing $c_p is $(($partition_size/1024))MB"
    13341328                fi
    13351329            else
     
    13511345        fi
    13521346        psz=$partition_size
    1353         echo "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" >> $LOGFILE
     1347        LogFile "INFO: Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)"
    13541348        [ "$psz" != "lvm" ] && psz=$(($psz/1024))
    13551349        if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then
     
    13591353            partition_size=$(($partition_size+1)); # just in case
    13601354            if [ "$partition_format" = "Linux" ] ; then
    1361                 echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE
    1362                 echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE
     1355                LogFile "WARNING: Are you imaging a mounted swap partition? Silly..."
     1356                LogFile "WARNING: Reverting format from $old_partition_fmt to $partition_format"
    13631357                partition_format=$old_partition_fmt
    13641358            fi
     
    13661360
    13671361        if [ ! "$partition_mountpt" ] ; then
    1368             echo "------- $FDISK -l $qq log ------------" >> $LOGFILE
     1362            LogFile "------- $FDISK -l $qq log ------------"
    13691363            for qq in "" `find /dev/ida/c*d* ! -name '*p*' 2> /dev/null`; do
    13701364                partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`
    13711365                [ "$partition_format" ] && break
    13721366            done
    1373             echo "------- $FDISK log end ------------" >> $LOGFILE
     1367            LogFile "------- $FDISK log end ------------"
    13741368            if [ "$partition_format" = "Compaq diagnostics" ] ; then
    13751369                partition_format="compaq"
    13761370            elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    1377                 LogIt "Unable to find mountpoint of $current_partition - ignoring"
     1371                LogIt "WARNING: Unable to find mountpoint of $current_partition - ignoring"
    13781372                continue
    13791373            fi
     
    13881382        unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"`
    13891383        if [ "$current_partition" = "" ] ; then
    1390             echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE
     1384            LogFile "WARNING: Unknown partition (outstring = $unofficial_outstring)"
    13911385        elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then
    13921386            if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then
     
    13961390                printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist
    13971391            else
    1398                 echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE
     1392                LogFile "WARNING: Unknown mountpoint (outstring = $unofficial_outstring)"
    13991393            fi
    14001394        elif [ "$partition_format" = "" ] ; then
    1401             echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE
     1395            LogFile "WARNING: Unknown format (outstring = $unofficial_outstring)"
    14021396        elif [ "$partition_size" = "" ] ; then
    1403             echo "Unknown partition size (outstring = $unofficial_outstring)" >> $LOGFILE
     1397            LogFile "WARNING: Unknown partition size (outstring = $unofficial_outstring)"
    14041398        elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then
    14051399            continue
    14061400        else
    14071401            if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then
    1408                     echo "vfat should be used instead of dos/msdos as a partition format" >> $LOGFILE
     1402                LogFile "WARNING: vfat should be used instead of dos/msdos as a partition format"
    14091403                partition_format="vfat"
    14101404            fi
     
    14231417    ML2=`grep -v ' lvm ' $file | $AWK '{print $2}' | sort -u | wc -l`
    14241418    if [ "$ML01" -ne "$ML1" ]; then
    1425         echo "--------------------------------------------" >> $LOGFILE
    1426         echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE
    1427         echo "--------------------------------------------" >> $LOGFILE
     1419        LogFile "--------------------------------------------"
     1420        LagAll "WARNING: Duplicate device entry in mountlist"
     1421        LogFile "--------------------------------------------"
    14281422    fi
    14291423    if [ "$ML02" -ne "$ML2" ]; then
    1430         echo "--------------------------------------------" >> $LOGFILE
    1431         echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE
    1432         echo "------------------------------------------------" >> $LOGFILE
     1424        LogFile "--------------------------------------------"
     1425        LogAll "WARNING: Duplicate mountpoint entry in mountlist"
     1426        LogFile "------------------------------------------------"
    14331427    fi
    14341428}
     
    14461440    local i old_pwd
    14471441    if [ -z "$ISO_CMD" ]; then
    1448         LogIt "Neither mkisofs nor genisoimage found, unable to make CD image"
     1442        LogIt "ERROR: Neither mkisofs nor genisoimage found, unable to make CD image"
    14491443        return
    14501444    fi
     
    14561450    rm -Rf $MINDI_TMP/iso
    14571451    mkdir -p $MINDI_TMP/iso/{images,archives}
    1458     cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"
    1459     echo "mindi_lib = $MINDI_LIB" >> $LOGFILE
     1452    cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogIt "WARNING: OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"
     1453    LogFile "INFO: mindi_lib = $MINDI_LIB"
    14601454    for i in memdisk memtest.bin memtest.img ; do
    14611455        j=$MINDI_LIB/$i
    14621456        k=$MINDI_TMP/iso
    14631457        if [ -e "$j" ] ; then
    1464             LogIt "Copying $j to $k"
     1458            LogIt "INFO: Copying $j to $k"
    14651459            cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k"
    14661460            cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP"
     
    15051499    fi
    15061500    if [ "$?" -ne "0" ] ; then
    1507         echo "----------- $ISO_CMD's errors --------------" >> $LOGFILE
    1508         cat $MINDI_TMP/mkisofs.log >> $LOGFILE
    1509         echo "$ISO_CMD returned the following errors:-"
    1510         cat $MINDI_TMP/mkisofs.log
    1511         LogIt "Failed to create ISO image."
    1512     else
    1513         echo "Created bootable ISO image at $MINDI_CACHE/mindi.iso" | tee -a $LOGFILE
     1501        LogFile "----------- $ISO_CMD's errors --------------"
     1502        LogAll "$ISO_CMD returned the following errors:"
     1503        cat $MINDI_TMP/mkisofs.log | tee -a $LOGFILE
     1504        LogIt "ERROR: Failed to create ISO image."
     1505    else
     1506        LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso"
    15141507    fi
    15151508    rm -f $MINDI_TMP/mkisofs.log
     
    15401533    echo -en "Transforming $USBDEVICE in a Bootable device "
    15411534    echo -en "."
    1542     echo "Transforming $USBDEVICE in a Bootable device"  >> $LOGFILE
    1543     echo "Checking $USBDEVICE" >> $LOGFILE
     1535    LogFile "INFO: Transforming $USBDEVICE in a Bootable device"
     1536    LogFile "INFO: Checking $USBDEVICE"
    15441537    $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE
    15451538    if [ $? -ne 0 ]; then
    1546         echo "Unable to access $USBDEVICE" | tee -a $LOGFILE
    1547         echo "Make sure your USB device is pluged in" | tee -a $LOGFILE
    1548         exit -1
     1539        LogAll "ERROR: Unable to access $USBDEVICE"
     1540        LogAll "       Make sure your USB device is pluged in"
     1541        MindiExit -1
    15491542    fi
    15501543    echo -en "."
    1551     echo "Unmounting $USBPART just in case" >> $LOGFILE
     1544    LogFile "INFO: Unmounting $USBPART just in case"
    15521545    umount $USBPART 2>> $LOGFILE 1>> $LOGFILE
    15531546    # If your key has no MBR it may cause an issue
    15541547    # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE
    15551548    if [ -r $MBRFILE ]; then
    1556         echo "Installing an MBR ($MBRFILE) on $USBDEVICE" | tee -a $LOGFILE
     1549        LogAll "INFO: Installing an MBR ($MBRFILE) on $USBDEVICE"
    15571550        dd if=$MBRFILE of=$USBDEVICE
    15581551    else
    1559         echo "You may need to install an MBR (usually in $MBRFILE, but not found on your system) " | tee -a $LOGFILE
    1560         echo "on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE" | tee -a $LOGFILE
    1561     fi
    1562     echo "Preparing $USBDEVICE" >> $LOGFILE
     1552        LogAll "WARNING: You may need to install an MBR (usually in $MBRFILE, but not found on your system)"
     1553        LogAll "         on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE"
     1554    fi
     1555    LogFile "INFO: Preparing $USBDEVICE"
    15631556    cat > $MINDI_TMP/fdisk.txt << EOF
    15641557d
     
    15791572    $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt
    15801573    if [ $? -ne 0 ]; then
    1581         echo "Unable to create a vfat Filesystem on $USBDEVICE" | tee -a $LOGFILE
    1582         echo "Make sure your USB device is pluged in" | tee -a $LOGFILE
     1574        LogAll "ERROR: Unable to create a vfat Filesystem on $USBDEVICE"
     1575        LogAll "       Make sure your USB device is pluged in"
    15831576        $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    15841577        MindiExit -1
    15851578    fi
    1586     echo "fdisk build file" >> $LOGFILE
    1587     echo "----------------" >> $LOGFILE
     1579    LogFile "fdisk build file"
     1580    LogFile "----------------"
    15881581    cat $MINDI_TMP/fdisk.txt >> $LOGFILE
    1589     echo "----------------" >> $LOGFILE
     1582    LogFile "----------------"
    15901583    rm -f $MINDI_TMP/fdisk.txt
    1591     echo "The USB device $USBDEVICE now looks like this:" >> $LOGFILE
     1584    LogFile "INFO: The USB device $USBDEVICE now looks like this:"
    15921585    $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    15931586    echo -en "."
    15941587    # Some distro do auto mount at that point (Ubuntu)
    1595     echo "Unmounting $USBPART just in case again" >> $LOGFILE
     1588    LogFile "INFO: Unmounting $USBPART just in case again"
    15961589    umount $USBPART 2>> $LOGFILE 1>> $LOGFILE
    15971590    echo -en "."
    1598     echo "Creating a vfat filesystem on $USBPART" >> $LOGFILE
     1591    LogFile "INFO: Creating a vfat filesystem on $USBPART"
    15991592    mkdosfs -F 32 $USBPART 2>&1 >> $LOGFILE
    16001593    if [ $? -ne 0 ]; then
    1601         echo "Unable to create a vfat filesystem on $USBPART" | tee -a $LOGFILE
    1602         echo "Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)" | tee -a $LOGFILE
     1594        LogAll "ERROR: Unable to create a vfat filesystem on $USBPART"
     1595        LogAll "       Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)"
    16031596        $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    16041597        MindiExit -1
    16051598    fi
    16061599    echo -en "."
    1607     echo "Mounting $USBPART on $MINDI_TMP/usb" >> $LOGFILE
     1600    LogFile "INFO: Mounting $USBPART on $MINDI_TMP/usb"
    16081601    mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE
    16091602    if [ $? -ne 0 ]; then
    1610         echo "Unable to mount $USBPART on $MINDI_TMP/usb" | tee -a $LOGFILE
    1611         echo "Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)" | tee -a $LOGFILE
     1603        LogAll "ERROR: Unable to mount $USBPART on $MINDI_TMP/usb"
     1604        LogAll "       Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)"
    16121605        $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    16131606        MindiExit -1
     
    16151608    echo -en "."
    16161609    mkdir -p $MINDI_TMP/usb/images
    1617     cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogIt "OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"
     1610    cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogIt "ERROR: OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"
    16181611    echo -en "."
    1619     echo "mindi_lib = $MINDI_LIB" >> $LOGFILE
     1612    LogFile "INFO: mindi_lib = $MINDI_LIB"
    16201613    for i in memdisk memtest.bin memtest.img ; do
    16211614        j=$MINDI_LIB/$i
    16221615        k=$MINDI_TMP/usb
    16231616        if [ -e "$j" ] ; then
    1624             LogIt "Copying $j to $k"
     1617            LogIt "INFO: Copying $j to $k"
    16251618            cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k"
    16261619            cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP"
     
    16361629    MakeBootConfFile syslinux > $MINDI_TMP/usb/syslinux.cfg
    16371630    echo -en "."
    1638     echo "----------- syslinux's conf --------------" |tee -a $LOGFILE
     1631    LogAll "----------- syslinux's conf --------------"
    16391632    cat $MINDI_TMP/usb/syslinux.cfg |tee -a $LOGFILE
    1640     echo "------------------------------------------" |tee -a $LOGFILE
     1633    LogAll "------------------------------------------"
    16411634    umount $MINDI_TMP/usb
    16421635    if [ "$ARCH" != "ia64" ] ; then
     
    16511644        fi
    16521645        if [ $res -ne 0 ] ; then
    1653             echo "----------- syslinux's errors --------------" |tee -a $LOGFILE
     1646            LogAll "----------- syslinux's errors --------------"
    16541647            cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE
    1655             echo "------------------------------------------" |tee -a $LOGFILE
    1656             LogIt "Failed to create USB image."
     1648            LogAll "------------------------------------------"
     1649            LogIt "ERROR: Failed to create USB image."
    16571650        else
    16581651            echo -e "$DONE"
    1659             echo "Created bootable USB image on $USBDEVICE" >> $LOGFILE
     1652            LogFile "INFO: Created bootable USB image on $USBDEVICE"
    16601653        fi
    16611654        rm -f $MINDI_TMP/syslinux.log
    16621655    else
    1663         echo "No USB boot support for ia64" | tee -a $LOGFILE
     1656        LogAll "ERROR: No USB boot support for ia64"
    16641657        MindiExit -1
    16651658    fi
     
    18121805    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
    18131806    mkdosfs $imagefile >> $LOGFILE 2>> $LOGFILE
    1814     mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)"
     1807    mount -t vfat -o loop $imagefile $mountpoint || LogIt "ERROR: Cannot mount (PBDI)"
    18151808    # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it
    18161809    mkdir -p $mountpoint/etc
     
    18371830    fi
    18381831
    1839     echo "Copying $MINDI_TMP/initrd.img to $mountpoint..." >> $LOGFILE
     1832    LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint..."
    18401833    cp -f $MINDI_TMP/initrd.img $mountpoint 2>> $LOGFILE
    18411834    if [ "$?" -ne "0" ] ; then
    1842         LogIt "Failed to copy $MINDI_TMP/initrd.img to $mountpoint"
     1835        LogIt "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint"
    18431836        cat $MINDI_TMP/mtpt.$$ >> $LOGFILE
    1844         LogIt "Please unload some of your modules and try again. Or increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
     1837        LogIt "       Please unload some of your modules and try again. Or increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
    18451838        rm -f $MINDI_TMP/mtpt.$$
    1846         LogIt "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)"
     1839        LogIt "ERROR: Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)"
    18471840        retval=$(($retval+1))
    18481841    fi
     
    18601853    cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2>> $LOGFILE
    18611854    if [ "$?" -ne "0" ] ; then
    1862         echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE
     1855        LogFile "INFO: Files at mountpoint ($mountpoint) :"
    18631856        du -sk $mountpoint/* >> $LOGFILE
    1864         echo "--- end of list of files ---" >> $LOGFILE
     1857        LogFile "--- end of list of files ---"
    18651858        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE
    18661859        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    18671860        cd "$old_pwd"
    18681861        umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    1869         rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
     1862        rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)"
    18701863    #   losetup /dev/loop0 -d
    18711864        [ "$imagefile" != "" ] && rm -f $imagefile
    1872         LogIt "Sorry, your kernel is too big for your image"
     1865        LogIt "ERROR: Sorry, your kernel is too big for your image"
    18731866        Die "Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
    18741867        return 0
    18751868    fi
    18761869    max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`))
    1877     echo "Free space left on image = $free_space KB" >> $LOGFILE
    1878     echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE
     1870    LogFile "INFO: Free space left on image = $free_space KB"
     1871    LogFile "INFO: Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K"
    18791872    # make it bootable
    18801873    [ "$mountpoint" != "" ] && rm -f $mountpoint/zero
    18811874    [ -e "$MINDI_LIB/memdisk" ] && cp -f $MINDI_LIB/memdisk $mountpoint 2>> $LOGFILE
    18821875    if [ "$KERN_DISK_MADE" ] ; then
    1883         echo "Not running LILO. It's not that kind of disk." >> $LOGFILE
     1876        LogFile "INFO: Not running LILO. It's not that kind of disk."
    18841877    fi
    18851878
     
    18871880    umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    18881881    echo -en "..."
    1889     rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
     1882    rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)"
    18901883    if [ "$retval" -eq "0" ] ; then
    18911884        echo -en "...$DONE\n"
    18921885        if [ "$KERN_DISK_MADE" ] ; then
    1893             LogIt "$BOOT_SIZE KB boot disks were created OK\n"
     1886            LogIt "INFO: $BOOT_SIZE KB boot disks were created OK\n"
    18941887        fi
    18951888    else
    18961889        echo -en "...failed\n"
    1897         LogIt $BOOT_SIZE"KB boot disk was NOT created\n"
     1890        LogIt "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n"
    18981891        [ "$imagefile" != "" ] && rm -f $imagefile
    18991892    fi
    1900     [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero"
     1893    [ "$retval" -ne "0" ] && LogIt "WARNING: PrepareBootDiskImage() is returning nonzero"
    19011894    return $retval
    19021895}
     
    19191912    mkdir -p $mountpoint
    19201913    dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file"
    1921     echo "Creating vfat filesystem on $imagefile" >> $LOGFILE
     1914    LogFile "INFO: Creating vfat filesystem on $imagefile"
    19221915    mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE
    19231916    # syslinux should be run on a  local file (doen't work through NFS Cf: #297)
     
    19281921    imagefile=$imagesdir/mindi-bootroot.$BOOT_SIZE.img
    19291922
    1930     mount -t vfat -o loop $imagefile $mountpoint || LogIt "Cannot mount (PBDI)"
     1923    mount -t vfat -o loop $imagefile $mountpoint || LogIt "ERROR: Cannot mount (PBDI)"
    19311924
    19321925    # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it
    19331926    MakeMessageFile | cut -c1-80 > $mountpoint/message.txt
    19341927    MakeBootConfFile isolinux > $mountpoint/syslinux.cfg
    1935     echo "Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." >> $LOGFILE
     1928    LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."
    19361929    cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE
    19371930    if [ "$?" -ne "0" ] ; then
    1938         LogIt "Failed to copy $MINDI_TMP/initrd.img to $mountpoint"
     1931        LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint"
    19391932        cat $MINDI_TMP/mtpt.$$ >> $LOGFILE
    1940         LogIt "Please unload some of your modules and try again."
     1933        LogAll "       Please unload some of your modules and try again."
    19411934        rm -f $MINDI_TMP/mtpt.$$
    1942         LogIt "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?). Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
     1935        LogAll "       Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)."
     1936        LogAll "       Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
    19431937        retval=$(($retval+1))
    19441938    fi
     
    19631957 
    19641958    if [ "$retval" -ne "0" ] ; then
    1965         echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE
     1959        LogFile "INFO: Files at mountpoint ($mountpoint) :"
    19661960        du -sk $mountpoint/* >> $LOGFILE
    1967         echo "--- end of list of files ---" >> $LOGFILE
     1961        LogFile "--- end of list of files ---"
    19681962        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE
    19691963        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    19701964        cd "$old_pwd"
    19711965        umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    1972         rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
    1973 
    1974         LogIt "Sorry, your kernel is too big for your image"
     1966        rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)"
     1967
     1968        LogIt "ERROR: Sorry, your kernel is too big for your image"
    19751969        Die "Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
    19761970    fi
    19771971    max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`))
    1978     echo "Free space left on image = $free_space KB" >> $LOGFILE
    1979     echo "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K" >> $LOGFILE
     1972    LogFile "INFO: Free space left on image = $free_space KB"
     1973    LogFile "INFO: Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K"
    19801974
    19811975    # make it bootable
     
    19851979    umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    19861980    echo -en "..."
    1987     rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
     1981    rmdir $mountpoint || LogIt "ERROR: Cannot rmdir (PBDI)"
    19881982
    19891983    if [ "$retval" -eq "0" ] ; then
     
    19911985        if [ "$KERN_DISK_MADE" ] ; then
    19921986            [ "$imagefile" != "" ] && rm -f $imagefile
    1993             LogIt "$BOOT_SIZE KB boot disks were created OK\n"
     1987            LogIt "INFO: $BOOT_SIZE KB boot disks were created OK\n"
    19941988        fi
    19951989    else
    19961990        echo -en "...failed\n"
    1997         LogIt $BOOT_SIZE"KB boot disk was NOT created\n"
     1991        LogIt "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n"
    19981992        [ "$imagefile" != "" ] && rm -f $imagefile
    19991993    fi
    2000     [ "$retval" -ne "0" ] && LogIt "PrepareBootDiskImage() is returning nonzero"
     1994    [ "$retval" -ne "0" ] && LogIt "ERROR: PrepareBootDiskImage() is returning nonzero"
    20011995    return $retval
    20021996}
     
    20532047        for i in $EXTRA_MODS ; do
    20542048            j=`find lib/modules/$FAILSAFE_KVER -name $i.*o.gz 2> /dev/null`
    2055             [ ! "$j" ] && echo "WARNING - cannot find failsafe module $i.o.gz" >> $LOGFILE
     2049            [ ! "$j" ] && LogFile "WARNING - cannot find failsafe module $i.o.gz"
    20562050            for k in $j ; do
    2057                 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "ERROR on module $k" $MINDI_TMP/$$.log
    2058                 echo "Added failsafe module $k to ramdisk" >> $LOGFILE
     2051                tar cf - $k 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "ERROR: module $k extraction issue" $MINDI_TMP/$$.log
     2052                LogFile "INFO: Added failsafe module $k to ramdisk"
    20592053            done
    20602054        done
     
    20872081    i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null`
    20882082    if [ "$i" ] ; then
    2089         LogIt "Backing up $i's MBR"
     2083        LogIt "INFO: Backing up $i's MBR"
    20902084        dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
    20912085        sleep 1
     
    20932087        j=$i
    20942088        [ -h "$j" ] && j=`readlink -f $j`
    2095         LogIt "Creating /dev/boot_device ($j)"
     2089        LogIt "INFO: Creating /dev/boot_device ($j)"
    20962090        mkdir -p $bigdir/dev
    20972091        cp -pRdf $j $bigdir/dev/boot_device 2>> $LOGFILE || Die "Unable to create /dev/boot_device on ramdisk"
     
    21052099    if [ -d /$ti ]; then
    21062100        mkdir -p $ti
    2107         cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogIt "WARNING - error occurred while copying terminfo"
     2101        cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogIt "ERROR: issue copying terminfo"
    21082102    fi
    21092103    if [ -e "$MONDO_SHARE/restore-scripts" ]; then
     
    21122106    fi
    21132107    if [ -d "/lib/dev-state" ]; then
    2114         tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "Unable to handle /lib/dev-state" $MINDI_TMP/$$.log
     2108        tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Unable to handle /lib/dev-state" $MINDI_TMP/$$.log
    21152109    fi
    21162110    cd "$old_pwd"
     
    21302124            rm -f $bigdir/tmp/i-want-my-lvm
    21312125        else
    2132             echo "Your i-want-my-lvm file content is:" >> $LOGFILE
    2133             echo "-----------------------------------" >> $LOGFILE
     2126            LogFile "Your i-want-my-lvm file content is:"
     2127            LogFile "-----------------------------------"
    21342128            cat  $bigdir/tmp/i-want-my-lvm >> $LOGFILE
    2135             echo "-----------------------------------" >> $LOGFILE
    2136         fi
    2137     fi
    2138     echo "Your mountlist.txt file content is:" >> $LOGFILE
    2139     echo "-----------------------------------" >> $LOGFILE
     2129            LogFile "-----------------------------------"
     2130        fi
     2131    fi
     2132    LogFile "Your mountlist.txt file content is:"
     2133    LogFile "-----------------------------------"
    21402134    cat $bigdir/tmp/mountlist.txt >> $LOGFILE
    2141     echo "-----------------------------------" >> $LOGFILE
     2135    LogFile "-----------------------------------"
    21422136
    21432137    echo -en "$FILES_IN_FILELIST" > $bigdir/FILES-IN-FILELIST 2>> $LOGFILE
     
    21522146    echo -en "Tarring and zipping the data content..."
    21532147    size_of_all_tools=`du -sk $bigdir | cut -f1`
    2154     (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogIt "Problem creating all.tar.gz" $MINDI_TMP/$$.log)
     2148    (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogIt "ERROR: Problem creating all.tar.gz" $MINDI_TMP/$$.log)
    21552149    du -sk $imagesdir/*gz >> $LOGFILE
    21562150    echo -e "$DONE"
     
    22622256    $AWK '{if (substr($0,0,1)!="#" || substr($0,0,3)=="#!/") {print $0;};}' $tempfile > $1
    22632257    rm -f $tempfile
    2264     echo "Stripped comments from $2" >> $LOGFILE
     2258    LogFile "INFO: Stripped comments from $2"
    22652259}
    22662260
     
    22772271    if [ "$?" -eq "0" ] ; then
    22782272        cp -f $tmpfile $1 2>> $LOGFILE
    2279         echo "Stripped binary $2" >> $LOGFILE
     2273        LogFile "INFO: Stripped binary $2"
    22802274    fi
    22812275    rm -f $tmpfile
     
    23172311        # It's a Xen kernel
    23182312        KERNEL_IS_XEN="yes"
    2319         LogFile "It's a Xen kernel..."
     2313        LogFile "INFO: It's a Xen kernel..."
    23202314    fi
    23212315
     
    23532347    fi
    23542348    if [ ! "$possible_kernels" ] ; then
    2355         LogFile "No kernel matches exactly. Are there any duff kernels?"
     2349        LogFile "INFO: No kernel matches exactly. Are there any duff kernels?"
    23562350        possible_kernels="$duff_kernels"
    23572351        if [ ! "$possible_kernels" ] ; then
    2358             LogFile "Sorry, no duff kernels either"
     2352            LogFile "INFO: Sorry, no duff kernels either"
    23592353        else
    2360             LogFile "I bet you're running Debian or Gentoo, aren't you?"
    2361             LogFile "Your kernel doesn't have a sane builddate. Oh well..."
     2354            LogFile "INFO: I bet you're running Debian or Gentoo, aren't you?"
     2355            LogFile "INFO: Your kernel doesn't have a sane builddate. Oh well..."
    23622356        fi
    23632357    fi
     
    23722366        LogFile "Could not find your kernel."
    23732367        if [ -e "/boot/vmlinuz" ] ; then
    2374             LogFile "Using /boot/vmlinuz as a last resort."
     2368            LogFile "INFO: Using /boot/vmlinuz as a last resort."
    23752369            output=/boot/vmlinuz
    23762370        else
     
    23792373    elif [ "$noof_kernels" -eq "1" ] ; then
    23802374        kp=`echo "$possible_kernels" | sed s/' '//`
    2381         LogFile "Your kernel is $kp (v$KERVERRUN)"
     2375        LogFile "INFO: Your kernel is $kp (v$KERVERRUN)"
    23822376        output="$kp"
    23832377    else
    23842378        for i in $possible_kernels ; do
    23852379            if [ "`echo $i | grep "$KERVERRUN"`" ]; then
    2386                 LogFile "OK, I used my initiative and found that "
    2387                 LogFile "$i is probably your kernel. "
     2380                LogFile "INFO: OK, I used my initiative and found that "
     2381                LogFile "INFO: $i is probably your kernel. "
    23882382                output="$i"
    23892383                break
     
    23932387            if [ "`echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null`" ]; then
    23942388                output=/boot/vmlinuz
    2395                 LogFile "Schlomo, this one's for you."
     2389                LogFile "INFO: Schlomo, this one's for you."
    23962390            else
    2397                 LogFile "Two or more possible kernels found. You may specify any one of them and the "
    2398                 LogFile "boot disks will still work, probably. If one does not work, try another."
    2399                 LogFile "$possible_kernels"
     2391                LogFile "INFO: Two or more possible kernels found. You may specify any one of them and the "
     2392                LogFile "INFO: boot disks will still work, probably. If one does not work, try another."
     2393                LogFile "INFO: $possible_kernels"
    24002394                output=""
    24012395            fi
     
    24072401        elif [ "$noof_xenkernels" -eq "1" ]; then
    24082402            xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//`
    2409             LogFile "Your Xen kernel is $xenkernelpath (v$KERVERRUN)"
     2403            LogFile "INFO: Your Xen kernel is $xenkernelpath (v$KERVERRUN)"
    24102404        else
    24112405            for i in $possible_xenkernels ; do
    24122406                if [ "`echo $i | grep "$KERVERRUN"`" ]; then
    2413                     LogFile "OK, I used my initiative and found that "
    2414                     LogFile "$i is probably your Xen kernel. "
     2407                    LogFile "INFO: OK, I used my initiative and found that "
     2408                    LogFile "INFO: $i is probably your Xen kernel. "
    24152409                    xenkernelpath="$i"
    24162410                    break
     
    24212415                if [ ! -n "$new_possible_xenkernels" ]; then
    24222416                    xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1`
    2423                     LogFile "Using $xenkernelpath"
     2417                    LogFile "INFO: Using $xenkernelpath"
    24242418                else
    2425                     LogFile "Two or more possible Xen kernels found. You may specify any one of them and the "
    2426                     LogFile "boot disks will still work, probably. If one does not work, try another."
    2427                     LogFile "$possible_xenkernels"
     2419                    LogFile "INFO: Two or more possible Xen kernels found. You may specify any one of them and the "
     2420                    LogFile "INFO: boot disks will still work, probably. If one does not work, try another."
     2421                    LogFile "INFO: $possible_xenkernels"
    24282422                    output=""
    24292423                    xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1`
    2430                     LogFile "Using $xenkernelpath"
     2424                    LogFile "INFO: Using $xenkernelpath"
    24312425                fi
    24322426            fi
     
    24552449    dd if=/dev/zero of=$tempfile bs=1k count=$ramdisk_size &> /dev/null || Die "Not enough room for temporary ramdisk (TurnTgzIntoRdz)"
    24562450    echo -en "..."
    2457     echo "Creating ext2 filesystem on $tempfile" >> $LOGFILE
     2451    LogFile "INFO: Creating ext2 filesystem on $tempfile"
    24582452    mke2fs -b 1024 -m 1 -i 2048 -F $tempfile >> $LOGFILE 2>> $LOGFILE || Die "Unable to create an ext2 file system on $tempfile"
    24592453    echo -en "..."
     
    24662460    # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs
    24672461    if [ -h "/lib64" ]; then
    2468         mkdir -p lib || LogIt "Unable to create lib in $mountpoint."
    2469         ln -s lib lib64 || LogIt "/lib64 is a symbolic link, but I couldn't create it in $mountpoint."
    2470     fi
    2471 
    2472     cp -Rdf $tgz_dir_fname/* . 2>&1 >> $LOGFILE
     2462        mkdir -p lib || LogIt "ERROR: Unable to create lib in $mountpoint."
     2463        ln -s lib lib64 || LogIt "ERROR: /lib64 is a symbolic link, but I couldn't create it in $mountpoint."
     2464    fi
     2465
     2466    # Check files before copying to discover configuration issues or McAfee preventing mindi reading these files
     2467    for f in $tgz_dir_fname/*; do
     2468        if [ ! -r $f ]; then
     2469            Die "ERROR: Unable to copy $f to the target dir. Check your installation or McAfee presence"
     2470        else
     2471            cp -Rdf $f . 2>&1 >> $LOGFILE
     2472        fi
     2473    done
    24732474    tar -zxf symlinks.tgz || Die "Cannot untar symlinks.tgz"
    24742475
     
    25162517    done
    25172518    # Initial / are trucated by tar
    2518     tar cf - `sort -u $MINDI_TMP/minimal.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "Problem in minimal analysis" $MINDI_TMP/$$.log
     2519    tar cf - `sort -u $MINDI_TMP/minimal.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in minimal analysis" $MINDI_TMP/$$.log
    25192520    rm -f $MINDI_TMP/minimal.lis
    25202521
     
    25272528    if [ $? -eq 0 ]; then
    25282529        echo "udev device manager found" > $mountpoint/tmp/USE-UDEV
    2529         LogIt "udev device manager found"
    2530         tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "Problem in /etc/udev analysis" $MINDI_TMP/$$.log
     2530        LogIt "INFO: udev device manager found"
     2531        tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /etc/udev analysis" $MINDI_TMP/$$.log
    25312532        # This avoids NIC remapping if on another machine at restore time on Debian at least
    25322533        rm -f ./etc/udev/rules.d/z[0-9][0-9]_persistent-net.rules
     
    25352536        # Do not do it if it's a link (Ubuntu 64 bits #503)
    25362537        if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [  ! -h "/lib64/udev" ]; then
    2537             tar cf - -C / /lib64/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "Problem in /lib64/udev analysis" $MINDI_TMP/$$.log
     2538            tar cf - -C / /lib64/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib64/udev analysis" $MINDI_TMP/$$.log
    25382539        fi
    25392540        if [ -e "/lib32/udev" ] && [ ! -h "/lib32" ] && [  ! -h "/lib32/udev" ]; then
    2540             tar cf - -C / /lib32/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "Problem in /lib32/udev analysis" $MINDI_TMP/$$.log
     2541            tar cf - -C / /lib32/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib32/udev analysis" $MINDI_TMP/$$.log
    25412542        fi
    25422543        if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [  ! -h "/lib/udev" ]; then
    2543             tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "Problem in /lib/udev analysis" $MINDI_TMP/$$.log
     2544            tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib/udev analysis" $MINDI_TMP/$$.log
    25442545        fi
    25452546        if [ -x /sbin/udevd ]; then
     
    25682569                fi
    25692570            done
    2570             tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "Problem in udev.lis analysis" $MINDI_TMP/$$.log
     2571            tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in udev.lis analysis" $MINDI_TMP/$$.log
    25712572            rm -f $MINDI_TMP/udev.lis
    25722573        else
    2573             echo "udevd daemon not in standard place (/sbin)" 2>&1 | tee -a $LOGFILE
    2574             echo "mindi will use static devices which may cause problems" 2>&1 | tee -a $LOGFILE
     2574            LogAll "WARNING: udevd daemon not in standard place (/sbin)"
     2575            LogAll "         mindi will use static devices which may cause problems"
    25752576            rm -f $mountpoint/tmp/USE-UDEV
    25762577        fi
     
    25812582    mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE
    25822583    if [ -d $MINDI_CACHE/bkphw ]; then
    2583         LogIt "Hardware Information found and saved ..."
     2584        LogIt "INFO: Hardware Information found and saved ..."
    25842585        cp -rp $MINDI_CACHE/bkphw .
    25852586        if [ -f $MINDI_CACHE/tools.files ]; then
    25862587            lis=`grep -Ev '^#' $MINDI_CACHE/tools.files`
    25872588            LocateDeps $lis > $MINDI_TMP/tools.lis
    2588             tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "Problem in tools.lis analysis" $MINDI_TMP/$$.log
     2589            tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in tools.lis analysis" $MINDI_TMP/$$.log
    25892590        fi
    25902591        if [ -f $MINDI_CACHE/mindi-rsthw ]; then
     
    25972598    # Management of perl scripts delivered needed at restore time
    25982599    mindi-get-perl-modules `cat $MINDI_CONF/perl-scripts` > $MINDI_TMP/perl.lis
    2599     tar cf - `cat $MINDI_TMP/perl.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "Problem in perl scripts analysis" $MINDI_TMP/$$.log
     2600    tar cf - `cat $MINDI_TMP/perl.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in perl scripts analysis" $MINDI_TMP/$$.log
    26002601
    26012602    for w in cdrom groovy-stuff ; do
     
    26032604    done
    26042605
    2605     tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "Problem in fd dev analysis" $MINDI_TMP/$$.log
     2606    tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in fd dev analysis" $MINDI_TMP/$$.log
    26062607
    26072608    cd "$old_pwd"
     
    26322633    fi
    26332634    for i in $DENY_MODS; do
    2634         echo "Removing $i from the list of modules to load" >> $LOGFILE
     2635        LogFile "INFO: Removing $i from the list of modules to load"
    26352636        list_of_groovy_mods=`echo ${list_of_groovy_mods} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '`
    26362637    done
    26372638
    2638     [ -e "$needed_modules_path" ] || LogIt "path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."
     2639    [ -e "$needed_modules_path" ] || LogIt "WARNING: path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."
    26392640    for i in $list_of_groovy_mods ; do
    26402641        needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`"
     
    26442645        [ -e "$i" ] && s=`du -sk $i | cut -f1` || s=""
    26452646        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
    2646         echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    2647         tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log
     2647        LogFile "INFO: Adding $i ($s KB) to the rootfs"
     2648        tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "ERROR: Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log
    26482649        # Uncompress modules if not using udev and native modprobe
    26492650        if [ ! -f $mountpoint/tmp/USE-UDEV ]; then
    26502651            if [ "`echo "$i" | grep -F ".gz"`" ]; then
    2651                 echo "Uncompressing $i" >> $LOGFILE
     2652                LogFile "INFO: Uncompressing $i"
    26522653                gunzip -f $mountpoint/$i
    26532654            fi
     
    26562657
    26572658    # Also copy modules.dep in case of udev so that normal modprobe works
    2658     tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log
     2659    tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "ERROR: Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log
    26592660
    26602661    # Copy FW in case some drivers needs it
     
    26682669            mkdir -p $mountpoint/usr/bin
    26692670            cp -a /usr/bin/hpsa_obdr_mode $mountpoint/usr/bin
    2670             LogIt "Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support"
     2671            LogIt "INFO: Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support"
    26712672        else
    26722673            LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode tool"
     
    26762677
    26772678    if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
    2678         echo "Deleting devfsd daemon from ramdisk" >> $LOGFILE
    2679         [ ! -e "/sbin/devfsd" ] && echo "...because /sbin/devfsd not found" >> $LOGFILE
    2680         [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && echo "...because kernel is failsafe" >> $LOGFILE
     2679        LogFile "INFO: Deleting devfsd daemon from ramdisk"
     2680        [ ! -e "/sbin/devfsd" ] && LogFile "...because /sbin/devfsd not found"
     2681        [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] && LogFile "...because kernel is failsafe"
    26812682        rm -f $mountpoint/sbin/devfsd
    26822683    fi
     
    26972698    fi
    26982699    mkdir -p $mountpoint/proc
    2699     echo "---------------------------" >> $LOGFILE
    2700     echo "Content of initial ramdisk:" >> $LOGFILE
    2701     echo "---------------------------" >> $LOGFILE
     2700    LogFile "---------------------------"
     2701    LogFile "Content of initial ramdisk:"
     2702    LogFile "---------------------------"
    27022703    (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE
    2703     echo "---------------------------" >> $LOGFILE
     2704    LogFile "---------------------------"
    27042705
    27052706    # Determine what filesystem to use for initrd image
    2706     echo "Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd." >> $LOGFILE
     2707    LogFile "INFO: Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd."
    27072708    gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}`
    27082709    [ -z  gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating."
    27092710    if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ]; then
    27102711        # say what will be used
    2711         echo "Creating an $gvFileSystem initrd image..." >> $LOGFILE
     2712        LogFile "INFO: Creating an $gvFileSystem initrd image..."
    27122713        # kernel expects linuxrc in ext2 filesystem
    27132714        ( cd "$mountpoint" && ln -sf sbin/init linuxrc )
     
    27202721        rm -f ${rdz_fname}.tmp
    27212722        # log that we are done
    2722         echo "...done." >> $LOGFILE
     2723        LogFile "...done."
    27232724    elif [ "$gvFileSystem" = "initramfs" ]; then
    27242725        # say what will be used
    2725         echo "Creating a gzip'ed cpio (AKA initramfs) initrd image..." >> $LOGFILE
     2726        LogFile "INFO: Creating a gzip'ed cpio (AKA initramfs) initrd image..."
    27262727        # make sure that cpio is there
    27272728        which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again."
     
    27352736        umount $mountpoint || Die "Cannot unmount $tempfile"
    27362737        # log that we are done
    2737         echo "...done." >> $LOGFILE
     2738        LogFile "...done."
    27382739    else
    27392740        Die "Filesystem $gvFileSystem not supported for initrd image. Terminating."
     
    27702771
    27712772> $LOGFILE
    2772 echo "mindi v$MINDI_VERSION" >> $LOGFILE
    2773 echo "$ARCH architecture detected" >> $LOGFILE
    2774 echo "mindi called with the following arguments:" >> $LOGFILE
    2775 echo "$@" >> $LOGFILE
    2776 echo "Start date : `date`" >> $LOGFILE
    2777 echo "-----------------------------" >> $LOGFILE
     2773LogFile "mindi v$MINDI_VERSION"
     2774LogFile "$ARCH architecture detected"
     2775LogFile "mindi called with the following arguments:"
     2776LogFile "$@"
     2777LogFile "Start date : `date`"
     2778LogFile "-----------------------------"
    27782779
    27792780[ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat
     
    27812782# Log some capital variables
    27822783[ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly."
    2783 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE
    2784 echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE
    2785 echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE
     2784LogFile "MONDO_SHARE = $MONDO_SHARE"
     2785LogFile "MINDI_LIB = $MINDI_LIB"
     2786LogFile "MINDI_SBIN = $MINDI_SBIN"
    27862787[ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly."
    2787 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE
     2788LogFile "MINDI_CONF = $MINDI_CONF"
    27882789if [ -f $MINDI_CONFIG ]; then
    2789     echo "-----------------------------" >> $LOGFILE
    2790     echo " Mindi configuration file    " >> $LOGFILE
    2791     echo "-----------------------------" >> $LOGFILE
     2790    LogFile "-----------------------------"
     2791    LogFile " Mindi configuration file    "
     2792    LogFile "-----------------------------"
    27922793    grep -Ev '^#' $MINDI_CONFIG >> $LOGFILE
    2793     echo "-----------------------------" >> $LOGFILE
     2794    LogFile "-----------------------------"
    27942795fi
    27952796
     
    28042805if which awk &> /dev/null ; then
    28052806    if ! which gawk &> /dev/null ; then
    2806         LogIt "You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"
     2807        LogIt "INFO: You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"
    28072808    fi
    28082809fi
     
    28162817    PATH=$PATH:/sbin:/usr/sbin
    28172818    export PATH
    2818     echo "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily." >> $LOGFILE
    2819     echo "However, you may wish to ask your vendor to provide a permanent fix..." >> $LOGFILE
    2820     echo " Or you might like to call 'su -' instead of 'su', for example." >> $LOGFILE
     2819    LogFile "INFO: Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily."
     2820    LogFile "INFO: However, you may wish to ask your vendor to provide a permanent fix..."
     2821    LogFile "INFO:  Or you might like to call 'su -' instead of 'su', for example."
    28212822fi
    28222823
     
    28252826    source $MINDI_LIB/FindDistroFailsafe
    28262827    # Log kernel image
    2827     LogIt "FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"
     2828    LogIt "INFO: FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"
    28282829else
    28292830    [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1`
     
    28622863    LVM="false"
    28632864fi
    2864 echo "LVM set to $LVM" >> $LOGFILE
    2865 echo "----------" >> $LOGFILE
    2866 echo "mount result:" >> $LOGFILE
    2867 echo "-------------" >> $LOGFILE
     2865LogFile "INFO: LVM set to $LVM"
     2866LogFile "----------"
     2867LogFile "mount result:"
     2868LogFile "-------------"
    28682869mount >> $LOGFILE
    2869 echo "-------------" >> $LOGFILE
     2870LogFile "-------------"
    28702871if [ -e /etc/raidtab ]; then
    2871     echo "-------------" >> $LOGFILE
    2872     echo "/etc/raidtab content:" >> $LOGFILE
    2873     echo "-------------" >> $LOGFILE
     2872    LogFile "-------------"
     2873    LogFile "/etc/raidtab content:"
     2874    LogFile "-------------"
    28742875    cat /etc/raidtab >> $LOGFILE
    28752876fi
    2876 echo "-------------" >> $LOGFILE
    2877 echo "cat /proc/cmdline:" >> $LOGFILE
    2878 echo "-------------" >> $LOGFILE
     2877LogFile "-------------"
     2878LogFile "cat /proc/cmdline:"
     2879LogFile "-------------"
    28792880cat /proc/cmdline >> $LOGFILE
    2880 echo "-------------" >> $LOGFILE
    2881 echo "cat /proc/swaps:" >> $LOGFILE
    2882 echo "-------------" >> $LOGFILE
     2881LogFile "-------------"
     2882LogFile "cat /proc/swaps:"
     2883LogFile "-------------"
    28832884cat /proc/swaps >> $LOGFILE
    2884 echo "-------------" >> $LOGFILE
    2885 echo "cat /proc/partitions:" >> $LOGFILE
    2886 echo "-------------" >> $LOGFILE
     2885LogFile "-------------"
     2886LogFile "cat /proc/partitions:"
     2887LogFile "-------------"
    28872888cat /proc/partitions >> $LOGFILE
    2888 echo "-------------" >> $LOGFILE
    2889 echo "cat /proc/filesystems:" >> $LOGFILE
    2890 echo "-------------" >> $LOGFILE
     2889LogFile "-------------"
     2890LogFile "cat /proc/filesystems:"
     2891LogFile "-------------"
    28912892cat /proc/filesystems >> $LOGFILE
    2892 echo "-------------" >> $LOGFILE
    2893 echo "lsmod result:" >> $LOGFILE
    2894 echo "-------------" >> $LOGFILE
     2893LogFile "-------------"
     2894LogFile "lsmod result:"
     2895LogFile "-------------"
    28952896lsmod >> $LOGFILE
    28962897MODULES="`cat /proc/modules | $AWK '{print $1}'`"
    28972898if [ -x /usr/sbin/esxcfg-module ]; then
    2898     echo "-------------" >> $LOGFILE
    2899     echo "VMWare ESX server detected - Enabling dedicated support" >> $LOGFILE
    2900     echo "-------------" >> $LOGFILE
    2901     echo "VMWare modules" >> $LOGFILE
    2902     echo "-------------" >> $LOGFILE
     2899    LogFile "-------------"
     2900    LogFile "INFO: VMWare ESX server detected - Enabling dedicated support"
     2901    LogFile "-------------"
     2902    LogFile "VMWare modules"
     2903    LogFile "-------------"
    29032904    /usr/sbin/esxcfg-module -l >> $LOGFILE
    29042905    MODULES="$MODULES `/usr/sbin/esxcfg-module -l | $AWK '{print $1}'`"
    29052906fi
    2906 echo "FORCE_MODS:" >> $LOGFILE
    2907 echo "-------------" >> $LOGFILE
    2908 echo $FORCE_MODS >> $LOGFILE
    2909 echo "-------------" >> $LOGFILE
    2910 echo "DENY_MODS:" >> $LOGFILE
    2911 echo "-------------" >> $LOGFILE
    2912 echo $DENY_MODS >> $LOGFILE
    2913 echo "-------------" >> $LOGFILE
    2914 echo "df result:" >> $LOGFILE
    2915 echo "----------" >> $LOGFILE
     2907LogFile "FORCE_MODS:"
     2908LogFile "-------------"
     2909LogFile $FORCE_MODS
     2910LogFile "-------------"
     2911LogFile "DENY_MODS:"
     2912LogFile "-------------"
     2913LogFile $DENY_MODS
     2914LogFile "-------------"
     2915LogFile "df result:"
     2916LogFile "----------"
    29162917df -T >> $LOGFILE
    2917 echo "-------------" >> $LOGFILE
    2918 echo "Liste of extra modules is:" >> $LOGFILE
    2919 echo "$EXTRA_MODS" >> $LOGFILE
    2920 echo "-------------" >> $LOGFILE
     2918LogFile "-------------"
     2919LogFile "Liste of extra modules is:"
     2920LogFile "$EXTRA_MODS"
     2921LogFile "-------------"
    29212922
    29222923# Compute libata version
     
    29262927    if [ "$laver" = "2" ]; then
    29272928        DENY_MODS="$DENY_MODS ide-generic"
    2928         echo "ide-generic removed from module list as your system uses libata v2+" >> $LOGFILE
    2929         echo "-------------" >> $LOGFILE
    2930     fi
     2929        LogFile "INFO: ide-generic removed from module list as your system uses libata v2+"
     2930        LogFile "-------------"
     2931    fi
     2932fi
     2933
     2934# Check for McAfee which disturbs the access to some files (tgz in articular)
     2935if [ $(cat /proc/linuxshield/enabled 2>/dev/null) = "1" ]; then
     2936    LogFile "WARNING: McAfee LinuxShield is enabled. McAfee might block access to certain special files."
     2937    LogFile "WARNING: Check in /var/opt/NAI/LinuxShield/etc/nailsd.cfg for 'nailsd.profile.OAS.action.error: Block'"
     2938    LogFile "WARNING: You have two options:"
     2939    LogFile "WARNING:  - Exclude all directories with special files (check McAfee System Events Log)"
     2940    LogFile "WARNING:  - Disable the scanner during the backup"
    29312941fi
    29322942
    29332943# Check for ISO_CMD command
    29342944if [ ! -x $ISO_CMD ]; then
    2935     echo "NOTE: No CD image (ISO file) utility found" >> $LOGFILE
     2945    LogFile "NOTE: No CD image (ISO file) utility found"
    29362946fi
    29372947
     
    29672977            if [ $KERNEL_IS_XEN = "yes" ]; then
    29682978                echo "$xenkernelpath"
    2969                 LogOnly "xenkernelpath = $xenkernelpath"
     2979                LogFile "INFO: xenkernelpath = $xenkernelpath"
    29702980                MindiExit 0
    29712981            else
     
    29742984        else
    29752985            echo "$resk"
    2976             LogOnly "kernelpath = $resk"
     2986            LogFile "INFO: kernelpath = $resk"
    29772987            MindiExit 0
    29782988        fi
     
    30313041###
    30323042        if [ $KERNEL_IS_XEN = "yes" ]; then
    3033             LogIt "xenkernelpath = $xenkernelpath"
     3043            LogIt "INFO: xenkernelpath = $xenkernelpath"
    30343044        fi
    30353045        kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'`
    30363046        if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ]
    30373047        then
    3038            LogIt "Module path for ${kernelpath} not found..."
    3039            LogIt "using running kernel\'s modules."
     3048           LogIt "WARNING: Module path for ${kernelpath} not found..."
     3049           LogIt "         using running kernel\'s modules."
    30403050           kernelname=$KERVERRUN
    30413051        fi
    3042         LogIt "kernelname = $kernelname"
    3043         LogIt "kernelpath = $kernelpath"
     3052        LogIt "INFO: kernelname = $kernelname"
     3053        LogIt "INFO: kernelpath = $kernelpath"
    30443054###
    30453055### end of Sq-Modification
     
    30573067        if [ "${11}" ] ; then
    30583068            LILO_OPTIONS=""
    3059     #       LogIt "LILO will use conservative settings, to be compatible with older BIOSes."
     3069    #       LogIt "INFO: LILO will use conservative settings, to be compatible with older BIOSes."
    30603070        fi
    30613071        LAST_FILELIST_NUMBER=${12}
     
    30723082        [ "$USE_GZIP" = "" ] && USE_GZIP=no
    30733083        [ "$NOT_BOOT" = "" ] && NOT_BOOT=no
    3074         [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine."
     3084        [ "$TAPEDEV" ] && LogIt "INFO: This is a tape-based backup. Fine."
    30753085        # MONDO_ROOT is the real scratchdir
    30763086        MONDO_ROOT=`echo $MINDI_CACHE | sed 's/\(.*\)\/.*/\1/'`
     
    30993109    LogIt "------------------------------------------------------------------------------"
    31003110else
    3101     echo "You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks" >> $LOGFILE
     3111    LogFile "INFO: You are using Mindi-Linux v$MINDI_VERSION to make boot+data disks"
    31023112fi
    31033113if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then
    31043114    LogIt "Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`"
    31053115else
    3106     LogIt "Unable to find mindi-busybox, please install it"
     3116    LogIt "ERROR: Unable to find mindi-busybox, please install it"
    31073117    MindiExit -1
    31083118fi
     
    31143124KERN_DISK_MADE=""
    31153125
    3116 echo "DIFFERENTIAL = $DIFFERENTIAL" >> $LOGFILE
    3117 echo "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" >> $LOGFILE
    3118 echo "NOT_BOOT = '$NOT_BOOT'" >> $LOGFILE
     3126LogFile "DIFFERENTIAL = $DIFFERENTIAL"
     3127LogFile "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE"
     3128LogFile "NOT_BOOT = '$NOT_BOOT'"
    31193129if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then
    3120     LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else."
     3130    LogIt "INFO: Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else."
    31213131    MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg
    31223132    MakeMountlist $MINDI_TMP/mountlist.txt
     
    31323142
    31333143if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then
    3134     LogIt "Including the generation of a Bootable USB device on $USBDEVICE"
     3144    LogIt "INFO: Including the generation of a Bootable USB device on $USBDEVICE"
    31353145fi
    31363146
     
    31603170        source $MINDI_LIB/FindDistroFailsafe
    31613171        # Log kernel image
    3162         LogIt "FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"
     3172        LogIt "INFO: FAILSAFE kernel image to be used is: $FAILSAFE_KBIN ($FAILSAFE_KVER)"
    31633173        kernelpath="$FAILSAFE_KBIN"
    3164         LogIt "I shall include a failsafe kernel, not your kernel, in the boot disks.\n"
    3165         LogIt "The failsafe kernel is $kernelpath.\n"
    3166         LogIt "However, you are still running your kernel. If Mindi fails to create your\n"
    3167         LogIt "disks then it may still be a result of a problem with your kernel.\n"
     3174        LogIt "INFO: I shall include a failsafe kernel, not your kernel, in the boot disks."
     3175        LogIt "      The failsafe kernel is $kernelpath."
     3176        LogIt "      However, you are still running your kernel. If Mindi fails to create your"
     3177        LogIt "      disks then it may still be a result of a problem with your kernel."
    31683178        pwd=`pwd`
    31693179        cd "$MINDI_TMP"
     
    31733183    else
    31743184        kernelpath=$MINDI_LIB/vmlinuz
    3175         LogIt "I shall include Mindi's failsafe kernel, not your kernel, in the boot disks."
    3176         LogIt "However, you are still running your kernel. If Mindi fails to create your"
    3177         LogIt "disks then it may still be a result of a problem with your kernel."
     3185        LogIt "INFO: I shall include Mindi's failsafe kernel, not your kernel, in the boot disks."
     3186        LogIt "      However, you are still running your kernel. If Mindi fails to create your"
     3187        LogIt "      disks then it may still be a result of a problem with your kernel."
    31783188        pwd=`pwd`
    31793189        cd "$MINDI_TMP"
     
    31843194fi
    31853195echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$MINDI_CACHE" >> $LOGFILE
    3186 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty..."
     3196[ "$(($RANDOM%64))" -eq "0" ] && LogIt "INFO: Dude, I've looked inside your computer and it's really dusty..."
    31873197
    31883198[ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it.\nGo to http://www.mondorescue.org and download it, then install it."
     
    31943204export ramdisk_size=$rds
    31953205
    3196 echo "Ramdisk will be $ramdisk_size KB" >> $LOGFILE
     3206LogFile "INFO: Ramdisk will be $ramdisk_size KB"
    31973207if [ "$ARCH" = "ia64" ] ; then
    31983208    PrepareBootDiskImage_LILO $kernelpath || Die "Failed to create ia64 image disk image."
Note: See TracChangeset for help on using the changeset viewer.