64b87c
From 69c437dd1c3b877f60ced307068e01619124fef4 Mon Sep 17 00:00:00 2001
64b87c
From: Harald Hoyer <harald@redhat.com>
64b87c
Date: Tue, 18 Aug 2015 12:27:32 +0200
64b87c
Subject: [PATCH] fcoe: cleanup lldpad
64b87c
64b87c
Resolves: rhbz#1246217
64b87c
---
64b87c
 modules.d/95fcoe/cleanup-fcoe.sh | 10 ++++++++++
64b87c
 modules.d/95fcoe/module-setup.sh |  1 +
64b87c
 2 files changed, 11 insertions(+)
64b87c
 create mode 100644 modules.d/95fcoe/cleanup-fcoe.sh
64b87c
64b87c
diff --git a/modules.d/95fcoe/cleanup-fcoe.sh b/modules.d/95fcoe/cleanup-fcoe.sh
64b87c
new file mode 100644
64b87c
index 0000000..5ff4d05
64b87c
--- /dev/null
64b87c
+++ b/modules.d/95fcoe/cleanup-fcoe.sh
64b87c
@@ -0,0 +1,10 @@
64b87c
+#!/bin/sh
64b87c
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
64b87c
+# ex: ts=8 sw=4 sts=4 et filetype=sh
64b87c
+
64b87c
+if [ -e /var/run/lldpad.pid ]; then
64b87c
+    lldpad -k
64b87c
+    mkdir -m 0755 -p /run/initramfs/state/dev/shm
64b87c
+    cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1
64b87c
+    echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab
64b87c
+fi
64b87c
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
64b87c
index ec573ea..646cfa8 100755
64b87c
--- a/modules.d/95fcoe/module-setup.sh
64b87c
+++ b/modules.d/95fcoe/module-setup.sh
64b87c
@@ -28,6 +28,7 @@ install() {
64b87c
     inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
64b87c
     inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
64b87c
     inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
64b87c
+    inst_hook cleanup 90 "$moddir/cleanup-fcoe.sh"
64b87c
     dracut_need_initqueue
64b87c
 }
64b87c