From db4eb9162b81ae9647b72968a78f9fc80637ace3 Mon Sep 17 00:00:00 2001 From: fbt Date: Thu, 7 Dec 2017 17:24:02 +0300 Subject: [PATCH] early fsck Signed-off-by: fbt --- rc.conf | 5 ++++- rc.in | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/rc.conf b/rc.conf index 80e5ec7..18a364f 100644 --- a/rc.conf +++ b/rc.conf @@ -11,9 +11,12 @@ cfg_hostname='spark' # Uncomment and change this to yours #cfg_timezone='Europe/Moscow' +# Early fsck, if you don't have such a step in your initrd +#cfg_early_fsck=1 + # Services that start with @ are executed in parallel cfg_services+=( - 'fsck' 'mount' 'sysctl' 'rsyslogd' + 'mount' 'sysctl' 'rsyslogd' '@lo.iface' '@scron' @agetty-tty{2..6} ) diff --git a/rc.in b/rc.in index ddc5fa2..7bfb002 100644 --- a/rc.in +++ b/rc.in @@ -118,6 +118,8 @@ rc.remount_root() { } rc.boot() { + (( cfg_early_fsck )) && rc.fsck + rc.mount rc.tmpfiles rc.hostname @@ -181,6 +183,14 @@ rc.timezone() { } } +rc.fsck() { + declare root_rw=0 + touch /rc-write-test && root_rw=1 + (( root_rw )) && mount -o remount,ro / + fsck -A -C -p + (( root_rw )) && mount -o remount,rw / +} + rc.main() { source "@ETC@/rc.conf"