From: Harald Hoyer Date: Mon, 30 Nov 2015 10:27:03 +0000 (+0100) Subject: shutdown: guard against read-only /run X-Git-Tag: 045~217 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=54e09dfb72b557ac8ccd48f5d37089287d272ec7;p=thirdparty%2Fdracut.git shutdown: guard against read-only /run remount the switch rooted /run writeable again. --- diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh index b80a82c92..5cb3594a8 100755 --- a/modules.d/99shutdown/module-setup.sh +++ b/modules.d/99shutdown/module-setup.sh @@ -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 diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh index afee05158..918a8a4f1 100755 --- a/modules.d/99shutdown/shutdown.sh +++ b/modules.d/99shutdown/shutdown.sh @@ -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