diff options
-rw-r--r-- | functions | 6 | ||||
-rwxr-xr-x | rc.sysinit | 10 |
2 files changed, 11 insertions, 5 deletions
@@ -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) @@ -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 |