]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi: find iscsi kernel modules by symbol names
authorHarald Hoyer <harald@redhat.com>
Wed, 4 May 2011 08:17:46 +0000 (10:17 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 4 May 2011 08:19:02 +0000 (10:19 +0200)
modules.d/95iscsi/module-setup.sh

index cddd4f388b2b6c3f826bd46d7b5c82c6ef499c5c..793a2430094d3886a35439653cdeb7aad9245449 100755 (executable)
@@ -13,7 +13,7 @@ check() {
 
     [[ $debug ]] && set -x
 
-    is_iscsi() ( 
+    is_iscsi() (
         [[ -L /sys/dev/block/$1 ]] || return
         cd "$(readlink -f /sys/dev/block/$1)"
         until [[ -d sys || -d iscsi_session ]]; do
@@ -25,7 +25,7 @@ check() {
     [[ $hostonly ]] && {
         rootdev=$(find_root_block_device)
         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
             check_block_and_slaves is_iscsi "$rootdev" || return 1
         else
@@ -40,12 +40,17 @@ depends() {
 }
 
 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() {
     dracut_install umount
-    inst iscsistart 
+    inst iscsistart
     inst hostname
     inst iscsi-iname
     inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"