From a7e5be34a306e3763d814944d87cb8f04873b54f Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Mon, 28 Jun 2010 15:17:00 +0200 Subject: [PATCH 2/3] Extract correct session information for iBFT connections iBFT (or any firmware-initiated session) do not have any information in the internal database, so we can't currently display them via 'iscsiadm -m node'. So we need to add a fallback to the init script to retrieve the correct information. References: bnc#617883 Signed-off-by: Hannes Reinecke --- etc/initd/initd.suse | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse index 2067fd3..9c82223 100644 --- a/etc/initd/initd.suse +++ b/etc/initd/initd.suse @@ -94,7 +94,13 @@ iscsi_get_ifacename_from_session() ifacename=$(iscsiadm -m session -r ${session##.*/session} 2> /dev/null | \ sed -n 's/iface.iscsi_ifacename = \(.*\)/\1/p') - + if [ -z "$ifacename" ] ; then + # Check for iBFT + ifacename=$(iscsiadm -m fw 2> /dev/null) + if [ -n "$ifacename" ] ; then + ifacename="fw" + fi + fi echo $ifacename } @@ -103,7 +109,16 @@ iscsi_get_hwaddress_from_iface() local iface=$1 local hwaddress - hwaddress=$(iscsiadm -m iface -I "$ifacename" 2> /dev/null | sed -n 's/iface.hwaddress = \(.*\)/\1/p') + hwaddress=$(iscsiadm -m iface -I "$iface" 2> /dev/null | sed -n 's/iface.hwaddress = \(.*\)/\1/p') + + echo $hwaddress +} + +iscsi_get_ifname_from_firmware() +{ + local hwaddress + + hwaddress=$(iscsiadm -m fw 2> /dev/null | sed -n 's/iface.net_ifacename = \(.*\)/\1/p') echo $hwaddress } @@ -152,6 +167,9 @@ iscsi_check_interface() [ -z "$i" ] && continue if [ "$i" = "default" ] ; then iscsi_modify_all_interfaces + elif [ "$i" = "fw" ] ; then + n=$(iscsi_get_ifname_from_firmware) + iscsi_modify_if_startmode $n else h=$(iscsi_get_hwaddress_from_iface $i) if [ -n "$h" ] ; then -- 1.6.6.1