From c74c57242220daac0799717c556134d87cf6b5fb Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 30 Jul 2016 14:10:29 +0200 Subject: [PATCH] [FILE-6332] Enable testing for UUID usage with blkid command --- include/tests_filesystems | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/tests_filesystems b/include/tests_filesystems index 479a5d367..eecb621bf 100644 --- a/include/tests_filesystems +++ b/include/tests_filesystems @@ -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/ + # Test for UUID usage (e.g. UUID=uuid --> /dev/disk/by-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