dracut/0032-shutdown-shutdown.sh-mount-move-all-basic-mounts-out.patch
Harald Hoyer a20c0e9d68 dracut-026-33.git20130313
- add module-load.d modules to the initramfs
- add sysctl.d to the initramfs
- optimize plymouth module for systemd mode
- add new dracut parameter "--regenerate-all"
- add new dracut parameter "--noimageifnotneeded"
- shutdown: mount move /run /sys /dev /proc out of /oldroot
  before pre-shutdown
- add bash completion for dracut
2013-03-13 17:56:38 +01:00

41 lines
1.4 KiB
Diff

From fc4e10a8594e8c2d68dba233fa5ecc7d5babb5e1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 13 Mar 2013 17:45:37 +0100
Subject: [PATCH] shutdown/shutdown.sh: mount --move all basic mounts out of
/oldroot
After mount moving /dev away, apps like plymouth can do reexec with fd
passing of devices, which they want to keep open until the very end.
---
modules.d/99shutdown/shutdown.sh | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
index 202ecb1..6457cb0 100755
--- a/modules.d/99shutdown/shutdown.sh
+++ b/modules.d/99shutdown/shutdown.sh
@@ -14,6 +14,12 @@ export TERM=linux
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
. /lib/dracut-lib.sh
+mkdir /oldsys
+for i in sys proc run dev; do
+ mkdir /oldsys/$i
+ mount --move /oldroot/$i /oldsys/$i
+done
+
# if "kexec" was installed after creating the initramfs, we try to copy it from the real root
# libz normally is pulled in via kmod/modprobe and udevadm
if [ "$ACTION" = "kexec" ] && ! command -v kexec >/dev/null 2>&1; then
@@ -28,10 +34,6 @@ getarg 'rd.break=pre-shutdown' && emergency_shell --shutdown pre-shutdown "Break
source_hook pre-shutdown
-if ! ( [ -x /bin/plymouth ] && /bin/plymouth --quit ); then
- [ -x /oldroot/bin/plymouth ] && /oldroot/bin/plymouth --quit
-fi
-
warn "Killing all remaining processes"
killall_proc_mountpoint /oldroot