Browse Source

iscsi/module-setup.sh: fix host-only/mount checks

master
Harald Hoyer 13 years ago
parent
commit
cb08b0132f
  1. 16
      modules.d/95iscsi/module-setup.sh

16
modules.d/95iscsi/module-setup.sh

@ -15,8 +15,11 @@ check() {
[[ $debug ]] && set -x [[ $debug ]] && set -x


is_iscsi() ( is_iscsi() (
[[ -L /sys/dev/block/$1 ]] || return local _dev
cd "$(readlink -f /sys/dev/block/$1)" _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 until [[ -d sys || -d iscsi_session ]]; do
cd .. cd ..
done done
@ -24,14 +27,7 @@ check() {
) )


[[ $hostonly ]] || [[ $mount_needs ]] && { [[ $hostonly ]] || [[ $mount_needs ]] && {
_rootdev=$(find_root_block_device) for_each_host_dev_fs is_iscsi || return 1
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
} }
return 0 return 0
} }

Loading…
Cancel
Save