Blame SOURCES/0121-systemd-dracut-pre-pivot-run-for-dev-nfs-root-and-cl.patch

966cef
From 6d392317b87c316c9a0ac4dd064ecd9f99b7767e Mon Sep 17 00:00:00 2001
966cef
From: Harald Hoyer <harald@redhat.com>
966cef
Date: Wed, 5 Feb 2014 13:08:54 +0100
966cef
Subject: [PATCH] systemd/dracut-pre-pivot: run for /dev/{nfs,root} and cleanup
966cef
 /dev/nfs
966cef
966cef
dracut-pre-pivot was not cleaning up /dev/nfs and did not run to clean
966cef
up /dev/root.
966cef
---
966cef
 modules.d/98systemd/dracut-pre-pivot.service | 2 ++
966cef
 modules.d/98systemd/dracut-pre-pivot.sh      | 1 +
966cef
 2 files changed, 3 insertions(+)
966cef
966cef
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
966cef
index dd4e49b..6db1f2c 100644
966cef
--- a/modules.d/98systemd/dracut-pre-pivot.service
966cef
+++ b/modules.d/98systemd/dracut-pre-pivot.service
966cef
@@ -19,6 +19,8 @@ ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cleanup
966cef
 ConditionKernelCommandLine=|rd.break=pre-pivot
966cef
 ConditionKernelCommandLine=|rd.break=cleanup
966cef
 ConditionKernelCommandLine=|rd.break
966cef
+ConditionPathExists=|/dev/root
966cef
+ConditionPathExists=|/dev/nfs
966cef
 
966cef
 [Service]
966cef
 Environment=DRACUT_SYSTEMD=1
966cef
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
966cef
index 8c7554e..e62a1ce 100755
966cef
--- a/modules.d/98systemd/dracut-pre-pivot.sh
966cef
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
966cef
@@ -24,5 +24,6 @@ getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switc
966cef
 
966cef
 # remove helper symlink
966cef
 [ -h /dev/root ] && rm -f -- /dev/root
966cef
+[ -h /dev/nfs ] && rm -f -- /dev/nfs
966cef
 
966cef
 exit 0