Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
dracut
> 0151-fcoe-add-EDD-parsing.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0151-fcoe-add-EDD-parsing.patch of Package dracut
From 70dfe537d2167ebc7a32a2f42fe03cea40afb05b Mon Sep 17 00:00:00 2001 From: Harald Hoyer <harald@redhat.com> Date: Tue, 7 Dec 2010 16:55:06 +0100 Subject: [PATCH] fcoe: add EDD parsing --- dracut.8 | 8 ++++---- modules.d/95fcoe/install | 2 +- modules.d/95fcoe/installkernel | 2 +- modules.d/95fcoe/parse-fcoe.sh | 42 +++++++++++++++++++++++++++++++++++++----- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/dracut.8 b/dracut.8 index 45d3295..1139f75 100644 --- a/dracut.8 +++ b/dracut.8 @@ -358,10 +358,10 @@ will read the iscsi parameter from the BIOS firmware .SS FCoE .TP -.BR netroot= fcoe:<interface|MAC>:<dcb|nodcb> -Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC>, -for the second argument, currently only nodcb is supported. Note letters in -the MAC-address must be lowercase! +.BR fcoe=<edd|interface|MAC>:<dcb|nodcb> +Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC> or EDD settings. +Note letters in the MAC-address must be lowercase! +This parameter can be specified multiple times. .SS NBD .TP diff --git a/modules.d/95fcoe/install b/modules.d/95fcoe/install index db08a34..d022f6c 100755 --- a/modules.d/95fcoe/install +++ b/modules.d/95fcoe/install @@ -9,5 +9,5 @@ inst vconfig mkdir -p "$initdir/var/lib/lldpad" inst "$moddir/fcoe-up" "/sbin/fcoe-up" -inst_hook pre-udev 60 "$moddir/fcoe-genrules.sh" +inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh" inst_hook cmdline 99 "$moddir/parse-fcoe.sh" diff --git a/modules.d/95fcoe/installkernel b/modules.d/95fcoe/installkernel index 5ce7ca8..61c3607 100755 --- a/modules.d/95fcoe/installkernel +++ b/modules.d/95fcoe/installkernel @@ -1,2 +1,2 @@ #!/bin/bash -instmods fcoe 8021q +instmods fcoe 8021q edd diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh index 26a5a1a..52def0a 100755 --- a/modules.d/95fcoe/parse-fcoe.sh +++ b/modules.d/95fcoe/parse-fcoe.sh @@ -18,6 +18,9 @@ # 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 @@ -26,22 +29,51 @@ parse_fcoe_opts() { 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" +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 +else + warn "Invalid arguments for fcoe=$fcoe" fi -# FCoE actually supported? -[ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE" -- 1.8.3.1