aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2008-05-14 14:26:49 -0400
committerPeter Jones <pjones@pjones2.localdomain>2008-05-14 14:26:49 -0400
commit8222b504ba5ca258b82f6949b80597b424e1f908 (patch)
treea879286082011d5a4de500e425413c550847b5e3 /rc.d/init.d/functions
parent29f9a502cdd3535203f8dcd37e60b8cdc6a6e700 (diff)
downloadinitscripts-8222b504ba5ca258b82f6949b80597b424e1f908.tar
initscripts-8222b504ba5ca258b82f6949b80597b424e1f908.tar.gz
initscripts-8222b504ba5ca258b82f6949b80597b424e1f908.tar.bz2
initscripts-8222b504ba5ca258b82f6949b80597b424e1f908.tar.xz
initscripts-8222b504ba5ca258b82f6949b80597b424e1f908.zip
Make resolve_dm_raid() work when your original raid was set up with
parameters generated by an older dmraid's "dmraid -ay --test".
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions7
1 files changed, 7 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 57340fb6..d54861da 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -564,6 +564,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"