Changeset 2965 in MondoRescue
- Timestamp:
- Mar 14, 2012, 2:42:33 AM (12 years ago)
- Location:
- branches/3.0/mindi
- Files:
-
- 2 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 -
branches/3.0/mindi/rootfs/etc/init.d/rcS
r2964 r2965 322 322 ps | grep -v grep |grep udevd 2> /dev/null 1> /dev/null 323 323 if [ $? -ne 0 ]; then 324 /sbin/udevd --daemon & 324 if [ -x /sbin/udevd ]; then 325 /sbin/udevd --daemon & 326 elif [ -x /usr/bin/udevd ]; then 327 /usr/bin/udevd --daemon & 328 fi 325 329 echo "Waiting for udev to start..." 326 330 sleep 5 … … 337 341 /sbin/udevsettle --timeout=10 338 342 LogIt "Discovering with udevsettle" 339 elif [ -x /sbin/udevadm ] ; then340 UdevadmTrigger341 /sbin/udevadmsettle --timeout=10343 elif [ -x /sbin/udevadm ] || [ -x /usr/bin/udevadm ]; then 344 ua=`UdevadmTrigger` 345 $ua settle --timeout=10 342 346 LogIt "Discovering with udevadm" 343 347 fi … … 709 713 UdevadmTrigger() { 710 714 715 # This function should just echo the return value $ua 716 711 717 if [ -x /sbin/udevadm ]; then 712 v=`/sbin/udevadm --version` 713 echo "Triggering udev again..." 714 if [ "$v" -ge "146" ]; then 715 /sbin/udevadm trigger --type=failed 718 ua="/sbin/udevadm" 719 elif [ -x /usr/bin/udevadm ]; then 720 ua="/usr/bin/udevadm" 721 else 722 LogIt "WARNING: Unable to find udevadm. Not triggering udev" 723 ua="/bin/true" 724 fi 725 726 v="`$ua --version`" 727 728 if [ -x "$v" ]; then 729 LogIt "Triggering udev again..." 730 if [ "$v" -ge "146" -a "$v" -lt "174" ]; then 731 $ua trigger --type=failed 732 elif [ "$v" -lt "146" ]; then 733 $ua trigger --retry-failed 716 734 else 717 /sbin/udevadm trigger --retry-failed 718 fi 719 fi 735 LogIt "... not needed" 736 fi 737 fi 738 echo $ua 720 739 } 721 740 … … 733 752 # (useful for rules creating network ifcfg files) 734 753 if [ -e "/tmp/USE-UDEV" ] ; then 735 UdevadmTrigger754 ua=`UdevadmTrigger` 736 755 fi 737 756 } … … 940 959 # Not sure it's still needed, but shouldn't hurt 941 960 if [ -e "/tmp/USE-UDEV" ] ; then 942 UdevadmTrigger961 ua=`UdevadmTrigger` 943 962 fi 944 963 if grep "backup-media-type" /tmp/mondo-restore.cfg > /dev/null 2> /dev/null ; then
Note:
See TracChangeset
for help on using the changeset viewer.