- Timestamp:
- May 5, 2006, 11:46:38 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r515 r523 1390 1390 [ "$c_p" = "none" ] && continue 1391 1391 absolute_partition=`ResolveSoftlink $c_p` 1392 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" |grep -vx " *#.*" | $AWK '{print $2}' | head -n1`1392 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1393 1393 1394 1394 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1395 1395 # current_partition contains only first column of /etc/fstab 1396 redhat_label=""1397 1396 if [ "`echo "$current_partition" | /bin/grep -f -i "LABEL="`" != "" ] ; then 1398 1397 str_to_find_fmt_with=$current_partition … … 1402 1401 # 1st try : blkid, the good way 1403 1402 if [ -x "/sbin/blkid" ] ; then 1404 actual_dev=`/sbin/blkid | grep "$current_partition" | /bin/cut -d':' -f1` 1405 fi 1403 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1` 1404 fi 1405 1406 1406 # 2nd try, which works on a standard partition (ext2/3), but not on swap 1407 if [ $actual_dev=""] ; then1407 if [ -n $actual_dev ] ; then 1408 1408 actual_dev=`/bin/mount -l | /bin/grep " [$redhat_label]" | /bin/cut -d' ' -f1` 1409 1409 fi 1410 1410 1411 # 3rd try, with vol_id (which works with swap) 1411 if [ $actual_dev=""-a -x "/sbin/vol_id" ] ; then1412 if [ -n $actual_dev -a -x "/sbin/vol_id" ] ; then 1412 1413 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' ` 1413 1414 for dev_swap in $list_swaps ; do 1414 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep -f"$redhat_label"`1415 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"` 1415 1416 if [ -n "$dev_exists" ] ; then 1416 1417 actual_dev=$dev_swap … … 1419 1420 done 1420 1421 fi 1422 1421 1423 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5 1422 if [ $actual_dev="" -a "`echo "$current_partition" | /bin/grep -f -i "LABEL=SWAP"`" != ""] ; then 1423 actual_dev="/dev/`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1424 fi 1424 if [ -n $actual_dev -a "`echo "$current_partition" | /bin/grep -i "LABEL=SWAP"`" != ""] ; then 1425 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1426 present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`" 1427 if [ -n "$present_dev" ] ; then 1428 actual_dev="/dev/$try_dev" 1429 fi 1430 fi 1431 1425 1432 # Check if one of all those tries has known success 1426 if [ $actual_dev != ""] ; then1433 if [ ! -n $actual_dev ] ; then 1427 1434 current_partition=$actual_dev 1428 1435 else 1429 Die "Your system uses a labelled swap partition, but you lack the tool to su 1430 pport it.\nPlease replace swap labels with their correct devices in /etc/fstab\n" 1436 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" 1431 1437 fi 1432 1438 else
Note:
See TracChangeset
for help on using the changeset viewer.