aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-03-17 11:12:55 +0100
committerTom Gundersen <teg@jklm.no>2012-03-17 11:12:55 +0100
commit28ec5b76ca5cbb53ec9d5de73749dbe76db7611a (patch)
tree348487f6793990154e1e7aeeb10fe4e6c6ef9bf5 /functions
parente3050bd87ec873bc4ac1dc21c42c7abd02c3b408 (diff)
downloadinitscripts-28ec5b76ca5cbb53ec9d5de73749dbe76db7611a.tar.xz
fsck: move FORCEFSCK/FASTBOOT logic to fsck_all
Avoid global variables, and make things clearer. Signed-off-by: Tom Gundersen <teg@jklm.no>
Diffstat (limited to 'functions')
-rw-r--r--functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/functions b/functions
index 0b7fd8d..747e42d 100644
--- a/functions
+++ b/functions
@@ -428,6 +428,12 @@ NETFS="nfs,nfs4,smbfs,cifs,codafs,ncpfs,shfs,fuse,fuseblk,glusterfs,davfs,fuse.g
# Check local filesystems
fsck_all() {
+ [[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-f"
+
+ if [[ ! -n $FORCEFSCK ]] && { [[ -f /fastboot ]] || in_array fastboot $(< /proc/cmdline); }; then
+ return
+ fi
+
if [[ -e /run/initramfs/root-fsck ]]; then
IGNORE_MOUNTED="-M"
fi