]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Revert "dracut-functions: $_x should exist, no need to test."
authorChao Wang <chaowang@redhat.com>
Wed, 1 Aug 2012 03:23:42 +0000 (11:23 +0800)
committerHarald Hoyer <harald@redhat.com>
Wed, 1 Aug 2012 07:24:12 +0000 (09:24 +0200)
This reverts commit b2d225a6698607bbcb73b6e6d12fbfc5be014102.

When there's no /sys/dev/block/$2/slaves/*/dev/ exists, $_x will
be assigned with '/sys/dev/block/$2/slaves/*/dev/', this is invalid.
That commit will lead to some warn msg like:
cat: /sys/dev/block/8:16/slaves/*/dev: No such file or directory
cat: /sys/dev/block/8:32/slaves/*/dev: No such file or directory

dracut-functions.sh

index a299bbb6f93e06c61ce49520623cf32ef14206c7..2ad8f4af7bbd73f848c45900985eb2ab3d6d9255 100755 (executable)
@@ -423,6 +423,7 @@ check_block_and_slaves() {
     fi
     [[ -d /sys/dev/block/$2/slaves ]] || return 1
     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