]> 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, 30 Nov 2015 10:27:03 +0000 (11:27 +0100)
remount the switch rooted /run writeable again.

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

index b80a82c9273ae2a647f821d2f4c37fcaf309ebdd..5cb3594a891fbfcf8b57822d879150ed814652d3 100755 (executable)
@@ -14,7 +14,7 @@ depends() {
 # called by dracut
 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 afee0515886b17ad0229345a5cb6e60581c7e495..918a8a4f123578e39f38404670d5cbe3e3436bb3 100755 (executable)
@@ -12,6 +12,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