From 6ea10962cfb581e79616f476ec1fe8707b0f73ef Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 14 May 2008 14:00:23 -0400 Subject: Make resolve_dm_raid() work when your original raid was set up with parameters generated by an older dmraid's "dmraid -ay --test". --- rc.d/init.d/functions | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index bb943963..fed1fafa 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -584,6 +584,13 @@ resolve_dm_name() { done line=$(echo "$line" | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' \ -e 's/ core [12] [[:digit:]]\+ / core [12] [[:digit:]]\\+ /') + # XXX PJFIX -- this method of handling extra parameters is really just + # asking for failure -- the better way would be to make + # dmsetup or dmraid be able to do resolve_dm_name for us. + if [ "$(echo $line | awk '{ print $3 }')" == "mirror" ]; then + line=$(echo "$line" | sed \ + -e 's/ 1 [[:alpha:]][[:alnum:]_]\+$/\\($\\|&$\\)/') + fi /sbin/dmsetup table | \ sed -n -e "s/.*\(no block devices found\|No devices found\).*//" \ -e "s/\(^[^:]\+\): $line\( \+$\|$\)/\1/p" -- cgit v1.2.1