aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--functions6
-rwxr-xr-xrc.sysinit10
2 files changed, 11 insertions, 5 deletions
diff --git a/functions b/functions
index 8f9a5d2..74719db 100644
--- a/functions
+++ b/functions
@@ -428,7 +428,11 @@ NETFS="nfs,nfs4,smbfs,cifs,codafs,ncpfs,shfs,fuse,fuseblk,glusterfs,davfs,fuse.g
# Check local filesystems
fsck_all() {
- fsck -A -T -C"$FSCK_FD" -a -t "no${NETFS//,/,no},noopts=_netdev" $FORCEFSCK
+ if [[ -e /run/initramfs/root-fsck ]]; then
+ IGNORE_MOUNTED="-M"
+ fi
+
+ fsck -A -T -C${FSCK_FD} -a -t no${NETFS//,/,no},noopts=_netdev ${FORCEFSCK} ${IGNORE_MOUNTED}
}
# Single-user login and/or automatic reboot after fsck (if needed)
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