<title>FCoE</title>
<variablelist>
<varlistentry>
- <term><envar>netroot=</envar><constant>fcoe</constant>:<replaceable><interface|MAC></replaceable>:<replaceable>{dcb|nodcb}</replaceable></term>
+ <term><envar>fcoe=</envar><replaceable><edd|interface|MAC></replaceable>:<replaceable>{dcb|nodcb}</replaceable></term>
<listitem>
- <para>Try to connect to a FCoE SAN through the NIC specified by <replaceable><interface></replaceable> or <replaceable><MAC></replaceable>,
-for the second argument, currently only nodcb is supported. <remark>Note: letters in the MAC-address must be lowercase!</remark></para>
+ <para>Try to connect to a FCoE SAN through the NIC specified by <replaceable><interface></replaceable> or <replaceable><MAC></replaceable> or EDD settings.
+For the second argument, currently only nodcb is supported. This parameter can be specified multiple times. <remark>Note: letters in the MAC-address must be lowercase!</remark></para>
</listitem>
</varlistentry>
</variablelist>
}
installkernel() {
- instmods fcoe 8021q
+ instmods fcoe 8021q edd
}
install() {
mkdir -p "$initdir/var/lib/lldpad"
inst "$moddir/fcoe-up" "/sbin/fcoe-up"
+ inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
inst_hook pre-udev 60 "$moddir/fcoe-genrules.sh"
inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
}
# If it's not set we don't continue
[ -z "$fcoe" ] && return
+# FCoE actually supported?
+[ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
+
parse_fcoe_opts() {
local IFS=:
set $fcoe
2)
fcoe_interface=$1
fcoe_dcb=$2
+ return 0
;;
7)
fcoe_mac=$1:$2:$3:$4:$5:$6
fcoe_dcb=$7
+ return 0
;;
*)
- die "Invalid arguments for fcoe="
+ warn "Invalid arguments for fcoe=$fcoe"
+ return 1
;;
esac
}
parse_fcoe_opts
-if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then
- die "Invalid FCoE DCB option: $fcoe_dcb"
-fi
-
-# FCoE actually supported?
-[ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
+if [ "$fcoe_interface" = "edd" ]; then
+ if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then
+ warn "Invalid FCoE DCB option: $fcoe_dcb"
+ fi
+ [ -d /sys/firmware/edd ] || modprobe edd
+ # parse edd interfaces
+ 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
+ unset fcoe_mac
+ unset fcoe_interface
+ fcoe_mac=$(cat ${nic}/address)
+ [ -n "$fcoe_mac" ] && source /sbin/fcoe-genrules.sh
+ fi
+ done
+ done
+else
+ for fcoe in $(getargs fcoe=); do
+ unset fcoe_mac
+ unset fcoe_interface
+ parse_fcoe_opts
+ if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then
+ warn "Invalid FCoE DCB option: $fcoe_dcb"
+ fi
+ source /sbin/fcoe-genrules.sh
+ done
+fi
\ No newline at end of file