]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
90mdraid dracut-functions: fix md raid hostonly detection
authorAndy Lutomirski <luto@mit.edu>
Wed, 19 May 2010 06:13:12 +0000 (08:13 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 19 May 2010 06:13:12 +0000 (08:13 +0200)
check_block_and_slaves looks at slaves but not parents.

dracut-functions
modules.d/90mdraid/check

index fdcfb7e74f23ac326d5388bb1f8b397fc69405c8..7181d3f4c4b98724ba9e87aa8752fd85af7bf9f6 100755 (executable)
@@ -97,6 +97,9 @@ check_block_and_slaves() {
     [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
     "$1" $2 && return
     check_vol_slaves "$@" && return 0
+    if [[ -f "/sys/dev/block/$2/../dev" ]]; then
+       check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") &&  return 0
+    fi
     [[ -d /sys/dev/block/$2/slaves ]] || return 1
     for x in /sys/dev/block/$2/slaves/*/dev; do
         [[ -f $x ]] || continue
index be200e11de432b1d176bcfc85721ec049ca0b60a..cad3d0b62a2eab0d7f504da631020b71bbf96d32 100755 (executable)
@@ -6,7 +6,7 @@ which mdadm >/dev/null 2>&1 || exit 1
 . $dracutfunctions
 [[ $debug ]] && set -x
 
-is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
+is_mdraid() { [[ -d "/sys/dev/block/$1/md" ]]; }
 
 [[ $1 = '-h' ]] && {
     rootdev=$(find_root_block_device)
@@ -16,7 +16,7 @@ is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
        check_block_and_slaves is_mdraid "$rootdev" || exit 1
     else
        # root is not on a block device, use the shotgun approach
-       blkid | grep -q linux_raid || exit 1
+       blkid | egrep -q '(linux|isw)_raid' || exit 1
     fi
 }