summaryrefslogtreecommitdiff
path: root/modules.d/95fcoe/fcoe-edd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/95fcoe/fcoe-edd.sh')
-rwxr-xr-xmodules.d/95fcoe/fcoe-edd.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules.d/95fcoe/fcoe-edd.sh b/modules.d/95fcoe/fcoe-edd.sh
new file mode 100755
index 00000000..5a81a2e3
--- /dev/null
+++ b/modules.d/95fcoe/fcoe-edd.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+dcb=$1
+
+if ! [ -d /sys/firmware/edd ]; then
+ modprobe edd
+ while ! [ -d /sys/firmware/edd ]; do sleep 0.1; done
+fi
+
+for disk in /sys/firmware/edd/int13_*; do
+ [ -d $disk ] || continue
+ for nic in ${disk}/pci_dev/net/*; do
+ [ -d $nic ] || continue
+ if [ -e ${nic}/address ]; then
+ fcoe_interface=${nic##*/}
+ if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then
+ /sbin/fcoe-up $fcoe_interface $dcb
+ > "/tmp/.fcoe-$fcoe_interface"
+ fi
+ fi
+ done
+done
+modprobe -r edd