95fcoe: use interface names instead of MAC addresses
Now that we are using persistent network names we can switch to using the interface names when specifying the fcoe configuration. With that we can print the fcoe configuration only once. Signed-off-by: Hannes Reinecke <hare@suse.com>master
parent
fd13d5d4d5
commit
164760f4b0
|
|
@ -41,7 +41,7 @@ get_vlan_parent() {
|
|||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
|
||||
{
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
read enabled < $c/enabled
|
||||
|
|
@ -54,12 +54,14 @@ cmdline() {
|
|||
fi
|
||||
d=$(cd -P $c; echo $PWD)
|
||||
i=${d%/*}
|
||||
ifname=${i##*/}
|
||||
read mac < ${i}/address
|
||||
s=$(dcbtool gc ${i##*/} dcb 2>/dev/null | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
||||
if [ -z "$s" ] ; then
|
||||
p=$(get_vlan_parent ${i})
|
||||
if [ "$p" ] ; then
|
||||
s=$(dcbtool gc ${p} dcb 2>/dev/null | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
||||
ifname=${p##*/}
|
||||
fi
|
||||
fi
|
||||
if [ "$s" = "on" ] ; then
|
||||
|
|
@ -81,8 +83,10 @@ cmdline() {
|
|||
[ $? -eq 0 ] && dcb="nodcb"
|
||||
fi
|
||||
|
||||
echo "fcoe=${mac}:${dcb}:${mode}"
|
||||
echo "ifname=${ifname}:${mac}"
|
||||
echo "fcoe=${ifname}:${dcb}:${mode}"
|
||||
done
|
||||
} | sort | uniq
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
|
|
|||
Loading…
Reference in New Issue