Blame SOURCES/0378-shutdown-guard-against-read-only-run.patch

18971c
From 8fb06a05624d8aaa067b61b70ecbbbd90fc0f88e Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Mon, 30 Nov 2015 11:27:03 +0100
18971c
Subject: [PATCH] shutdown: guard against read-only /run
18971c
18971c
remount the switch rooted /run writeable again.
18971c
18971c
(cherry picked from commit 54e09dfb72b557ac8ccd48f5d37089287d272ec7)
18971c
---
18971c
 modules.d/99shutdown/module-setup.sh | 2 +-
18971c
 modules.d/99shutdown/shutdown.sh     | 4 ++++
18971c
 2 files changed, 5 insertions(+), 1 deletion(-)
18971c
18971c
diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh
18971c
index 5361936e..bdb33733 100755
18971c
--- a/modules.d/99shutdown/module-setup.sh
18971c
+++ b/modules.d/99shutdown/module-setup.sh
18971c
@@ -13,7 +13,7 @@ depends() {
18971c
 
18971c
 install() {
18971c
     local _d
18971c
-    inst_multiple umount poweroff reboot halt losetup
18971c
+    inst_multiple umount poweroff reboot halt losetup stat
18971c
     inst_multiple -o kexec
18971c
     inst "$moddir/shutdown.sh" "$prefix/shutdown"
18971c
     [ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
18971c
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
18971c
index 1daf2ca3..bcb191bc 100755
18971c
--- a/modules.d/99shutdown/shutdown.sh
18971c
+++ b/modules.d/99shutdown/shutdown.sh
18971c
@@ -14,6 +14,10 @@ export TERM=linux
18971c
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
18971c
 . /lib/dracut-lib.sh
18971c
 
18971c
+if [ "$(stat -c '%T' -f /)" = "tmpfs" ]; then
18971c
+    mount -o remount,rw /
18971c
+fi
18971c
+
18971c
 mkdir /oldsys
18971c
 for i in sys proc run dev; do
18971c
     mkdir /oldsys/$i