Changeset 729 in MondoRescue for trunk/mindi/mindi


Ignore:
Timestamp:
Jul 30, 2006, 4:06:39 PM (14 years ago)
Author:
Bruno Cornec
Message:

merge -r686:728 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/mindi

    r687 r729  
    124124FLOPPY_MODS="ide-floppy floppy"
    125125TAPE_MODS="ht st osst ide-tape ide_tape"
    126 SCSI_MODS="3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs"
     126SCSI_MODS="3w-xxxx 53c7,8xx a100u2w a320raid aacraid advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi isp megaraid mptbase mptscsih NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qlogicfas qlogicfc qlogicisp raw1394 scsi_debug scsi_mod sd_mod seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs"
    127127
    128128# ide-probe-mod
     
    821821    done
    822822    if  [ "$incoming" = "LVMFILES:" ] ; then
    823     incoming=`ReadLine`
    824     lvmversion=""
     823        incoming=`ReadLine`
     824        lvmversion=""
    825825    while [ "$incoming" != "" ] ; do
    826826        if echo "$incoming" | grep -x " *#.*" &> /dev/null ; then
    827 #       echo "Skipping '$incoming'"
    828         incoming=`ReadLine`
    829         continue
     827            incoming=`ReadLine`
     828            continue
    830829        fi
    831830        filelist=`GenerateListForFile "$incoming"`
     
    833832            lvmresolved=`ResolveSoftlink $tool`
    834833            if [ "$tool" == "$lvmresolved" ]; then
    835             echo "$tool" >> $tempfile
     834                echo "$tool" >> $tempfile
    836835            elif echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then
    837             if [ "$lvmversion" = "" ] ; then
    838             lvmversion=`$lvmresolved`
    839             echo "$lvmresolved" >> $tempfile
    840             fi
    841             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
    853             toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped
    854             if [ -e "$toolpath" ] ; then
    855             echo "$toolpath" >> $tempfile
    856             echo "$tool" >> $tempfile
    857             else
    858             toolpath="/lib/lvm-"$lvmversion"/"$toolstripped
    859             fi
    860             if [ -e "$toolpath" ] ; then
    861             echo "$toolpath" >> $tempfile
    862             echo "$tool" >> $tempfile
    863             else
    864             echo "Where are your LVM-Tools? Couldn't find $tool"
    865             fi
    866         else
    867             echo "$tool" >> $tempfile
    868         fi
     836                if [ "$lvmversion" = "" ] ; then
     837                    lvmversion=`$lvmresolved`
     838                    echo "$lvmresolved" >> $tempfile
     839                fi
     840                toolstripped=`echo $tool | $AWK -F / '{print $NF;}'`
     841                if [ "$lvmversion" == "200" ]; then
     842                    # pvdata and lvmcreate_initrd don't exist in LVM2
     843                    case "$toolstripped" in
     844                    "pvdata")
     845                        continue
     846                        ;;
     847                    "lvmcreate_initrd")
     848                        continue
     849                        ;;
     850                    esac
     851                fi
     852                toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped
     853                if [ -e "$toolpath" ] ; then
     854                    echo "$toolpath" >> $tempfile
     855                    echo "$tool" >> $tempfile
     856                else
     857                    toolpath="/lib/lvm-"$lvmversion"/"$toolstripped
     858                fi
     859                if [ -e "$toolpath" ] ; then
     860                    echo "$toolpath" >> $tempfile
     861                    echo "$tool" >> $tempfile
     862                else
     863                    echo "Where are your LVM-Tools? Couldn't find $tool"
     864                fi
     865            else
     866                echo "$tool" >> $tempfile
     867            fi
    869868        done
    870869        progress=$(($progress+1))
     
    13891388    [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`"
    13901389    printf "        %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)"
     1390    useless_dev="/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 /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1"
    13911391    for c_p in $all_partitions ; do
    13921392#        echo "c_p = $c_p" > /dev/stderr
    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
     1393        [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] && continue
    13951394        [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
    13961395        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
    13971396            current_partition=`ResolveSoftlink $c_p`
    13981397            [ "`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
     1398            [ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue
    14001399        else
    14011400            current_partition="$c_p"
    14021401        fi
    14031402        [ "$c_p" = "none" ] && continue
     1403        redhat_label=""
    14041404        absolute_partition=`ResolveSoftlink $c_p`
    14051405        partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1406
     1407        # Detects noauto partitions not mounted and exclude them
     1408        partition_option=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $4}' | head -n1`
     1409        if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" =  "" ] ; then
     1410            continue
     1411        fi
    14061412
    14071413        # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
     
    14121418            actual_dev=""
    14131419   
    1414         # 1st try : blkid, the good way
    1415         if [ -x "/sbin/blkid" ]; then
    1416             actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1`
    1417         fi
    1418 
    1419         # 2nd try, which works on a standard partition (ext2/3), but not on swap
    1420         if [ "x$actual_dev" = "x" ]; then
    1421             actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`
    1422         fi
    1423 
    1424         # 3rd try, with vol_id (which works with swap)
    1425         if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
     1420            # 1st try : blkid, the good way
     1421            if [ -x "/sbin/blkid" ]; then
     1422                actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1`
     1423            fi
     1424   
     1425            # 2nd try, which works on a standard partition (ext2/3), but not on swap
     1426            if [ "x$actual_dev" = "x" ]; then
     1427                actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | /bin/cut -d' ' -f1`
     1428            fi
     1429   
     1430            # 3rd try, with vol_id (which works with swap)
     1431            if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
    14261432                list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' `
    14271433                for dev_swap in $list_swaps ; do
     
    14321438                    fi
    14331439                done
    1434         fi
    1435 
    1436         # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5
    1437         if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then
     1440            fi
     1441
     1442            # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5
     1443            if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -i 'LABEL=SWAP'`" != _"" ]; then
    14381444                try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`"
    14391445                present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`"
     
    14411447                    actual_dev="/dev/$try_dev"
    14421448                fi
    1443         fi
    1444 
    1445         # Check if one of all those tries has known success
    1446         if [ "x$actual_dev" != "x" ]; then
     1449            fi
     1450
     1451            # Check if one of all those tries has known success
     1452            if [ "x$actual_dev" != "x" ]; then
    14471453                current_partition=$actual_dev
     1454            else
     1455                Die "Your system uses a labelled swap partition, but you lack the tool to support it.\nPlease replace swap labels with their correct devices in /etc/fstab or install blkid|vol_id\n"
     1456            fi
    14481457        else
    1449             Die "Your system uses a labelled swap partition, but you lack the tool to support it.\nPlease replace swap labels with their correct devices in /etc/fstab\n"
    1450         fi
    1451     else
    1452         str_to_find_fmt_with=$current_partition
    1453     fi
     1458            str_to_find_fmt_with=$current_partition
     1459        fi
    14541460
    14551461    partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
     
    15521558    elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then
    15531559        if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then
    1554         partition_mountpt=raid
    1555         partition_format=raid
     1560            partition_mountpt=raid
     1561            partition_format=raid
    15561562            printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label"
    1557                 printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist
     1563            printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist
    15581564        else
    1559         echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE
     1565            echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE
    15601566        fi
    15611567        elif [ "$partition_format" = "" ] ; then
Note: See TracChangeset for help on using the changeset viewer.