summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-12-30 15:46:11 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2010-12-30 15:46:11 +0100
commit7a80bca9bed235df9b2b2d3ca01c0fe765201154 (patch)
tree315cbfd509600303727be44de9662c22c0633ae6
parentbb48417ae29b466962882d6d738d86d5f83e64df (diff)
bugfix: allow any kind of blockdevice to be queried for uuid/label, not just hd/sd partitions
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh
index 742245f..298c4d2 100644
--- a/src/core/libs/lib-blockdevices-filesystems.sh
+++ b/src/core/libs/lib-blockdevices-filesystems.sh
@@ -190,8 +190,8 @@ $ANSWER_DEVICES"
# returns: nothing
getuuid()
{
- [ -z "$1" ] && die_error "getuuid needs an argument"
- [ "${1%%/[hs]d?[0-9]}" != "${1}" ] && echo "$(blkid -s UUID -o value ${1})"
+ [ -n "$1" -a -b "$1" ] || die_error "getuuid needs a device file argument"
+ echo "$(blkid -s UUID -o value ${1})"
}
@@ -201,8 +201,8 @@ getuuid()
# returns: nothing
getlabel()
{
- [ -z "$1" ] && die_error "getlabel needs an argument"
- [ "${1%%/[hs]d?[0-9]}" != "${1}" ] && echo "$(blkid -s LABEL -o value ${1})"
+ [ -n "$1" -a -b "$1" ] || die_error "getlabel needs a device file argument"
+ echo "$(blkid -s LABEL -o value ${1})"
}
# find partitionable blockdevices