fsck (78345) | fsck (98184) |
---|---|
1#!/bin/sh 2# | 1#!/bin/sh 2# |
3# $NetBSD$ | 3# $NetBSD: fsck,v 1.2 2001/06/18 06:42:35 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/fsck 98184 2002-06-13 22:14:37Z gordon $ |
4# 5 6# PROVIDE: fsck 7# REQUIRE: localswap | 5# 6 7# PROVIDE: fsck 8# REQUIRE: localswap |
9# KEYWORD: FreeBSD NetBSD |
|
8 9. /etc/rc.subr 10 11name="fsck" 12start_cmd="fsck_start" 13stop_cmd=":" 14 15stop_boot() --- 4 unchanged lines hidden (view full) --- 20 if [ "$autoboot" = yes ]; then 21 kill -TERM $$ 22 fi 23 exit 1 24} 25 26fsck_start() 27{ | 10 11. /etc/rc.subr 12 13name="fsck" 14start_cmd="fsck_start" 15stop_cmd=":" 16 17stop_boot() --- 4 unchanged lines hidden (view full) --- 22 if [ "$autoboot" = yes ]; then 23 kill -TERM $$ 24 fi 25 exit 1 26} 27 28fsck_start() 29{ |
28 if [ -e /fastboot ]; then | 30 if [ "$autoboot" = no ]; then |
29 echo "Fast boot: skipping disk checks." 30 elif [ "$autoboot" = yes ]; then 31 # During fsck ignore SIGQUIT 32 trap : 3 33 | 31 echo "Fast boot: skipping disk checks." 32 elif [ "$autoboot" = yes ]; then 33 # During fsck ignore SIGQUIT 34 trap : 3 35 |
34 echo "Automatic boot in progress: starting file system checks." 35 fsck -p | 36 echo "Starting file system checks:" 37 case `${CMD_OSTYPE}` in 38 FreeBSD) 39 if checkyesno background_fsck; then 40 fsck -F -p 41 else 42 fsck -p 43 fi 44 ;; 45 NetBSD) 46 fsck -p 47 ;; 48 esac 49 |
36 case $? in 37 0) 38 ;; 39 2) 40 stop_boot 41 ;; 42 4) 43 echo "Rebooting..." 44 reboot 45 echo "Reboot failed; help!" 46 stop_boot 47 ;; 48 8) | 50 case $? in 51 0) 52 ;; 53 2) 54 stop_boot 55 ;; 56 4) 57 echo "Rebooting..." 58 reboot 59 echo "Reboot failed; help!" 60 stop_boot 61 ;; 62 8) |
63 case `${CMD_OSTYPE}` in 64 FreeBSD) 65 if checkyesno fsck_y_enable; then 66 echo "File system preen failed, trying fsck -y." 67 fsck -y 68 case $? in 69 0) 70 ;; 71 *) 72 echo "Automatic file system check failed; help!" 73 stop_boot 74 ;; 75 esac 76 else 77 echo "Automatic file system check failed; help!" 78 stop_boot 79 fi 80 ;; 81 NetBSD) |
|
49 echo "Automatic file system check failed; help!" 50 stop_boot 51 ;; | 82 echo "Automatic file system check failed; help!" 83 stop_boot 84 ;; |
85 esac 86 ;; |
|
52 12) 53 echo "Boot interrupted." 54 stop_boot 55 ;; 56 130) 57 stop_boot 58 ;; 59 *) 60 echo "Unknown error; help!" 61 stop_boot 62 ;; 63 esac 64 fi 65} 66 67load_rc_config $name 68run_rc_command "$1" | 87 12) 88 echo "Boot interrupted." 89 stop_boot 90 ;; 91 130) 92 stop_boot 93 ;; 94 *) 95 echo "Unknown error; help!" 96 stop_boot 97 ;; 98 esac 99 fi 100} 101 102load_rc_config $name 103run_rc_command "$1" |