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


Ignore:
Timestamp:
Mar 14, 2012, 2:42:33 AM (12 years ago)
Author:
Bruno Cornec
Message:

r4564@localhost: bruno | 2012-03-13 00:55:09 +0100

  • Fix more #589 by removing fixed path for grep in mindi, and managing correctly paths for udev related binaries in mindi and rcS
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/mindi

    r2964 r2965  
    10811081        uuid=""
    10821082        absolute_partition=`readlink -f $c_p`
    1083         partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1083        partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    10841084
    10851085        # Detects noauto partitions not mounted and exclude them
    1086         partition_option=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $4}' | head -n1`
     1086        partition_option=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $4}' | head -n1`
    10871087        if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" =  "" ] ; then
    10881088            continue
     
    10941094        # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
    10951095        # current_partition contains only first column of /etc/fstab
    1096         if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then
     1096        if [ "`echo "$current_partition" | grep -i "LABEL="`" != "" ]; then
    10971097            redhat_label=`echo "$current_partition" | cut -d'=' -f2`
    10981098            actual_dev=""
     
    11051105            # 2nd try : blkid, the good way for all LABEL except swap
    11061106            if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then
    1107                 actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | cut -d':' -f1`
     1107                actual_dev=`/sbin/blkid | grep "$redhat_label" | grep LABEL= | cut -d':' -f1`
    11081108                # For LVM FS it will give a /dev/dm-# which should then be converted
    11091109                if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then
     
    11241124            # For LVM gives a /dev/mapper entry
    11251125            if [ "x$actual_dev" = "x" ]; then
    1126                 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | cut -d' ' -f1`
     1126                actual_dev=`/bin/mount -l | grep "\[$redhat_label\]" | cut -d' ' -f1`
    11271127            fi
    11281128   
     
    11301130            # SWAP only
    11311131            if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
    1132                 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | $AWK '{ print $1 }' `
     1132                list_swaps=`cat /proc/swaps | grep "/dev/" | $AWK '{ print $1 }' `
    11331133                for dev_swap in $list_swaps ; do
    1134                     dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"`
     1134                    dev_exists=`/sbin/vol_id $dev_swap | grep "$redhat_label"`
    11351135                    if [ "x$dev_exists" != "x" ]; then
    11361136                        actual_dev=$dev_swap
     
    11441144            # or could be a string that isn't a complete device name (eg. LABEL =SWAP-cciss/c0d0p)
    11451145            # SWAP only
    1146             if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then
     1146            if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then
    11471147                    skip=""
    11481148                    uname=$KERVERRUN
     
    11751175        # This part tries to retrieve the correct device from a UUID line in /etc/fstab
    11761176        # current_partition contains only first column of /etc/fstab
    1177         elif [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then
     1177        elif [ "`echo "$current_partition" | grep -i "UUID="`" != "" ]; then
    11781178            uuid=`echo "$current_partition" | cut -d'=' -f2`
    11791179            actual_dev=""
     
    11861186            # 2nd try : blkid, the good way for all UUID except swap
    11871187            if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then
    1188                 actual_dev=`/sbin/blkid | /bin/grep "$uuid" | grep UUID= | cut -d':' -f1`
     1188                actual_dev=`/sbin/blkid | grep "$uuid" | grep UUID= | cut -d':' -f1`
    11891189                # For LVM FS it will give a /dev/dm-# which should then be converted
    11901190                if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then
     
    12041204            # 3th try, with vol_id
    12051205            if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
    1206                 list_dev=`mount | /bin/grep -E '^/' | $AWK '{ print $1 }' `
     1206                list_dev=`mount | grep -E '^/' | $AWK '{ print $1 }' `
    12071207                for dev in $list_dev ; do
    1208                     dev_exists=`/sbin/vol_id $dev | /bin/grep "$uuid"`
     1208                    dev_exists=`/sbin/vol_id $dev | grep "$uuid"`
    12091209                    if [ "x$dev_exists" != "x" ]; then
    12101210                        actual_dev=$dev
     
    12161216            # 4th try, with dumpuuid (VMWare only ?) for swap
    12171217            if [ "x$actual_dev" = "x" -a -x "/sbin/dumpuuid" ]; then
    1218                 list_dev=`cat /proc/swaps | /bin/grep -E '^/' | $AWK '{ print $1 }' `
     1218                list_dev=`cat /proc/swaps | grep -E '^/' | $AWK '{ print $1 }' `
    12191219                for dev in $list_dev ; do
    1220                     dev_exists=`/sbin/dumpuuid $dev | /bin/grep "$uuid"`
     1220                    dev_exists=`/sbin/dumpuuid $dev | grep "$uuid"`
    12211221                    if [ "x$dev_exists" != "x" ]; then
    12221222                        actual_dev=$dev
     
    12371237            if [ _"$partition_mountpt" = _"" ]; then
    12381238                # set default in case we dont't find it
    1239                 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -Ev "^#" | $AWK '{print $1}'`; do
     1239                for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | grep -Ev "^#" | $AWK '{print $1}'`; do
    12401240                        if [ _"`readlink -f $tmpp`" = _"$current_partition" ]; then
    12411241                            str_to_find_fmt_with=$tmpp
    1242                             partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$tmpp" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1242                            partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$tmpp" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    12431243                            break;
    12441244                        fi
     
    25442544            tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib/udev analysis" $MINDI_TMP/$$.log
    25452545        fi
    2546         if [ -x /sbin/udevd ]; then
     2546        if [ -x /sbin/udevd ] || [ -x /usr/bin/udevd ]; then
    25472547            lis2=`grep -Ev '^#' $DEPLIST_DIR/udev.conf`
    25482548            lis=""
     
    25722572            rm -f $MINDI_TMP/udev.lis
    25732573        else
    2574             LogAll "WARNING: udevd daemon not in standard place (/sbin)"
     2574            LogAll "WARNING: udevd daemon not in standard place (/sbin or /usr/bin)"
    25752575            LogAll "         mindi will use static devices which may cause problems"
    25762576            rm -f $mountpoint/tmp/USE-UDEV
Note: See TracChangeset for help on using the changeset viewer.