early fsck

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2017-12-07 17:24:02 +03:00
parent 431f7e145e
commit db4eb9162b
2 changed files with 14 additions and 1 deletions

View File

@ -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}
)

10
rc.in
View File

@ -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"