File open-iscsi-load-ibft-before-reading-sys-firmware of Package open-iscsi

Subject: Load modules for initrd at before reading /sys/firmware/ibft
From: Hannes Reinecke <hare@suse.de>
Date: Fri Dec 5 10:02:18 2008 +0100:
Git: c7af54f96479394d2175f01cbcb770a22db1005a

The iBFT firmware can only be read after the module has been
loaded, obviously. So move the module loading around.

Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/etc/mkinitrd/mkinitrd-boot.sh b/etc/mkinitrd/mkinitrd-boot.sh
index 9bd22ff..59294e5 100644
--- a/etc/mkinitrd/mkinitrd-boot.sh
+++ b/etc/mkinitrd/mkinitrd-boot.sh
@@ -49,6 +49,8 @@ tmp_InitiatorName="$(get_param InitiatorName)"
 # reads the InitiatorName variable
 . /etc/iscsi/initiatorname.iscsi
 
+load_modules
+
 # Check of iBFT settings
 if [ -d /sys/firmware/ibft/initiator ] ; then
     # only use the iBFT InitiatorName if the commandline argument is not "default"
@@ -69,13 +71,13 @@ echo "InitiatorName=$InitiatorName" > /etc/iscsi/initiatorname.iscsi
 
 unset iSCSI_warning_InitiatorName
 
-load_modules
-
 echo "Starting iSCSI daemon"
 /sbin/iscsid -n
 
-# log into iBFT nodes
-/sbin/iscsiadm -m fw -l
+if [ -d /sys/firmware/ibft/initiator ] ; then
+    # log into iBFT nodes
+    /sbin/iscsiadm -m fw -l
+fi
 
 # Check for command line sessions
 if [ -n "$TargetAddress" -a -n "$TargetName" ] ; then