diff options
author | gordon <gordon@FreeBSD.org> | 2002-06-13 22:14:37 +0000 |
---|---|---|
committer | gordon <gordon@FreeBSD.org> | 2002-06-13 22:14:37 +0000 |
commit | 9c5433cb225f7a4e56e87623ea2e4011179553a5 (patch) | |
tree | 3168589e209abd888b033397e3c46dee6131a116 /etc/rc.d/fsck | |
parent | 50d99cdfecd92f5323a18aa791a5b1cb9d8b7191 (diff) | |
download | FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.zip FreeBSD-src-9c5433cb225f7a4e56e87623ea2e4011179553a5.tar.gz |
Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.
Submitted by: Mike Makonnen <makonnen@pacbell.net>
Reviewed by: silence on -current and -hackers
Prodded by: rwatson
Diffstat (limited to 'etc/rc.d/fsck')
-rwxr-xr-x | etc/rc.d/fsck | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/etc/rc.d/fsck b/etc/rc.d/fsck index ddd4302..a57e15c 100755 --- a/etc/rc.d/fsck +++ b/etc/rc.d/fsck @@ -1,10 +1,12 @@ #!/bin/sh # -# $NetBSD$ +# $NetBSD: fsck,v 1.2 2001/06/18 06:42:35 lukem Exp $ +# $FreeBSD$ # # PROVIDE: fsck # REQUIRE: localswap +# KEYWORD: FreeBSD NetBSD . /etc/rc.subr @@ -25,14 +27,26 @@ stop_boot() fsck_start() { - if [ -e /fastboot ]; then + if [ "$autoboot" = no ]; then echo "Fast boot: skipping disk checks." elif [ "$autoboot" = yes ]; then # During fsck ignore SIGQUIT trap : 3 - echo "Automatic boot in progress: starting file system checks." - fsck -p + echo "Starting file system checks:" + case `${CMD_OSTYPE}` in + FreeBSD) + if checkyesno background_fsck; then + fsck -F -p + else + fsck -p + fi + ;; + NetBSD) + fsck -p + ;; + esac + case $? in 0) ;; @@ -46,9 +60,30 @@ fsck_start() stop_boot ;; 8) + case `${CMD_OSTYPE}` in + FreeBSD) + if checkyesno fsck_y_enable; then + echo "File system preen failed, trying fsck -y." + fsck -y + case $? in + 0) + ;; + *) + echo "Automatic file system check failed; help!" + stop_boot + ;; + esac + else + echo "Automatic file system check failed; help!" + stop_boot + fi + ;; + NetBSD) echo "Automatic file system check failed; help!" stop_boot ;; + esac + ;; 12) echo "Boot interrupted." stop_boot |