Browse Source

90mdraid dracut-functions: fix md raid hostonly detection

check_block_and_slaves looks at slaves but not parents.
master
Andy Lutomirski 14 years ago committed by Harald Hoyer
parent
commit
a3afcf2a5a
  1. 3
      dracut-functions
  2. 4
      modules.d/90mdraid/check

3
dracut-functions

@ -97,6 +97,9 @@ check_block_and_slaves() { @@ -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

4
modules.d/90mdraid/check

@ -6,7 +6,7 @@ which mdadm >/dev/null 2>&1 || exit 1 @@ -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'; } @@ -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
}


Loading…
Cancel
Save