Changeset 608 in MondoRescue


Ignore:
Timestamp:
Jun 2, 2006, 9:19:18 PM (18 years ago)
Author:
bcornec
Message:

Fixes 2 bugs in mindi introduced by the label swap handling.
Fixes provided by "Naber, Peter" <peter.naber_at_alfa.de>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r587 r608  
    13141314   
    13151315    if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then
    1316     echo -en "\rAnalyzing LVM...\r"
    1317     all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
     1316        echo -en "\rAnalyzing LVM...\r"
     1317        all_partitions=`$MINDI_LIB/analyze-my-lvm | fgrep ">>>" | cut -d' ' -f2-32`
    13181318    fi
    13191319    all_partitions="$all_partitions `ListAllPartitions 2> /dev/null`"
     
    13261326    for c_p in $all_partitions ; do
    13271327#        echo "c_p = $c_p" > /dev/stderr
    1328     [ "`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
     1328        [ "`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
    13291329        [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$c_p"`" ] && continue
    1330     [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
    1331     if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then
    1332         current_partition=`ResolveSoftlink $c_p`
    1333         [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p"
    1334         [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue
    1335     else
    1336         current_partition="$c_p"
    1337     fi
    1338     [ "$c_p" = "none" ] && continue
    1339     absolute_partition=`ResolveSoftlink $c_p`
    1340     partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    1341 
    1342     # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
    1343     # current_partition contains only first column of /etc/fstab
    1344     if [ "`echo "$current_partition" | /bin/grep -f -i "LABEL="`" != "" ] ; then
    1345         str_to_find_fmt_with=$current_partition
    1346         redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2`
    1347         actual_dev=""
    1348 
     1330        [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
     1331        if [ -h "$c_p" ] && [ "`echo "$c_p" | fgrep "/dev/hd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/sd"`" = "" ] && [ "`echo "$c_p" | fgrep "/dev/md"`" = "" ] ; then
     1332            current_partition=`ResolveSoftlink $c_p`
     1333            [ "`echo "$current_partition" | fgrep "/dev/mapper"`" != "" ] && current_partition="$c_p"
     1334            [ "`echo "/dev/scd0 /dev/scd1 /dev/sr0 /dev/sr1 /dev/cdrom /dev/cdrom1" | fgrep "$current_partition"`" ] && continue
     1335        else
     1336            current_partition="$c_p"
     1337        fi
     1338        [ "$c_p" = "none" ] && continue
     1339        absolute_partition=`ResolveSoftlink $c_p`
     1340        partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1341
     1342        # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
     1343        # current_partition contains only first column of /etc/fstab
     1344        if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ] ; then
     1345            str_to_find_fmt_with=$current_partition
     1346            redhat_label=`echo "$current_partition" | /bin/cut -d'=' -f2`
     1347            actual_dev=""
     1348   
    13491349        # 1st try : blkid, the good way
    13501350        if [ -x "/sbin/blkid" ] ; then
     
    13541354        # 2nd try, which works on a standard partition (ext2/3), but not on swap
    13551355        if [ "x$actual_dev" = "x" ] ; then
    1356             actual_dev=`/bin/mount -l | /bin/grep " [$redhat_label]" | /bin/cut -d' ' -f1`
     1356            actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`
    13571357        fi
    13581358
Note: See TracChangeset for help on using the changeset viewer.