Skip to content

Commit f265cb6

Browse files
committed
mdraid: fix case if rd.md.uuid is in ID_FS_UUID format
if rd.md.uuid is in ID_FS_UUID format with dashes e40a0234-7e52-5f10-f267-658d8ec463fa convert it for the /dev/disk/by-id/md-uuid-${uuid} format e40a0234:7e525f10:f267658d:8ec463fa
1 parent f98d306 commit f265cb6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

modules.d/90mdraid/module-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
check() {
55
local _rootdev
66
# No mdadm? No mdraid support.
7-
require_binaries mdadm || return 1
7+
require_binaries mdadm expr || return 1
88

99
[[ $hostonly ]] || [[ $mount_needs ]] && {
1010
for dev in "${!host_fs_types[@]}"; do
@@ -65,7 +65,7 @@ cmdline() {
6565
# called by dracut
6666
install() {
6767
local rule rule_path
68-
inst_multiple cat
68+
inst_multiple cat expr
6969
inst_multiple -o mdmon
7070
inst $(command -v partx) /sbin/partx
7171
inst $(command -v mdadm) /sbin/mdadm

modules.d/90mdraid/parse-md.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ else
2626
mv "${f}.new" "$f"
2727
done
2828
for uuid in $MD_UUID; do
29+
if strstr "$uuid" "-"; then
30+
# convert ID_FS_UUID to MD_UUID format
31+
uuid=$(str_replace "$uuid" "-" "")
32+
uuid="$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)"
33+
fi
2934
wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}"
3035
done
3136
fi

0 commit comments

Comments
 (0)