]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi/module-setup.sh: fix host-only/mount checks
authorHarald Hoyer <harald@redhat.com>
Wed, 25 Apr 2012 09:23:10 +0000 (11:23 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 25 Apr 2012 13:58:40 +0000 (15:58 +0200)
modules.d/95iscsi/module-setup.sh

index 2f343ee85207ec798d59d790f6dc033bc435af21..bfd9d7347416d91add32f43c0e329546f7876375 100755 (executable)
@@ -15,8 +15,11 @@ check() {
     [[ $debug ]] && set -x
 
     is_iscsi() (
-        [[ -L /sys/dev/block/$1 ]] || return
-        cd "$(readlink -f /sys/dev/block/$1)"
+        local _dev
+        _dev=$(get_maj_min $1)
+
+        [[ -L /sys/dev/block/$_dev ]] || return
+        cd "$(readlink -f /sys/dev/block/$_dev)"
         until [[ -d sys || -d iscsi_session ]]; do
             cd ..
         done
@@ -24,14 +27,7 @@ check() {
     )
 
     [[ $hostonly ]] || [[ $mount_needs ]] && {
-        _rootdev=$(find_root_block_device)
-        if [[ $_rootdev ]]; then
-            # root lives on a block device, so we can be more precise about
-            # hostonly checking
-            check_block_and_slaves is_iscsi "$_rootdev" || return 1
-        else
-            return 1
-        fi
+        for_each_host_dev_fs is_iscsi || return 1
     }
     return 0
 }