]>
Commit | Line | Data |
---|---|---|
3508cc81 | 1 | #!/bin/sh |
cc02093d HH |
2 | # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
3 | # ex: ts=8 sw=4 sts=4 et filetype=sh | |
3508cc81 HG |
4 | # |
5 | # We get called like this: | |
fb59f4c9 | 6 | # fcoe-up <network-device> <dcb|nodcb> |
3508cc81 HG |
7 | # |
8 | # Note currently only nodcb is supported, the dcb option is reserved for | |
9 | # future use. | |
10 | ||
fb59f4c9 | 11 | PATH=/usr/sbin:/usr/bin:/sbin:/bin |
37b14e72 | 12 | |
3508cc81 HG |
13 | # Huh? Missing arguments ?? |
14 | [ -z "$1" -o -z "$2" ] && exit 1 | |
15 | ||
e54a8411 | 16 | export PS4="fcoe-up.$1.$$ + " |
7eb40c48 | 17 | exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe |
c9f1e3d1 | 18 | type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh |
e54a8411 | 19 | |
3508cc81 HG |
20 | netif=$1 |
21 | dcb=$2 | |
22 | ||
fb59f4c9 | 23 | ip link set "$netif" up |
91d83940 HH |
24 | wait_for_if_up "$netif" |
25 | ||
f6783bee HH |
26 | netdriver=$(readlink -f /sys/class/net/$netif/device/driver) |
27 | netdriver=${netdriver##*/} | |
28 | ||
37b14e72 HG |
29 | if [ "$dcb" = "dcb" ]; then |
30 | # Note lldpad will stay running after switchroot, the system initscripts | |
31 | # are to kill it and start a new lldpad to take over. Data is transfered | |
32 | # between the 2 using a shm segment | |
33 | lldpad -d | |
3272ed88 HH |
34 | # stupid tools, need sleep |
35 | sleep 1 | |
37b14e72 | 36 | dcbtool sc "$netif" dcb on |
3272ed88 | 37 | sleep 1 |
37b14e72 | 38 | dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 |
3272ed88 | 39 | sleep 1 |
37b14e72 | 40 | fipvlan "$netif" -c -s |
f6783bee HH |
41 | elif [ "$netdriver" = "bnx2x" ]; then |
42 | # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan | |
43 | modprobe 8021q | |
44 | udevadm settle --timeout=30 | |
45 | fipvlan "$netif" -c -s | |
37b14e72 HG |
46 | else |
47 | echo -n "$netif" > /sys/module/fcoe/parameters/create | |
48 | fi | |
fb67e4aa HH |
49 | |
50 | need_shutdown |