From 99df3d22be14690260371311086a439c83fdc6b4 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 2 Aug 2018 16:32:41 +0200
Subject: [PATCH] mdraid/parse-md.sh: also accept rd.md.uuid with ":"
convert rd.md.uuid=32ef2172:f056:6fa7:66a8:2f7fc8b1798
to udev rules in the correct UUID format 32ef2172-f056-6fa7-66a8-2f7fcf8b1798
---
modules.d/90mdraid/parse-md.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh
index c422b24e..428f9515 100755
--- a/modules.d/90mdraid/parse-md.sh
+++ b/modules.d/90mdraid/parse-md.sh
@@ -14,6 +14,9 @@ else
if [ "${line%%UUID CHECK}" != "$line" ]; then
printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
for uuid in $MD_UUID; do
+ uuid=$(str_replace "$uuid" "-" "")
+ uuid=$(str_replace "$uuid" ":" "")
+ uuid="$(expr substr $uuid 1 8)-$(expr substr $uuid 9 4)-$(expr substr $uuid 13 4)-$(expr substr $uuid 17 4)-$(expr substr $uuid 21 12)"
printf 'ENV{MD_UUID}=="%s", GOTO="md_uuid_ok"\n' $uuid
printf 'ENV{ID_FS_UUID}=="%s", GOTO="md_uuid_ok"\n' $uuid
done;
@@ -29,6 +32,7 @@ else
if strstr "$uuid" "-"; then
# convert ID_FS_UUID to MD_UUID format
uuid=$(str_replace "$uuid" "-" "")
+ uuid=$(str_replace "$uuid" ":" "")
uuid="$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)"
fi
wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}"