[FILE-6332] Enable testing for UUID usage with blkid command

This commit is contained in:
Michael Boelen 2016-07-30 14:10:29 +02:00
parent 220476d955
commit c74c572422
1 changed files with 7 additions and 7 deletions

View File

@ -221,21 +221,21 @@
REAL=""
UUID=""
LogText "Swap partition found: ${I}"
# YYY Add a test if partition is not a normal partition (e.g. UUID=)
# TODO Add a test if partition is not a normal partition (e.g. UUID=)
# Can be ^/dev/mapper/vg-name_lv-name
# Can be ^/dev/partition
# Can be ^UUID=uuid --> /dev/disk/by-uuid/<uuid>
# Test for UUID usage (e.g. UUID=uuid --> /dev/disk/by-uuid/<uuid>)
HAS_UUID=`echo ${I} | grep "^UUID="`
if [ ! "${HAS_UUID}" = "" ]; then
UUID=`echo ${HAS_UUID} | awk -F= '{ print $2 }'`
LogText "Result: Using ${UUID} as UUID"
if [ ! "${BLKIDBINARYx}" = "" ]; then
FIND2=`${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//'`
if [ ! "${BLKIDBINARY}" = "" ]; then
FIND2=$(${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//')
if [ ! "${FIND2}" = "" ]; then
REAL="${FIND2}"
REAL="${FIND2}"
fi
else
else
LogText "Result: blkid binary not found, trying by checking device listing"
sFILE=""
if [ -L /dev/disk/by-uuid/${UUID} ]; then
@ -245,7 +245,7 @@
REAL="${sFILE}"
LogText "Result: disk is ${REAL}"
fi
else
else
LogText "Result: no symlink found to /dev/disk/by-uuid/${UUID}"
fi
fi