[arch-projects] [initscripts] [PATCH v2] Add fastboot support

Lukas Fleischer archlinux at cryptocrack.de
Sun Jan 29 18:19:57 EST 2012


This one adds support for the "/fastboot" file, as well as the
"fastboot" kernel command line parameter. If either of them is
specified, file system checks are skipped. The only exception is the
existence of "/forcefsck" or the "forcefsck" kernel parameter which have
precedence over fastboot.

Implements FS#26154.

Reported-by: Mark <mark at voidzero.net>
Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 rc.sysinit    |   27 +++++++++++++++------------
 tmpfiles.conf |    1 +
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/rc.sysinit b/rc.sysinit
index b70ceaa..fbb1894 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -175,19 +175,22 @@ fi
 # Check filesystems
 [[ -f /forcefsck ]] || in_array forcefsck $(< /proc/cmdline) && FORCEFSCK="-- -f"
 declare -r FORCEFSCK
-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
+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
+fi
 
 status "Remounting Root" \
 	mount -o remount /
diff --git a/tmpfiles.conf b/tmpfiles.conf
index 8668116..a63ca07 100644
--- a/tmpfiles.conf
+++ b/tmpfiles.conf
@@ -17,4 +17,5 @@ r /tmp/.X[0-9]-lock
 r /etc/nologin
 r /etc/shutdownpid
 r /forcefsck
+r /fastboot
 
-- 
1.7.8.4



More information about the arch-projects mailing list