]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
shutdown: guard against read-only /run
authorHarald Hoyer <harald@redhat.com>
Mon, 30 Nov 2015 10:27:03 +0000 (11:27 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 23 May 2016 10:49:32 +0000 (12:49 +0200)
remount the switch rooted /run writeable again.

(cherry picked from commit 54e09dfb72b557ac8ccd48f5d37089287d272ec7)

modules.d/99shutdown/module-setup.sh
modules.d/99shutdown/shutdown.sh

index 5361936e62d8c7d606786f4e95baa8503f142493..bdb337334acab00374fb3d2014648338d43807c1 100755 (executable)
@@ -13,7 +13,7 @@ depends() {
 
 install() {
     local _d
-    inst_multiple umount poweroff reboot halt losetup
+    inst_multiple umount poweroff reboot halt losetup stat
     inst_multiple -o kexec
     inst "$moddir/shutdown.sh" "$prefix/shutdown"
     [ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
index 1daf2ca3bf915e243f671cb6e5aa4818febb571e..bcb191bc8715da3d1fa789236cb0415484c9d7bd 100755 (executable)
@@ -14,6 +14,10 @@ export TERM=linux
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
 . /lib/dracut-lib.sh
 
+if [ "$(stat -c '%T' -f /)" = "tmpfs" ]; then
+    mount -o remount,rw /
+fi
+
 mkdir /oldsys
 for i in sys proc run dev; do
     mkdir /oldsys/$i