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