]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
shutdown/shutdown.sh: mount --move all basic mounts out of /oldroot
authorHarald Hoyer <harald@redhat.com>
Wed, 13 Mar 2013 16:45:37 +0000 (17:45 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 13 Mar 2013 16:45:37 +0000 (17:45 +0100)
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

index 202ecb1c1641b0ee37a846c23a0fc89795cee700..6457cb0b64edff1e2ca0e029c1a819ec3b10037e 100755 (executable)
@@ -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