From 9defc609e87eece19d1a26dd00b8524565608d62 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 19 Aug 2009 17:08:57 +0200 Subject: dracut-functions: check for existance of slave devices before opening it --- dracut-functions | 2 ++ 1 file changed, 2 insertions(+) (limited to 'dracut-functions') diff --git a/dracut-functions b/dracut-functions index 1df20456..75c2e10a 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 -- cgit v1.2.3