]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions: check for existance of slave devices before opening it
authorHarald Hoyer <harald@redhat.com>
Wed, 19 Aug 2009 15:08:57 +0000 (17:08 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 19 Aug 2009 15:08:57 +0000 (17:08 +0200)
dracut-functions

index 1df20456c3f168b7f0fa1f504408fb29b0d2c417..75c2e10a6abaf640426441747249b644fc26a8ac 100755 (executable)
@@ -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