iscsi: find iscsi kernel modules by symbol names

This commit is contained in:
Harald Hoyer 2011-05-04 10:17:46 +02:00
parent 424ecce632
commit 7c18802966

View File

@ -13,7 +13,7 @@ check() {
[[ $debug ]] && set -x [[ $debug ]] && set -x
is_iscsi() ( is_iscsi() (
[[ -L /sys/dev/block/$1 ]] || return [[ -L /sys/dev/block/$1 ]] || return
cd "$(readlink -f /sys/dev/block/$1)" cd "$(readlink -f /sys/dev/block/$1)"
until [[ -d sys || -d iscsi_session ]]; do until [[ -d sys || -d iscsi_session ]]; do
@ -25,7 +25,7 @@ check() {
[[ $hostonly ]] && { [[ $hostonly ]] && {
rootdev=$(find_root_block_device) rootdev=$(find_root_block_device)
if [[ $rootdev ]]; then if [[ $rootdev ]]; then
# root lives on a block device, so we can be more precise about # root lives on a block device, so we can be more precise about
# hostonly checking # hostonly checking
check_block_and_slaves is_iscsi "$rootdev" || return 1 check_block_and_slaves is_iscsi "$rootdev" || return 1
else else
@ -40,12 +40,17 @@ depends() {
} }
installkernel() { installkernel() {
instmods iscsi_tcp crc32c iscsi_ibft be2iscsi bnx2 bnx2x bnx2i instmods iscsi_tcp iscsi_ibft crc32c
iscsi_module_test() {
local iscsifuncs='iscsi_register_transport'
fgrep -q "$iscsifuncs" "$1"
}
instmods $(filter_kernel_modules iscsi_module_test)
} }
install() { install() {
dracut_install umount dracut_install umount
inst iscsistart inst iscsistart
inst hostname inst hostname
inst iscsi-iname inst iscsi-iname
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh" inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"