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