- Timestamp:
- May 5, 2006, 11:52:49 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0.8/mindi/mindi
r519 r525 1338 1338 [ "$c_p" = "none" ] && continue 1339 1339 absolute_partition=`ResolveSoftlink $c_p` 1340 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" |grep -vx " *#.*" | $AWK '{print $2}' | head -n1`1340 partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1` 1341 1341 1342 1342 # This part tries to retrieve the correct device from a LABEL line in /etc/fstab 1343 1343 # current_partition contains only first column of /etc/fstab 1344 redhat_label=""1345 1344 if [ "`echo "$current_partition" | /bin/grep -f -i "LABEL="`" != "" ] ; then 1346 1345 str_to_find_fmt_with=$current_partition … … 1350 1349 # 1st try : blkid, the good way 1351 1350 if [ -x "/sbin/blkid" ] ; then 1352 actual_dev=`/sbin/blkid | grep "$current_partition" | /bin/cut -d':' -f1` 1353 fi 1351 actual_dev=`/sbin/blkid | /bin/grep "$current_partition" | /bin/cut -d':' -f1` 1352 fi 1353 1354 1354 # 2nd try, which works on a standard partition (ext2/3), but not on swap 1355 if [ $actual_dev=""] ; then1355 if [ -n $actual_dev ] ; then 1356 1356 actual_dev=`/bin/mount -l | /bin/grep " [$redhat_label]" | /bin/cut -d' ' -f1` 1357 1357 fi 1358 1358 1359 # 3rd try, with vol_id (which works with swap) 1359 if [ $actual_dev=""-a -x "/sbin/vol_id" ] ; then1360 if [ -n $actual_dev -a -x "/sbin/vol_id" ] ; then 1360 1361 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | /bin/awk '{ print $1 }' ` 1361 1362 for dev_swap in $list_swaps ; do 1362 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep -f"$redhat_label"`1363 dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"` 1363 1364 if [ -n "$dev_exists" ] ; then 1364 1365 actual_dev=$dev_swap … … 1367 1368 done 1368 1369 fi 1370 1369 1371 # 4th try : pre-formated LABEL. Format is : LABEL=SWAP-mydevice. e.g. : LABEL=SWAP-hda5 1370 if [ $actual_dev="" -a "`echo "$current_partition" | /bin/grep -f -i "LABEL=SWAP"`" != ""] ; then 1371 actual_dev="/dev/`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1372 fi 1372 if [ -n $actual_dev -a "`echo "$current_partition" | /bin/grep -i "LABEL=SWAP"`" != ""] ; then 1373 try_dev="`echo "$redhat_label" | /bin/cut -d '-' -f2`" 1374 present_dev="`/bin/cat /proc/swaps | /bin/grep -w /dev/$try_dev`" 1375 if [ -n "$present_dev" ] ; then 1376 actual_dev="/dev/$try_dev" 1377 fi 1378 fi 1379 1373 1380 # Check if one of all those tries has known success 1374 if [ $actual_dev != ""] ; then1381 if [ ! -n $actual_dev ] ; then 1375 1382 current_partition=$actual_dev 1376 1383 else 1377 Die "Your system uses a labelled swap partition, but you lack the tool to su 1378 pport it.\nPlease replace swap labels with their correct devices in /etc/fstab\n" 1384 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" 1379 1385 fi 1380 1386 else
Note:
See TracChangeset
for help on using the changeset viewer.