From: Harald Hoyer Date: Wed, 19 Aug 2009 15:08:57 +0000 (+0200) Subject: dracut-functions: check for existance of slave devices before opening it X-Git-Tag: 001~34^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9defc609e87eece19d1a26dd00b8524565608d62;p=thirdparty%2Fdracut.git dracut-functions: check for existance of slave devices before opening it --- diff --git a/dracut-functions b/dracut-functions index 1df20456c..75c2e10a6 100755 --- a/dracut-functions +++ b/dracut-functions @@ -72,9 +72,11 @@ check_block_and_slaves() { [[ -d /sys/dev/block/$2/slaves ]] || return 1 # we want to search the tree breadthwise, so... for x in /sys/dev/block/$2/slaves/*/dev; do + [[ -f $x ]] || continue $1 $(cat "$x") && return 0 done for x in /sys/dev/block/$2/slaves/*/dev; do + [[ -f $x ]] || continue check_block_and_slaves $1 $(cat "$x") && return 0 done return 1