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"