Blob Blame History Raw
From 6d392317b87c316c9a0ac4dd064ecd9f99b7767e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 5 Feb 2014 13:08:54 +0100
Subject: [PATCH] systemd/dracut-pre-pivot: run for /dev/{nfs,root} and cleanup
 /dev/nfs

dracut-pre-pivot was not cleaning up /dev/nfs and did not run to clean
up /dev/root.
---
 modules.d/98systemd/dracut-pre-pivot.service | 2 ++
 modules.d/98systemd/dracut-pre-pivot.sh      | 1 +
 2 files changed, 3 insertions(+)

diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
index dd4e49b..6db1f2c 100644
--- a/modules.d/98systemd/dracut-pre-pivot.service
+++ b/modules.d/98systemd/dracut-pre-pivot.service
@@ -19,6 +19,8 @@ ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cleanup
 ConditionKernelCommandLine=|rd.break=pre-pivot
 ConditionKernelCommandLine=|rd.break=cleanup
 ConditionKernelCommandLine=|rd.break
+ConditionPathExists=|/dev/root
+ConditionPathExists=|/dev/nfs
 
 [Service]
 Environment=DRACUT_SYSTEMD=1
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index 8c7554e..e62a1ce 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -24,5 +24,6 @@ getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switc
 
 # remove helper symlink
 [ -h /dev/root ] && rm -f -- /dev/root
+[ -h /dev/nfs ] && rm -f -- /dev/nfs
 
 exit 0