aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2011-11-24 14:27:24 +0100
committerTom Gundersen <teg@jklm.no>2011-11-26 12:38:59 +0100
commit3dbbd1e28eb12171be6c8c76098a5da579724d5b (patch)
treebd752ecb6ef03844f128bf13cc09838bdd137103 /rc.sysinit
parent5c97cee2732ec21790e40f391de664bcd64eeb1b (diff)
downloadinitscripts-3dbbd1e28eb12171be6c8c76098a5da579724d5b.tar.xz
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 <teg@jklm.no>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit10
1 files changed, 6 insertions, 4 deletions
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