Changeset 687


Ignore:
Timestamp:
Jul 17, 2006, 3:39:42 PM (13 years ago)
Author:
bcornec
Message:

merge -r671:686 $SVN_M/branches/stable

Location:
trunk
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/ChangeLog

    r672 r687  
    33MINDI CHANGES
    44
    5 1.0.8-4 (2006-06-10)
     51.0.9 (2006-06-26)
    66- nfsmount option added to allow redeployment from another NFS server (Bruno Cornec)
     7- Replaced all occurrences of egrep with 'grep -E' and of fgrep with 'grep -F' (Andree Leidenfrost)
     8- Fix a bug in analyze-my-lvm for RHEL3 where vgdisplay prints an additional
     9field sometimes (#) (severine.lombardo_at_acoss.fr/Bruno Cornec)
     10- Deal properly with LVM tool lvmiopversion and with lvmcreate_initrd and pvdata - fixes Debian bug #351687 (Andree Leidenfrost)
     11- Handle the format /dev/mapper/<VG>-<LV> for LVM devices - fix for Debian bug #362926 (Andree Leidenfrost)
    712
    8131.0.8-3 (2006-06-07)
  • trunk/mindi/README.pxe

    r672 r687  
    2222mountpoint is the mount point on the NFS server to use (should be in /etc/exports of the NFS server)
    2323
    24 The initrd and kernel file come rom the first bootable media
     24The initrd and kernel file come from the first bootable media
    2525created by mondoarchive. To get them, please issue:
    2626
  • trunk/mindi/analyze-my-lvm

    r350 r687  
    1 #!/bin/sh
     1#!/bin/bash
    22#
    33# $Id$
     
    169169
    170170ListLvmDrivesAndPartitions() {
    171     $LVMCMD vgdisplay -v |grep "PV Name" | awk '{print $3}'
     171    $LVMCMD vgdisplay -v |grep "PV Name" | sed 's/(#)//' | awk '{print $3}'
    172172}
    173173
  • trunk/mindi/mindi

    r618 r687  
    206206
    207207AbortIfMkfsVfatMissing() {
    208     #if fgrep "vfat" /etc/fstab &> /dev/null ; then
     208    #if grep -F "vfat" /etc/fstab &> /dev/null ; then
    209209        if ! which mkfs.vfat &> /dev/null ; then
    210210            Die "mkfs.vfat missing from your filesystem - please install your dosfstools RPM or DEB package. Perhaps your PATH environmental variable is broken, too?"
     
    303303    mkdir -p $bigdir/etc
    304304    cp --parents -pRdf $mappath $bigdir || LogIt "AKMF -- Could not copy $mappath to $bigdir\n"
    305     if [ "`echo $mappath | fgrep ".gz"`" ] ; then
    306         included_list=`gzip -dc $mappath | fgrep -i include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
    307     else
    308         included_list=`fgrep -i include $mappath | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     305    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
     306        included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     307    else
     308        included_list=`grep -Fi include $mappath | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
    309309    fi
    310310    for included_item in $included_list ; do
    311311    if [ ! -e "$included_item" ] ; then
    312             sss=`find $KEYDIR/keymaps | fgrep "${included_item}.inc"`
    313         [ "$sss" = "" ] && sss=`find $KEYDIR/keymaps | fgrep "$included_item"`
     312            sss=`find $KEYDIR/keymaps | grep -F "${included_item}.inc"`
     313        [ "$sss" = "" ] && sss=`find $KEYDIR/keymaps | grep -F "$included_item"`
    314314        for ii in $sss ; do
    315315                [ -e "$ii" ] && AddKeyboardMappingFile $ii
     
    340340    scratchfile=$TMP_ROOT/blah.$$.dat
    341341    cp -f $filename $scratchfile || Die "CUACF -- cannot copy $filename to $scratchfile - did you run out of disk space?"
    342     [ "`head $scratchfile -n1 | fgrep "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"
    343     [ "`echo "$filename" | fgrep "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-"
    344     if [ "`echo "$filename" | fgrep "lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then
     342    [ "`head $scratchfile -n1 | grep -F "bin/sh"`" != "" ] && StripComments $scratchfile "-$filename-"
     343    [ "`echo "$filename" | grep -F "etc/termcap"`" != "" ] && StripComments $scratchfile "-$filename-"
     344    if [ "`echo "$filename" | grep -F "lib/modules/" | grep "\.*o\.gz"`" != "" ] ; then
    345345    mv $scratchfile $scratchfile.gz
    346346    gunzip -f $scratchfile || LogIt "Cannot gunzip $scratchfile.gz\n"
     
    523523
    524524    res=0
    525     [ "`ps ax | fgrep "mondoarchive" | grep -v "grep"`" ] && res=$(($res+1))
     525    [ "`ps ax | grep -F "mondoarchive" | grep -v "grep"`" ] && res=$(($res+1))
    526526    [ -f "/var/run/monitas-mondo.pid" ] && res=$(($res+1))
    527527    [ "$res" -gt "1" ] && echo "yes"
     
    542542    cd /
    543543
    544     my_partitions=`mount | fgrep $$ | cut -f1 -d' '`
     544    my_partitions=`mount | grep -F $$ | cut -f1 -d' '`
    545545    [ "$my_partitions" != "" ] && umount $my_partitions
    546546    # BCO : Too Dangerous !!!
     
    589589    ln -sf $vanilla_lib_name $outdir$optimized_lib_name
    590590    echo "Excluding $optimized_lib_name" >> $LOGFILE
    591     fgrep -vx "$optimized_lib_name $filelist" > $filelist.tmp
     591    grep -Fvx "$optimized_lib_name $filelist" > $filelist.tmp
    592592    echo "Replacing it with $vanilla_lib_name" >> $LOGFILE
    593593    echo "$vanilla_lib_name" >> $filelist.tmp
     
    647647    fi
    648648    echo "keyfile=$keyfile" >> $LOGFILE
    649     locale=`fgrep KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`
     649    locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`
    650650    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    651651    echo "locale=$locale" >> $LOGFILE
    652     mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | fgrep "${locale}." | grep -vx " *#.*"`
     652    mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep -F "${locale}." | grep -vx " *#.*"`
    653653    [ ! "$mp" ] && mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep "$locale[^r][^/]" | grep -vx " *#.*"`
    654654    for i in $mp ; do
     
    711711        LILO_EXE=lilo
    712712    fi
    713     $LILO_EXE -V | fgrep "21.6" > /dev/null && Die "Please upgrade LILO. Your verison has a serious bug. If you're not _using_ LILO, fine, uninstall it. :)"
     713    $LILO_EXE -V | grep -F "21.6" > /dev/null && Die "Please upgrade LILO. Your verison has a serious bug. If you're not _using_ LILO, fine, uninstall it. :)"
    714714    else
    715715    LILO_EXE=`which false`
     
    832832        for tool in $filelist ; do
    833833            lvmresolved=`ResolveSoftlink $tool`
    834             if echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then
     834            if [ "$tool" == "$lvmresolved" ]; then
     835            echo "$tool" >> $tempfile
     836            elif echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then
    835837            if [ "$lvmversion" = "" ] ; then
    836838            lvmversion=`$lvmresolved`
     
    838840            fi
    839841            toolstripped=`echo $tool | $AWK -F / '{print $NF;}'`
     842            if [ "$lvmversion" == "200" ]; then
     843            # pvdata and lvmcreate_initrd don't exist in LVM2
     844            case "$toolstripped" in
     845                "pvdata")
     846                continue
     847                ;;
     848                "lvmcreate_initrd")
     849                continue
     850                ;;
     851            esac
     852            fi
    840853            toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped
    841854            if [ -e "$toolpath" ] ; then
     
    923936    fi
    924937    fi
    925      tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | fgrep -vx "" | sort -u | egrep -v "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile
     938     tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | grep -Fvx "" | sort -u | grep -Ev "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile
    926939    rm -f $tempfile $outfile.pre
    927940    [ "$res" -eq "0" ] && echo -e "\r\t\t\t\t\t\t\t\t$DONE" || echo "\nFailed."
     
    10201033    > $outfile
    10211034    partlist=$(mount | cut -d' ' -f1,3,5 \
    1022     | egrep -v "((none|/tmp|/ISOs|/proc|/dev/root) )|/mnt/" \
     1035    | grep -Ev "((none|/tmp|/ISOs|/proc|/dev/root) )|/mnt/" \
    10231036    | tr ' ' '|')
    10241037
     
    10741087    path=$1
    10751088    echo -en "In the directory '$path' you will find the images:-\n"
    1076     for fname in `ls $path | fgrep mindi-` ; do
     1089    for fname in `ls $path | grep -F mindi-` ; do
    10771090        printf "%19s " $fname
    10781091    done
     
    11031116        echo "module $module --> $r" >> $LOGFILE
    11041117        [ "$r" ] && echo "$r"
    1105         [ -f "$oss" ] && find $oss | fgrep $module
     1118        [ -f "$oss" ] && find $oss | grep -F $module
    11061119    done
    11071120    find /lib/modules/$kern/modules.* -type f 2> /dev/null
     
    11771190    location=`echo "$path/$fname_to_find" | tr -s '/' '/'`
    11781191    if echo "$location" | grep "lib/lib" 2> /dev/null ; then
    1179         loclist=`find $path -maxdepth 1 | fgrep "$fname_to_find"`
     1192        loclist=`find $path -maxdepth 1 | grep -F "$fname_to_find"`
    11801193    else
    11811194        loclist=$location
     
    11911204            done
    11921205#       resolved=`file $location | $AWK '{print $NF;}'`
    1193 #       if [ "`echo "$resolved" | fgrep "/"`" = "" ] ; then
     1206#       if [ "`echo "$resolved" | grep -F "/"`" = "" ] ; then
    11941207#           stub=`dirname $location`
    11951208#           output="/$stub/$resolved $output"
     
    13431356partition_size partition_format outstring partition_number \
    13441357partition_mountpt c_p lwm_info psz lvm_dev unofficial_outstring \
    1345 absolute_partition old_partition_fmt
     1358absolute_partition old_partition_fmt current_lvolume
    13461359
    13471360    echo "Your raw fstab file looks like this:-" >> $LOGFILE
     
    13671380    if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then
    13681381        echo -en "\rAnalyzing LVM...\r"
    1369         all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
     1382        all_partitions=`$MINDI_LIB/analyze-my-lvm | grep -F ">>>" | cut -d' ' -f2-32`
    13701383    fi
    13711384    all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`"
    13721385#    echo "all partitions = $all_partitions" > /dev/stderr
    13731386    for i in $IMAGE_DEVS ; do
    1374         mount | fgrep "$i " > /dev/null 2> /dev/null && Die "Sorry, $i is already mounted! CANNOT DO IMAGEDEV on it if it's mounted."
     1387        mount | grep -F "$i " > /dev/null 2> /dev/null && Die "Sorry, $i is already mounted! CANNOT DO IMAGEDEV on it if it's mounted."
    13751388    done
    13761389    [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`"
     
    13781391    for c_p in $all_partitions ; do
    13791392#        echo "c_p = $c_p" > /dev/stderr
    1380         [ "`echo "/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw" | fgrep "$c_p"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/scd"`" != "" ] || [ "`echo "$c_p" | fgrep "/dev/ram"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | fgrep ":/"`" != "" ] && continue
    1381         [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$c_p"`" ] && continue
     1393        [ "`echo "/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep -F "/dev/scd"`" != "" ] || [ "`echo "$c_p" | grep -F "/dev/ram"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -F ":/"`" != "" ] && continue
     1394        [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | grep -F "$c_p"`" ] && continue
    13821395        [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
    1383         if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then
     1396        if [ -h "$c_p" ] && [ "`echo "$c_p" | grep -F "/dev/hd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/sd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/md"`" = "" ] ; then
    13841397            current_partition=`ResolveSoftlink $c_p`
    1385             [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p"
    1386             [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue
     1398            [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ] && current_partition="$c_p"
     1399            [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | grep -F "$current_partition"`" ] && continue
    13871400        else
    13881401            current_partition="$c_p"
     
    14411454
    14421455    partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
    1443     if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_partition 2> /dev/null`" ]; then
     1456    # Some distributions such as Debian do not put /dev/<VG>/<LV> in fstab
     1457    # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately,
     1458    # the former is then a link to the latter, so we test whether
     1459    # $current_partition is actually such a link or not and set
     1460    # $current_lvolume accordingly. Note that $current_lvolume may well be an
     1461    # ordinary device. It is just to make sure that we feed the right value
     1462    # into any of the LVM tools if possible.
     1463    if [ -d "/dev/mapper" ] && [ -z "`lvm lvdisplay $current_partition 2> /dev/null`" ]; then
     1464        partition_stub="`echo "$current_partition" | sed "s|^/dev/mapper/|/dev/|" | cut -d"-" -f1`"
     1465        current_lvolume="`find /dev -lname "$current_partition" | grep "^$partition_stub"`"
     1466    fi
     1467    if [ -z "$current_lvolume" ]; then
     1468        current_lvolume="$current_partition"
     1469    fi
     1470    # End of LVM device style variation code (other than $current_lvolume).
     1471    if [ -d "/proc/lvm" ] && [ "`lvdisplay $current_lvolume 2> /dev/null`" ]; then
    14441472        partition_size="lvm"
    1445     elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_partition 2> /dev/null`" ]; then
     1473    elif [ -d "/dev/mapper" ] && [ "`lvm lvdisplay $current_lvolume 2> /dev/null`" ]; then
    14461474        partition_size="lvm"
    14471475    else
     
    14501478        [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue
    14511479        if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then
    1452         partition_size=`fgrep -v "Priority" /proc/swaps | tr -s '\t' ' ' | fgrep "$current_partition" | $AWK '{print $3}'`
     1480        partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition" | $AWK '{print $3}'`
    14531481        [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap"
    14541482                [ "$partition_format" != "swap" ] && partition_format="swap"
     
    14561484            totalsize=0
    14571485            items=0
    1458             for i in `tr -s ' ' '\t' < /proc/swaps | fgrep -v "Filename" | cut -f3` ; do
     1486            for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do
    14591487            totalsize=$(($totalsize+$i))
    14601488            items=$(($items+1))
     
    14691497    [ "$partition_format" = "swap" ] && partition_mountpt="swap"
    14701498    if [ "$partition_mountpt" = "" ] ; then
    1471         if [ "`pvdisplay $current_partition 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_partition 2> /dev/null`" != "" ] ; then
    1472         if  [ "`fgrep device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
     1499        if [ "`pvdisplay $current_lvolume 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_lvolume 2> /dev/null`" != "" ] ; then
     1500        if  [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    14731501            partition_mountpt="raid"
    14741502            partition_format="raid"
    14751503        else
    1476 #           lvm_dev="`pvdisplay $current_partition | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"
     1504#           lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"
    14771505            partition_mountpt="lvm"
    14781506            partition_format="lvm"
     
    14831511    echo "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)" >> $LOGFILE
    14841512    [ "$psz" != "lvm" ] && psz=$(($psz/1024))
    1485     if [ "`echo " $IMAGE_DEVS " | fgrep " $current_partition "`" != "" ] ; then
     1513    if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then
    14861514        partition_mountpt="image"
    14871515            old_partition_fmt=$partition_format
     
    14981526            fi
    14991527    fi
    1500         if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | fgrep " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then
     1528        if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then
    15011529            echo "Excluding $current_partition from mountlist" >> $LOGFILE
    15021530            continue
     
    15121540        if [ "$partition_format" = "Compaq diagnostics" ] ; then
    15131541        partition_format="compaq"
    1514         elif [ ! "`fgrep device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
     1542        elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    15151543        LogIt "Unable to find mountpoint of $current_partition - ignoring\n"
    15161544        continue
     
    15231551        echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE
    15241552    elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then
    1525         if [ "`fgrep device /etc/raidtab 2>/dev/null | fgrep $current_partition`" ] ; then
     1553        if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then
    15261554        partition_mountpt=raid
    15271555        partition_format=raid
     
    15691597    rmdir $1
    15701598    echo -en "  " > $1
    1571     if [ "`fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then
     1599    if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then
    15721600        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ >> $1.tmp
    15731601    else
     
    16231651    return 1
    16241652}
    1625 
    1626 
    1627 
    16281653
    16291654
     
    17091734    local disksize
    17101735    disksize=$1
    1711     if [ "`fgrep -i "debian" /etc/issue.net 2> /dev/null`" ] ; then
     1736    if [ "`grep -Fi "debian" /etc/issue.net 2> /dev/null`" ] ; then
    17121737        sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 /etc/issue.net` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/
    17131738    else
     
    20002025    fi
    20012026    if [ $? -ne "0" ] ; then
    2002     if [ "`fgrep "/tmp/dev.0" $LOGFILE`" ] ; then
     2027    if [ "`grep -F "/tmp/dev.0" $LOGFILE`" ] ; then
    20032028        LogIt "The '/tmp/dev.0' error is NOT Mindi's fault. It is LILO's.\n"
    20042029        LogIt "Please reboot your PC as a workaround.\n"
     
    24542479    local devpath drive res stub
    24552480    device=$1
    2456     if [ "`echo "$device" | fgrep "/dev/md"`" != "" ] ; then
     2481    if [ "`echo "$device" | grep -F "/dev/md"`" != "" ] ; then
    24572482    res=`SizeOfRaidPartition $device`
    24582483    [ "$res" = "" ] && Die "Cannot find $device's size - is your /etc/raidtab sane?"
     
    24672492    echo "------- $FDISK log end ------------" >> $LOGFILE
    24682493# end patch
    2469     [ "$res" = "" ] && res=`df -k -P -x supermount | tr -s '\t' ' ' | fgrep "$device " | cut -d' ' -f2`
     2494    [ "$res" = "" ] && res=`df -k -P -x supermount | tr -s '\t' ' ' | grep -F "$device " | cut -d' ' -f2`
    24702495    [ "$res" = "" ] && res="-1"
    24712496    echo $res
     
    25792604       root="/"
    25802605    fi
    2581     for fname in `find $root -maxdepth 2 -type f | fgrep lin | egrep -v '^/proc/|^/net/'` ; do
     2606    for fname in `find $root -maxdepth 2 -type f | grep -F lin | grep -Ev '^/proc/|^/net/'` ; do
    25822607    [ ! -e "$fname" ] && continue
    25832608        [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel
     
    25912616        [ "$fkern_ver" = "" ] && continue
    25922617#   echo "$fname --> $fkern_ver (but we want $we_want_version)" >> /dev/stderr
    2593         [ "`echo "$fkern_ver" |fgrep "$we_want_version "`" = "" ] && continue
     2618        [ "`echo "$fkern_ver" |grep -F "$we_want_version "`" = "" ] && continue
    25942619    [ -f "$fname" ] || continue
    25952620    [ -h "$fname" ] && continue
     
    25982623    if [ "$?" -eq "0" ] ; then
    25992624        # Used by ia64
    2600         if [ "`gzip -cd $fname | strings 2> /dev/null | fgrep "$kdate"`" = "" ] ; then
     2625        if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then
    26012626            LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it...\n"
    26022627            duff_kernels="$fname $duff_kernels"
    26032628        else
    2604                 [ "`echo "$fname" | fgrep "vmlinux"`" ] && continue
     2629                [ "`echo "$fname" | grep -F "vmlinux"`" ] && continue
    26052630                possible_kernels="$fname $possible_kernels"
    26062631        fi
    26072632    else
    2608         if [ "`strings $fname 2> /dev/null | fgrep "$kdate"`" = "" ] ; then
     2633        if [ "`strings $fname 2> /dev/null | grep -F "$kdate"`" = "" ] ; then
    26092634            LogIt "Have you recompiled your kernel \"$fname\" w/o rebooting?\n Naughty but I'll allow it...\n"
    26102635            duff_kernels="$fname $duff_kernels"
    26112636        else
    2612                 [ "`echo "$fname" | fgrep "vmlinux"`" ] && continue
     2637                [ "`echo "$fname" | grep -F "vmlinux"`" ] && continue
    26132638                possible_kernels="$fname $possible_kernels"
    26142639        fi
     
    26512676        fi
    26522677        done
    2653     if echo " $possible_kernels " | fgrep "/boot/vmlinuz " &> /dev/null ; then
     2678    if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then
    26542679        output=/boot/vmlinuz
    26552680        echo "Schlomo, this one's for you." >> $LOGFILE
     
    26802705    old_pwd=`pwd`
    26812706    cd $bigdir
    2682     list_of_files=`GetFileSizeList . | sort -nr | cut -f2 | fgrep -v "/dev/"`
     2707    list_of_files=`GetFileSizeList . | sort -nr | cut -f2 | grep -Fv "/dev/"`
    26832708    progress=0
    26842709    total_files=`CountItemsIn "$list_of_files"`
     
    28272852        echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    28282853        cp -df $i $mountpoint/ || LogIt "Unable to copy $i to $mountpoint\n"
    2829         [ "`echo "$i" | fgrep ".gz"`" ] && gunzip -f $mountpoint/`basename $i`
     2854        [ "`echo "$i" | grep -F ".gz"`" ] && gunzip -f $mountpoint/`basename $i`
    28302855    done
    28312856#    if [ -e "/dev/.devfsd" ] ; then
     
    28772902WhichOfTheseModulesAreLoaded() {
    28782903    local modname loaded_modules
    2879     loaded_modules=" `lsmod | tr -s ' ' '\t' | cut -f1 | fgrep -vx "Modules" | tr '\n' ' '` "
     2904    loaded_modules=" `lsmod | tr -s ' ' '\t' | cut -f1 | grep -Fvx "Modules" | tr '\n' ' '` "
    28802905    for modname in $1 ; do
    2881     [ "`echo "$loaded_modules" | fgrep " $modname "`" ] && echo "$modname"
     2906    [ "`echo "$loaded_modules" | grep -F " $modname "`" ] && echo "$modname"
    28822907    done
    28832908}
     
    29913016fi
    29923017FixPathIfBroken
    2993 [ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | egrep "2\.[46]" | cut -d' ' -f1`
     3018[ -f "$MINDI_LIB/vmlinuz" ] && FAILSAFE_KVER=`strings $MINDI_LIB/vmlinuz 2> /dev/null | grep -E "2\.[46]" | cut -d' ' -f1`
    29943019AbortIfMkfsVfatMissing
    29953020### BCO
     
    30013026    FindLiloBinary
    30023027fi
    3003 fgrep " $TMP_ROOT " /proc/mounts | fgrep tmpfs > /dev/null 2> /dev/null && TMP_ROOT=/home && LogIt "Changing TMP_ROOT to $TMP_ROOT because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason
     3028grep -F " $TMP_ROOT " /proc/mounts | grep -F tmpfs > /dev/null 2> /dev/null && TMP_ROOT=/home && LogIt "Changing TMP_ROOT to $TMP_ROOT because you're using tmpfs for /tmp\n" ; # tmpfs doesn't like Mindi and /tmp, for some reason
    30043029rm -f /tmp/mindi_lo
    30053030trap "Aborted" SIGTERM
  • trunk/mondo/ChangeLog

    r672 r687  
    88- Internationalization (A huge thank to rene-marc dolhen <rmd_at_mecreant.org> who achieved that big task)
    99
    10 2.0.8-4 (2006-06-10)
     102.0.9 (2006-06-26)
    1111- nfsmount option added to allow redeployment from another NFS server (Bruno Cornec)
     12- Replaced all occurrences of egrep with 'grep -E' and of fgrep with 'grep -F' (Andree Leidenfrost)
     13- Optimize grep usage - fixes Debian bug #222052 (Andree Leidenfrost)
     14- Avoid false alerts about growisofs not running under sudo (Andree Leidenfrost)
     15- Increase PPCFG_RAMDISK_SIZE to 350 MB (Thomas Börkel/Bruno Cornec)
     16- Removed useless mondo-makefilelist (Andree Leidenfrost)
     17- Fix a segmentation fault in parse_mdstat() (Andree Leidenfrost)
     18- Fix gcc 4.1.2 warnings (Andree Leidenfrost)
    1219
    13202.0.8-3 (2006-06-07)
  • trunk/mondo/mondo/common/libmondo-archive.c

    r539 r687  
    12171217    mvaddstr_and_log_it(g_currentY++, 74, "Done.");
    12181218    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    1219         write_header_block_to_stream(0, "start-of-tape",
     1219        write_header_block_to_stream((off_t)0, "start-of-tape",
    12201220                                     BLK_START_OF_TAPE);
    1221         write_header_block_to_stream(0, "start-of-backup",
     1221        write_header_block_to_stream((off_t)0, "start-of-backup",
    12221222                                     BLK_START_OF_BACKUP);
    12231223    }
     
    17131713                log_to_screen("%s...OK", message_to_screen);
    17141714                if (!run_program_and_log_output
    1715                     ("tail -n10 /var/log/mondo-archive.log | fgrep ':-('",
     1715                    ("tail -n10 /var/log/mondo-archive.log | grep -F ':-('",
    17161716                     1)) {
    17171717                    log_to_screen
     
    19811981    bool delete_when_done;
    19821982    bool use_ntfsprog;
    1983     /*@ long long ****************************************** */
    1984     long long biggie_fsize;
     1983    off_t biggie_fsize;
    19851984
    19861985    assert(bkpinfo != NULL);
     
    20812080            if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    20822081                tmp = calc_checksum_of_file(bigfile_fname);
    2083                 write_header_block_to_stream(0, tmp, BLK_STOP_A_BIGGIE);
     2082                write_header_block_to_stream((off_t)0, tmp, BLK_STOP_A_BIGGIE);
    20842083                paranoid_free(tmp);
    20852084            }
     
    22592258
    22602259    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2261         write_header_block_to_stream(0, "start-of-afioballs",
     2260        write_header_block_to_stream((off_t)0, "start-of-afioballs",
    22622261                                     BLK_START_AFIOBALLS);
    22632262#if __FreeBSD__ == 5
     
    22682267        res = make_afioballs_and_images_OLD(bkpinfo, mrconf);
    22692268#endif
    2270         write_header_block_to_stream(0, "stop-afioballs",
     2269        write_header_block_to_stream((off_t)0, "stop-afioballs",
    22712270                                     BLK_STOP_AFIOBALLS);
    22722271    } else {
     
    23442343        res += write_EXAT_files_to_tape(bkpinfo, xattr_fname, acl_fname);
    23452344        asprintf(&blah, "%ld", count_lines_in_file(biggielist));
    2346         write_header_block_to_stream(0, blah, BLK_START_BIGGIEFILES);
     2345        write_header_block_to_stream((off_t)0, blah, BLK_START_BIGGIEFILES);
    23472346        paranoid_free(blah);
    23482347    }
     
    23542353
    23552354    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2356         write_header_block_to_stream(0, "end-of-biggiefiles",
     2355        write_header_block_to_stream((off_t)0, "end-of-biggiefiles",
    23572356                                     BLK_STOP_BIGGIEFILES);
    23582357    }
     
    27202719    char *curr_file, *cf;
    27212720    /*@ long long ****************************************************** */
    2722     long long length_of_incoming_file = 0;
     2721    off_t length_of_incoming_file = (off_t)0;
    27232722    t_archtype type;
    27242723    va_list ap;
     
    27552754        paranoid_free(curr_file);
    27562755        /* write closing header */
    2757         write_header_block_to_stream(0, "finished-writing-file", stop_chr);
     2756        write_header_block_to_stream((off_t)0, "finished-writing-file", stop_chr);
    27582757    }
    27592758    va_end(ap);
     
    30353034
    30363035    /*@ long long ************************************************** */
    3037     long long totalread = 0;
    3038     long long totallength = 0;
    3039     long long length;
     3036    off_t totalread = (off_t)0;
     3037    off_t totallength = (off_t)0;
     3038    off_t length;
    30403039
    30413040    /*@ int ******************************************************** */
     
    30803079        strcpy (tmp, call_program_and_get_last_line_of_output(command));
    30813080        log_it("res of it = %s", tmp);
    3082         totallength = atoll(tmp);
     3081        totallength = (off_t)atoll(tmp);
    30833082    } else {
    30843083        file_to_openin = biggie_filename;
  • trunk/mondo/mondo/common/libmondo-devices.c

    r507 r687  
    304304    return
    305305        !system
    306         ("parted2fdisk -l 2>/dev/null | grep '^/dev/' | egrep -qv '(MS|DOS|FAT|NTFS)'");
     306        ("parted2fdisk -l 2>/dev/null | grep '^/dev/' | grep -Eqv '(MS|DOS|FAT|NTFS)'");
    307307#endif
    308308}
     
    14651465    case dvd:
    14661466        if (archiving_to_media) {
    1467             if (ask_me_yes_or_no
    1468                 (_("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")))
    1469             {
    1470                 bkpinfo->manual_cd_tray = TRUE;
     1467            if (bkpinfo->backup_media_type != dvd) {
     1468                if (ask_me_yes_or_no
     1469                    (_("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")))
     1470                {
     1471                    bkpinfo->manual_cd_tray = TRUE;
     1472                }
    14711473            }
    14721474            if ((bkpinfo->compression_level =
     
    20652067    asprintf(&tmp,
    20662068           call_program_and_get_last_line_of_output
    2067            ("df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2069           ("df -m -P -t nonfs,msdosfs,ntfs,smbfs,smb,cifs | tr -s '\t' ' ' | grep -vE \"none|Filesystem\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    20682070#else
    20692071    asprintf(&tmp,
    20702072           call_program_and_get_last_line_of_output
    2071            ("df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -v none | grep -v Filesystem | grep -v /dev/shm | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
     2073           ("df -m -P -x nfs -x vfat -x ntfs -x smbfs -x smb -x cifs | sed 's/                  /devdev/' | tr -s '\t' ' ' | grep -vE \"none|Filesystem|/dev/shm\" | awk '{printf \"%s %s\\n\", $4, $6;}' | sort -n | tail -n1 | awk '{print $NF;}'"));
    20722074#endif
    20732075
  • trunk/mondo/mondo/common/libmondo-fifo.c

    r507 r687  
    162162    paranoid_system("sync");
    163163    asprintf(&command,
    164              "ps wwax | fgrep \"%s\" | fgrep -v grep | awk '{print $1;}' | grep -v PID | tr -s '\n' ' ' | awk '{ print $1; }'",
    165              g_sz_call_to_buffer);
     164            "ps wwax | grep -F \"%s\" | grep -Fv grep | awk '{print $1;}' | grep -v PID | tr -s '\n' ' ' | awk '{ print $1; }'",
     165            g_sz_call_to_buffer);
    166166    paranoid_free(g_sz_call_to_buffer);
    167167    log_msg(2, "kill_buffer() --- command = %s", command);
  • trunk/mondo/mondo/common/libmondo-filelist.c

    r672 r687  
    13001300
    13011301    if (res) {
    1302         log_OS_error("Call to mondo-makefilelist failed");
     1302        log_OS_error("Call to mondo_makefilelist failed");
    13031303        mvaddstr_and_log_it(g_currentY++, 74, _("Failed."));
    13041304    } else {
     
    13781378    {
    13791379        sprintf(find_skeleton_marker,
    1380                 "fgrep -v \"%s\" %s > %s.new 2> /dev/null", dir,
     1380                "grep -Fv \"%s\" %s > %s.new 2> /dev/null", dir,
    13811381                skeleton_filelist, skeleton_filelist);
    13821382//    log_msg(0, "fsm = %s", find_skeleton_marker);
  • trunk/mondo/mondo/common/libmondo-files-EXT.h

    r171 r687  
    1616extern int grab_percentage_from_last_line_of_file(char *filename);
    1717extern char *last_line_of_file(char *filename);
    18 extern long long length_of_file(char *filename);
     18extern off_t length_of_file(char *filename);
    1919extern int make_hole_for_file(char *outfile_fname);
    2020extern void make_list_of_files_to_ignore(char *ignorefiles_fname,
  • trunk/mondo/mondo/common/libmondo-files.c

    r672 r687  
    435435    if (i < 0) {
    436436        asprintf(&command,
    437                 "tail -n3 %s | fgrep -i \"%c\" | tail -n1 | awk '{print $0;}'",
     437                "tail -n3 %s | grep -Fi \"%c\" | tail -n1 | awk '{print $0;}'",
    438438                filename, '%');
    439439        asprintf(&lastline,
     
    513513 * @return The length of the file, or -1 for error.
    514514 */
    515 long long length_of_file(char *filename)
     515off_t length_of_file(char *filename)
    516516{
    517517    /*@ pointers *************************************************** */
     
    519519
    520520    /*@ long long ************************************************* */
    521     long long length;
     521    off_t length;
    522522
    523523    fin = fopen(filename, "r");
     
    528528    }
    529529    fseeko(fin, 0, SEEK_END);
    530     length = ftell(fin);
     530    length = ftello(fin);
    531531    paranoid_fclose(fin);
    532532    return (length);
     
    763763                }
    764764            } else {
     765                /* BERLIOS: more than long here ??? */
    765766                file_len_K = (long) (length_of_file(fname) / 1024);
    766767            }
  • trunk/mondo/mondo/common/libmondo-files.h

    r171 r687  
    1919int grab_percentage_from_last_line_of_file(char *filename);
    2020char *last_line_of_file(char *filename);
    21 long long length_of_file(char *filename);
     21off_t length_of_file(char *filename);
    2222int make_hole_for_file(char *outfile_fname);
    2323void make_list_of_files_to_ignore(char *ignorefiles_fname,
  • trunk/mondo/mondo/common/libmondo-fork.c

    r507 r687  
    599599                    fatal_error("Failed to malloc() tmp");
    600600                }
     601                /* BERLIOS : strange ???
     602                sprintf(tmp, "I am here - %llu", ftello(fin));
     603      log_msg(0, tmp);
     604*/
    601605                fread(tmp, 1, 512, fin);
    602606                log_msg(0, "tmp = '%s'", tmp);
  • trunk/mondo/mondo/common/libmondo-stream-EXT.h

    r146 r687  
    2828#endif
    2929extern bool should_we_write_to_next_tape(long mediasize,
    30                                          long long
     30                                         off_t
    3131                                         length_of_incoming_file);
    3232extern int skip_incoming_files_until_we_find_this_one(char
     
    3838extern int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo,
    3939                                          char *infile);
    40 extern int write_header_block_to_stream(long long length_of_incoming_file,
     40extern int write_header_block_to_stream(off_t length_of_incoming_file,
    4141                                        char *filename, int control_char);
    4242extern void wrong_marker(int should_be, int it_is);
  • trunk/mondo/mondo/common/libmondo-stream.c

    r507 r687  
    156156    log_it("closeout_tape() -- entering");
    157157    retval +=
    158         write_header_block_to_stream(0, "end-of-backup",
     158        write_header_block_to_stream((off_t)0, "end-of-backup",
    159159                                     BLK_END_OF_BACKUP);
    160     retval += write_header_block_to_stream(0, "end-of-tape", BLK_END_OF_TAPE);  /* just in case */
     160    retval += write_header_block_to_stream((off_t)0, "end-of-tape", BLK_END_OF_TAPE);   /* just in case */
    161161    /* write 1MB of crap */
    162162    for (i = 0; i < 256 * 1024; i++) {
     
    166166        (void) fwrite(blk, 1, 256 * 1024, g_tape_stream);
    167167        if (should_we_write_to_next_tape
    168             (bkpinfo->media_size[g_current_media_number], 256 * 1024)) {
     168            (bkpinfo->media_size[g_current_media_number], (off_t)256 * 1024)) {
    169169            start_to_write_to_next_tape(bkpinfo);
    170170        }
     
    386386                                 BLK_START_EXAT_FILE);
    387387    write_file_to_stream_from_file(bkpinfo, xattr_fname);
    388     write_header_block_to_stream(-1, xattr_fname, BLK_STOP_EXAT_FILE);
     388    write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
    389389// acl
    390390    write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    391391                                 BLK_START_EXAT_FILE);
    392392    write_file_to_stream_from_file(bkpinfo, acl_fname);
    393     write_header_block_to_stream(-1, acl_fname, BLK_STOP_EXAT_FILE);
     393    write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
    394394    write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    395395                                 BLK_STOP_EXTENDED_ATTRIBUTES);
     
    10621062 * autodetecting the size. Huh?
    10631063 */
     1064
     1065/* BERLIOS: Should be reviewed for mediasize being a off_t ??? */
    10641066bool
    10651067should_we_write_to_next_tape(long mediasize,
    1066                              long long length_of_incoming_file)
     1068                             off_t length_of_incoming_file)
    10671069{
    10681070    /*@ bool's ***************************************************** */
     
    13031305    g_tape_posK = 0;
    13041306    g_sigpipe = FALSE;
    1305     res += write_header_block_to_stream(0, "start-of-tape", BLK_START_OF_TAPE); /* just in case */
    1306     res += write_header_block_to_stream(0, "start-of-backup", BLK_START_OF_BACKUP); /* just in case */
     1307    res += write_header_block_to_stream((off_t)0, "start-of-tape", BLK_START_OF_TAPE);  /* just in case */
     1308    res += write_header_block_to_stream((off_t)0, "start-of-backup", BLK_START_OF_BACKUP);  /* just in case */
    13071309    return (res);
    13081310}
     
    13431345            }
    13441346            if (i != last) {
    1345                 write_header_block_to_stream(0,
     1347                write_header_block_to_stream((off_t)0,
    13461348                                             "stop-backcatalog-afio-or-slice",
    13471349                                             BLK_STOP_AN_AFIO_OR_SLICE);
     
    14461448    long i;
    14471449
    1448     /*@ long long ************************************************** */
    1449     long long filesize;
     1450    off_t filesize;
    14501451
    14511452#ifdef EXTRA_TAPE_CHECKSUMS
     
    15211522    paranoid_fclose(fin);
    15221523    asprintf(&checksum, "%04x%04x", crc16, crctt);
    1523     write_header_block_to_stream(g_current_media_number, checksum,
     1524    /* BERLIOS: what does it do ??? */
     1525    write_header_block_to_stream((off_t)g_current_media_number, checksum,
    15241526                                 BLK_STOP_FILE);
    15251527    paranoid_free(checksum);
     
    15411543 */
    15421544int
    1543 write_header_block_to_stream(long long length_of_incoming_file,
     1545write_header_block_to_stream(off_t length_of_incoming_file,
    15441546                             char *filename, int control_char)
    15451547{
     
    15521554    int i;
    15531555
    1554     /*@ long long ************************************************** */
    1555     long long olen;
     1556    off_t olen;
    15561557
    15571558    /*@ end vars *************************************************** */
     
    15751576    sprintf(tempblock + 6000 + control_char, "Mondolicious, baby");
    15761577    tempblock[7000] = control_char;
    1577     memcpy(tempblock + 7001, (char *) &olen, sizeof(long long));
     1578    memcpy(tempblock + 7001, (char *) &olen, sizeof(off_t));
    15781579    strcpy(tempblock + 1000, filename);
    15791580    g_tape_posK +=
  • trunk/mondo/mondo/common/libmondo-stream.h

    r59 r687  
    2626                             char *fn);
    2727bool should_we_write_to_next_tape(long mediasize,
    28                                   long long length_of_incoming_file);
     28                                  off_t length_of_incoming_file);
    2929int skip_incoming_files_until_we_find_this_one(char
    3030                                               *the_file_I_was_reading);
     
    3535int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo,
    3636                                   char *infile);
    37 int write_header_block_to_stream(long long length_of_incoming_file,
     37int write_header_block_to_stream(off_t length_of_incoming_file,
    3838                                 char *filename, int control_char);
    3939void wrong_marker(int should_be, int it_is);
  • trunk/mondo/mondo/common/libmondo-tools.c

    r672 r687  
    362362    assert(bkpinfo != NULL);
    363363    bkpinfo->optimal_set_size =
    364         (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type) ? 4 : 8) *
     364        (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type) ? 16 : 16) *
    365365        1024;
    366366
     
    382382
    383383    run_program_and_log_output("uname -a", 5);
     384    run_program_and_log_output("cat /etc/*-release", 5);
    384385    run_program_and_log_output("cat /etc/*issue*", 5);
    385386    asprintf(&g_tmpfs_mountpt, "%s/tmpfs", bkpinfo->tmpdir);
     
    475476        paranoid_free(mondo_mkisofs_sz);
    476477
    477         if (getenv("SUDO_COMMAND")) {
    478             fatal_error
    479                 ("Can't write DVDs as sudo because growisofs doesn't support this - please see the growisofs manpage for details.");
     478        if (getenv ("SUDO_COMMAND")) {
     479            asprintf(&command, "strings `which growisofs` | grep -c SUDO_COMMAND");
     480            if (!strcmp(call_program_and_get_last_line_of_output(command), "1")) {
     481                popup_and_OK("Fatal Error: Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details.");
     482                fatal_error("Can't write DVDs as sudo because growisofs doesn't support this - see the growisofs manpage for details.");
     483            }       
     484            paranoid_free(command);
    480485        }
    481486        log_msg(2, "call_make_iso (DVD res) is ... %s",
     
    894899    // abort if Windows partition but no ms-sys and parted
    895900    if (!run_program_and_log_output
    896         ("mount | grep -w vfat | grep -v /dev/fd | grep -v nexdisk", 0)
     901        ("mount | grep -w vfat | grep -vE \"/dev/fd|nexdisk\"", 0)
    897902        ||
    898903        !run_program_and_log_output
    899         ("mount | grep -w dos | grep -v /dev/fd | grep -v nexdisk", 0)) {
     904        ("mount | grep -w dos | grep -vE \"/dev/fd|nexdisk\"", 0)) {
    900905        log_to_screen(_("I think you have a Windows 9x partition."));
    901906        retval += whine_if_not_found("parted");
  • trunk/mondo/mondo/common/libmondo-verify.h

    r171 r687  
    3434extern int grab_percentage_from_last_line_of_file(char *);
    3535extern char *last_line_of_file(char *);
    36 extern long long length_of_file(char *);
     36extern off_t length_of_file(char *);
    3737extern void log_file_end_to_screen(char *, char *);
    3838extern void log_tape_pos(void);
  • trunk/mondo/mondo/common/my-stuff.h

    r672 r687  
    147147#define NOOF_ERR_LINES 6        ///< The number of lines of log output to keep at the bottom of the screen.
    148148#define ARBITRARY_MAXIMUM 2000  ///< The maximum number of items showing at once in the mountlist or filelist editor.
    149 #define MAX_TAPECATALOG_ENTRIES 4096    ///< The maximum number of entries in the tape catalog.
     149#define MAX_TAPECATALOG_ENTRIES 8192    ///< The maximum number of entries in the tape catalog.
    150150#define MAX_STR_LEN 380         ///< The maximum length of almost all @p char buffers in Mondo.
    151151#define MAXIMUM_RAID_DEVS 32    ///< The maximum number of RAID devices in the raidlist.
     
    383383#define ARCH_BUFFER_NUM (ARCH_THREADS*4)    // Number of permissible queued afio files
    384384#define FORTY_SPACES "                                         "    ///< 40 spaces.
    385 #define PPCFG_RAMDISK_SIZE 250  ///< Size of the tmpfs, in megabytes, to attempt to mount (to speed up Mondo).
     385#define PPCFG_RAMDISK_SIZE 350  ///< Size of the tmpfs, in megabytes, to attempt to mount (to speed up Mondo).
    386386
    387387#define DO_MBR_PLEASE "/tmp/DO-MBR-PLEASE"
  • trunk/mondo/mondo/mondoarchive/mondo-cli.c

    r649 r687  
    805805        &&
    806806        !run_program_and_log_output
    807         ("egrep -i suse /etc/issue.net | egrep '9.0' | grep 64", TRUE)) {
     807        ("grep -Ei suse /etc/issue.net | grep -E '9.0' | grep 64", TRUE)) {
    808808        bkpinfo->make_cd_use_lilo = TRUE;
    809809        log_to_screen
  • trunk/mondo/mondo/mondorestore/mondo-prep.c

    r561 r687  
    18171817        log_msg(0,
    18181818                "------------------- end of fdisk.log... word! ------------------");
    1819         sprintf(tmp, "tail -n6 %s | fgrep \"16: \"", FDISK_LOG);
     1819        sprintf(tmp, "tail -n6 %s | grep -F \"16: \"", FDISK_LOG);
    18201820        if (!run_program_and_log_output(tmp, 5)) {
    18211821            g_partition_table_locked_up++;
  • trunk/mondo/mondo/mondorestore/mondo-restore.c

    r618 r687  
    19801980                filelist_name);
    19811981        log_msg(2,
    1982                 "This is a bit silly (ask dev-team to fix mondo-makefilelist, please)");
     1982                "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)");
    19831983        log_msg(2,
    19841984                "but it's non-critical. It's cosmetic. Don't worry about it.");
     
    19881988    if (count_lines_in_file(filelist_name) <= 0
    19891989        || length_of_file(tarball_fname) <= 0) {
    1990         log_msg(3, "length_of_file(%s) = %ld", tarball_fname,
     1990        log_msg(3, "length_of_file(%s) = %llu", tarball_fname,
    19911991                length_of_file(tarball_fname));
    19921992        sprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)",
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r561 r687  
    582582    }
    583583
    584     if (!run_program_and_log_output("mount | fgrep " MNT_CDROM, FALSE)) {
     584    if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
    585585        log_msg(2, "mount_cdrom() - CD already mounted. Fair enough.");
    586586        paranoid_free(mount_cmd);
  • trunk/mondo/mondo/mondorestore/mondoprep.h

    r561 r687  
    3939extern int strcmp_inc_numbers(char *, char *);
    4040extern long count_lines_in_file(char *);
    41 extern long long length_of_file(char *);
     41extern off_t length_of_file(char *);
    4242extern long noof_lines_that_match_wildcard(char *, char *);
    4343//extern char *slice_fname (long, long, bool, char *);
  • trunk/mondo/mondo/mondorestore/mr-externs.h

    r561 r687  
    3636extern void initialize_raid_record(struct raid_device_record *);
    3737extern bool is_this_device_mounted(char *);
    38 extern long long length_of_file(char *);
     38extern off_t length_of_file(char *);
    3939extern char *last_line_of_file(char *);
    4040extern struct s_node *load_filelist(char *);
  • trunk/mondo/mondo/restore-scripts/mondo/make-me-bootable

    r588 r687  
    1818
    1919HAVE_ACTIVE="false"
    20 for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -v "/dev/fd" | grep -v "none" | grep -v "#"` ; do
     20for i in `cat $1 | tr -s '\t' ' ' | cut -d' ' -f1 | grep -vE "/dev/fd|none|#"` ; do
    2121    mountpt=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f2`
    2222    format=`grep "$i " $1 | tr -s '\t' ' ' | cut -d' ' -f3`
  • trunk/mondo/mondo/restore-scripts/mondo/mount-me

    r588 r687  
    1414fi
    1515
    16 paths=`grep -v " raid " $mountlist | grep -v "lvm lvm" | tr -s ' ' ' ' | cut -d' ' -f2 | sort`
     16paths=`grep -vE " raid |lvm lvm" $mountlist | tr -s ' ' ' ' | cut -d' ' -f2 | sort`
    1717> $mountlist.sorted
    1818for i in $paths ; do
  • trunk/website/downloads.shtml

    r588 r687  
    8585        <li>Fedora <a href="ftp://ftp.mondorescue.org/fedora/4">Core 4</a> and <a href="ftp://ftp.mondorescue.org/fedora/5">Core 5</a>.</li>
    8686        <li>RedHat Enterprise Linux <!--<a href="ftp://ftp.mondorescue.org/rhel/2.1">2.1</a>, --><a href="ftp://ftp.mondorescue.org/rhel/3">3</a>, <a href="ftp://ftp.mondorescue.org/rhel/4">4</a>.</li>
    87         <li>OpenSuSE <a href="ftp://ftp.mondorescue.org/suse/9.3">9.3</a>, <a href="ftp://ftp.mondorescue.org/suse/10.0">10.0</a>. Look also at <a href="http://www.mikenjane.net/~mike/">this</a> web page for SuSE details.
     87        <li>OpenSuSE <a href="ftp://ftp.mondorescue.org/suse/9.3">9.3</a>, <a href="ftp://ftp.mondorescue.org/suse/10.0">10.0</a>. Look also at <a href="http://www.mikenjane.net/~mike/">this</a> web page for SuSE details. <a href="http://packman.links2linux.org/">Packman</a> may have some useful additional packages.
    8888        <li>SuSE Linux Enterprise Server <a href="ftp://ftp.mondorescue.org/sles/9">9</a>.</li>
    8989        <li>Debian <a href="ftp://ftp.mondorescue.org/debian/3.1">3.1</a>. Look also at <a href="http://www.desknow.com/desknow/directfiles/aleidenfrost/mr-debs-unofficial/index.html">this</a> web page for Debian details.</li>
Note: See TracChangeset for help on using the changeset viewer.