712866
From 1ad2884d82f15e9d1a6f3e24da42d56f47ebe949 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Tue, 16 Jun 2015 13:28:48 +0200
712866
Subject: [PATCH] dracut-pre-pivot: call udevadm settle one last time
712866
712866
Some Hardware needs initialization and killing modprobe or modprobe
712866
scripts would harm the process.
712866
---
712866
 modules.d/98systemd/dracut-pre-pivot.service |  7 -------
712866
 modules.d/98systemd/dracut-pre-pivot.sh      | 12 ++++++++++++
712866
 2 files changed, 12 insertions(+), 7 deletions(-)
712866
712866
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
5c6c2a
index d7c7b1d7..f4539006 100644
712866
--- a/modules.d/98systemd/dracut-pre-pivot.service
712866
+++ b/modules.d/98systemd/dracut-pre-pivot.service
712866
@@ -16,13 +16,6 @@ Before=initrd-cleanup.service
712866
 Wants=remote-fs.target
712866
 After=remote-fs.target
712866
 ConditionPathExists=/etc/initrd-release
712866
-ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-pivot
712866
-ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cleanup
712866
-ConditionKernelCommandLine=|rd.break=pre-pivot
712866
-ConditionKernelCommandLine=|rd.break=cleanup
712866
-ConditionKernelCommandLine=|rd.break
712866
-ConditionPathExists=|/dev/root
712866
-ConditionPathExists=|/dev/nfs
712866
 
712866
 [Service]
712866
 Environment=DRACUT_SYSTEMD=1
712866
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
5c6c2a
index e62a1cec..afe34668 100755
712866
--- a/modules.d/98systemd/dracut-pre-pivot.sh
712866
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
712866
@@ -26,4 +26,16 @@ getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switc
712866
 [ -h /dev/root ] && rm -f -- /dev/root
712866
 [ -h /dev/nfs ] && rm -f -- /dev/nfs
712866
 
712866
+udevadm settle
712866
+
712866
+cnt=0
712866
+while ! udevadm settle --timeout=0; do
712866
+    info "udev still not settled. Waiting."
712866
+    udevadm settle
712866
+    cnt=$(($cnt+1))
712866
+    [ $cnt -gt 10 ] && break
712866
+done
712866
+
712866
+udevadm control --exit
712866
+
712866
 exit 0