summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Luttringer <seblu@seblu.net>2011-04-15 20:46:59 +0200
committerTom Gundersen <teg@jklm.no>2011-04-16 09:32:17 +0800
commita946a2956b42859ddb2667218115ae0f4e896491 (patch)
treea33b628a09bafa561c994888ee86e4e542c147e8
parent2800e50847f3217b60eb07138c7f6fda05467616 (diff)
Fix and clean forcefsk detection
Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
-rwxr-xr-xrc.sysinit22
1 files changed, 12 insertions, 10 deletions
diff --git a/rc.sysinit b/rc.sysinit
index b89d62f..56a63bc 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -219,23 +219,25 @@ fi
status "Mounting Root Read-only" /bin/mount -n -o remount,ro /
-FORCEFSCK=
-[[ -f /forcefsck || -n "$forcefsck" ]] && FORCEFSCK="-- -f"
NETFS="nonfs,nonfs4,nosmbfs,nocifs,nocodafs,noncpfs,nosysfs,noshfs,nofuse,nofuseblk,noglusterfs,nodavfs"
-fsck_reboot() {
- echo "Automatic reboot in progress..."
- /bin/umount -a
- /bin/mount -n -o remount,ro /
- /sbin/reboot -f
- exit 0
-}
-
if [[ -x /sbin/fsck ]]; then
stat_busy "Checking Filesystems"
+ fsck_reboot() {
+ echo "Automatic reboot in progress..."
+ /bin/umount -a
+ /bin/mount -n -o remount,ro /
+ /sbin/reboot -f
+ exit 0
+ }
FSCK_OUT=/dev/stdout
FSCK_ERR=/dev/stdout
FSCK_FD=
+ FORCEFSCK=
+ [[ -f /forcefsck ]] && FORCEFSCK="-- -f"
+ for cmdarg in $(< /proc/cmdline); do
+ [[ "$cmdarg" == forcefsck ]] && FORCEFSCK="-- -f" && break
+ done
run_hook sysinit_prefsck
/sbin/fsck -A -T -C$FSCK_FD -a -t "$NETFS,noopts=_netdev" $FORCEFSCK >$FSCK_OUT 2>$FSCK_ERR
fsckret=$?