Changeset 2965 in MondoRescue for branches/3.0/mindi/mindi
- Timestamp:
- Mar 14, 2012, 2:42:33 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/mindi/mindi
r2964 r2965 1081 1081 uuid="" 1082 1082 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` 1084 1084 1085 1085 # 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` 1087 1087 if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" = "" ] ; then 1088 1088 continue … … 1094 1094 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1095 1095 # current_partition contains only first column of /etc/fstab 1096 if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then1096 if [ "`echo "$current_partition" | grep -i "LABEL="`" != "" ]; then 1097 1097 redhat_label=`echo "$current_partition" | cut -d'=' -f2` 1098 1098 actual_dev="" … … 1105 1105 # 2nd try : blkid, the good way for all LABEL except swap 1106 1106 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` 1108 1108 # For LVM FS it will give a /dev/dm-# which should then be converted 1109 1109 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1124 1124 # For LVM gives a /dev/mapper entry 1125 1125 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` 1127 1127 fi 1128 1128 … … 1130 1130 # SWAP only 1131 1131 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 }' ` 1133 1133 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"` 1135 1135 if [ "x$dev_exists" != "x" ]; then 1136 1136 actual_dev=$dev_swap … … 1144 1144 # or could be a string that isn't a complete device name (eg. LABEL =SWAP-cciss/c0d0p) 1145 1145 # SWAP only 1146 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | /bin/grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then1146 if [ "x$actual_dev" = "x" -a _"`echo $current_partition | grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then 1147 1147 skip="" 1148 1148 uname=$KERVERRUN … … 1175 1175 # This part tries to retrieve the correct device from a UUID line in /etc/fstab 1176 1176 # current_partition contains only first column of /etc/fstab 1177 elif [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then1177 elif [ "`echo "$current_partition" | grep -i "UUID="`" != "" ]; then 1178 1178 uuid=`echo "$current_partition" | cut -d'=' -f2` 1179 1179 actual_dev="" … … 1186 1186 # 2nd try : blkid, the good way for all UUID except swap 1187 1187 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` 1189 1189 # For LVM FS it will give a /dev/dm-# which should then be converted 1190 1190 if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then … … 1204 1204 # 3th try, with vol_id 1205 1205 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 }' ` 1207 1207 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"` 1209 1209 if [ "x$dev_exists" != "x" ]; then 1210 1210 actual_dev=$dev … … 1216 1216 # 4th try, with dumpuuid (VMWare only ?) for swap 1217 1217 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 }' ` 1219 1219 for dev in $list_dev ; do 1220 dev_exists=`/sbin/dumpuuid $dev | /bin/grep "$uuid"`1220 dev_exists=`/sbin/dumpuuid $dev | grep "$uuid"` 1221 1221 if [ "x$dev_exists" != "x" ]; then 1222 1222 actual_dev=$dev … … 1237 1237 if [ _"$partition_mountpt" = _"" ]; then 1238 1238 # set default in case we dont't find it 1239 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -Ev "^#" | $AWK '{print $1}'`; do1239 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | grep -Ev "^#" | $AWK '{print $1}'`; do 1240 1240 if [ _"`readlink -f $tmpp`" = _"$current_partition" ]; then 1241 1241 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` 1243 1243 break; 1244 1244 fi … … 2544 2544 tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in /lib/udev analysis" $MINDI_TMP/$$.log 2545 2545 fi 2546 if [ -x /sbin/udevd ] ; then2546 if [ -x /sbin/udevd ] || [ -x /usr/bin/udevd ]; then 2547 2547 lis2=`grep -Ev '^#' $DEPLIST_DIR/udev.conf` 2548 2548 lis="" … … 2572 2572 rm -f $MINDI_TMP/udev.lis 2573 2573 else 2574 LogAll "WARNING: udevd daemon not in standard place (/sbin )"2574 LogAll "WARNING: udevd daemon not in standard place (/sbin or /usr/bin)" 2575 2575 LogAll " mindi will use static devices which may cause problems" 2576 2576 rm -f $mountpoint/tmp/USE-UDEV
Note:
See TracChangeset
for help on using the changeset viewer.