summaryrefslogtreecommitdiff
path: root/kflash.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kflash.sh')
-rwxr-xr-xkflash.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/kflash.sh b/kflash.sh
index dd3a7d9..e5f59ee 100755
--- a/kflash.sh
+++ b/kflash.sh
@@ -193,8 +193,12 @@ probe_device() {
local part_label=${flash_part[1]}
local part_dev=/dev/${partdev}${part_idx}
- local label=$(blkid ${part_dev} -s PARTLABEL | sed 's/.*PARTLABEL="\([^"]*\)"$/\1/')
- if [[ $label != ${part_label} ]] ; then
+ local label=$(blkid ${part_dev} -o value -s PARTLABEL)
+ if [[ -z "$label" ]] ; then
+ label=$(blkid ${part_dev} -o value -s LABEL)
+ fi
+
+ if [[ "$label" != ${part_label} ]] ; then
echo "Partition ${part_dev} has label '$label', expected '${part_label}'" >&2
return
fi