aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-03-17 10:12:55 (GMT)
committerTom Gundersen <teg@jklm.no>2012-03-17 10:12:55 (GMT)
commit28ec5b76ca5cbb53ec9d5de73749dbe76db7611a (patch)
tree348487f6793990154e1e7aeeb10fe4e6c6ef9bf5 /rc.sysinit
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 'rc.sysinit')
-rwxr-xr-xrc.sysinit29
1 files changed, 12 insertions, 17 deletions
diff --git a/rc.sysinit b/rc.sysinit
index 8fa4270..0876d05 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -176,24 +176,19 @@ if [[ -f /etc/crypttab && $CS ]] && grep -q ^[^#] /etc/crypttab; then
fi
# Check filesystems
-[[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-f"
-declare -r FORCEFSCK
-
-if [[ -n $FORCEFSCK ]] || { [[ ! -f /fastboot ]] && ! in_array fastboot $(< /proc/cmdline); }; then
- run_hook sysinit_prefsck
- if [[ -x $(type -P fsck) ]]; then
- stat_busy "Checking Filesystems"
- fsck_all >|"${FSCK_OUT:-/dev/stdout}" 2>|"${FSCK_ERR:-/dev/stdout}"
- declare -r fsckret=$?
- (( fsckret <= 1 )) && stat_done || stat_fail
- else
- declare -r fsckret=0
- fi
- run_hook sysinit_postfsck
-
- # Single-user login and/or automatic reboot if needed
- fsck_reboot $fsckret
+run_hook sysinit_prefsck
+if [[ -x $(type -P fsck) ]]; then
+ stat_busy "Checking Filesystems"
+ fsck_all >|"${FSCK_OUT:-/dev/stdout}" 2>|"${FSCK_ERR:-/dev/stdout}"
+ declare -r fsckret=$?
+ (( fsckret <= 1 )) && stat_done || stat_fail
+else
+ declare -r fsckret=0
fi
+run_hook sysinit_postfsck
+
+# Single-user login and/or automatic reboot if needed
+fsck_reboot $fsckret
status "Remounting Root" \
mount -o remount /