]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
mdraid/parse-md.sh: also accept rd.md.uuid with ":"
authorHarald Hoyer <harald@redhat.com>
Thu, 2 Aug 2018 14:32:41 +0000 (16:32 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 2 Aug 2018 14:32:41 +0000 (16:32 +0200)
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

index c422b24e0829be758feac5d23bbbf3e8cb3c2ef3..428f95158982ef8ec3bdbe423e14bdd418ea3038 100755 (executable)
@@ -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}"