Blame 0032-shutdown-shutdown.sh-mount-move-all-basic-mounts-out.patch

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