]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
95fcoe: start lldpad separately
authorHannes Reinecke <hare@suse.de>
Thu, 11 Dec 2014 14:46:24 +0000 (15:46 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 29 Jun 2016 09:50:56 +0000 (11:50 +0200)
lldpad is a system-wide process, which must be started only once.
So we should be separate it from fcoe-up, as it might be called
several times.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
(cherry picked from commit 22e837b6458d5d17d1cb6a9b09b7515746d4e098)

modules.d/95fcoe/fcoe-up.sh
modules.d/95fcoe/lldpad.sh [new file with mode: 0644]
modules.d/95fcoe/module-setup.sh

index 823d7accc30bff3016590c58766b5b529bb0bd36..1d62570ec42a5f84a0f98318ca4627159f0dd3bf 100755 (executable)
@@ -43,10 +43,6 @@ write_fcoemon_cfg() {
 }
 
 if [ "$dcb" = "dcb" ]; then
-    # Note lldpad will stay running after switchroot, the system initscripts
-    # are to kill it and start a new lldpad to take over. Data is transfered
-    # between the 2 using a shm segment
-    lldpad -d
     # wait for lldpad to be ready
     i=0
     while [ $i -lt 60 ]; do
@@ -56,10 +52,6 @@ if [ "$dcb" = "dcb" ]; then
         i=$(($i+1))
     done
 
-    # on some systems lldpad needs some time
-    # sleep until we find a better solution
-    sleep 30
-
     while [ $i -lt 60 ]; do
         dcbtool sc "$netif" dcb on && break
         info "Retrying to turn dcb on"
diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh
new file mode 100644 (file)
index 0000000..d06a3bd
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Note lldpad will stay running after switchroot, the system initscripts
+# are to kill it and start a new lldpad to take over. Data is transfered
+# between the 2 using a shm segment
+lldpad -d
+# wait for lldpad to be ready
+i=0
+while [ $i -lt 60 ]; do
+    lldptool -p && break
+    info "Waiting for lldpad to be ready"
+    sleep 1
+    i=$(($i+1))
+done
index ba10b0ab156b37327676b44760f4727ecb31df76..c000b3be7d67bbad17d1bd291192f97486ad3d35 100755 (executable)
@@ -36,6 +36,7 @@ install() {
     inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up"
     inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
     inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
+    inst_hook pre-trigger 03 "$moddir/lldpad.sh"
     inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
     inst_hook cleanup 90 "$moddir/cleanup-fcoe.sh"
     dracut_need_initqueue