From 3dbbd1e28eb12171be6c8c76098a5da579724d5b Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 24 Nov 2011 14:27:24 +0100 Subject: fsck: skip remounting / fsck'ing the root fs In case the initramfs already fsck'ed and mounted the root fs ro, we don't remount ro and fsck. We still remount the rootfs rw unconditionally at the end. We should probably stop doing this and require the user to specify rw/ro explicitly in fstab. We assume that the initramfs will also fsck and mount /usr, so we do not fsck any mounted fs (not restricted to the rootfs). Signed-off-by: Tom Gundersen --- rc.sysinit | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'rc.sysinit') diff --git a/rc.sysinit b/rc.sysinit index 654a409..6455566 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -24,10 +24,12 @@ mountpoint -q /dev/pts || mount -n /dev/pts &>/dev/null || mountpoint -q /dev/shm || mount -n /dev/shm &>/dev/null || mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev -# remount root ro to allow for fsck later on, we remount now to -# make sure nothing can open files rw on root which would block a remount -findmnt / --options ro &>/dev/null || - status "Mounting Root Read-Only" mount -n -o remount,ro / +if [[ ! -e /run/initramfs/fsck-root ]]; then + # remount root ro to allow for fsck later on, we remount now to + # make sure nothing can open files rw on root which would block a remount + findmnt / --options ro &>/dev/null || + status "Mounting Root Read-Only" mount -n -o remount,ro / +fi run_hook sysinit_start -- cgit v1.2.3