Expand PMF_FN_* macros.
[netbsd-mini2440.git] / etc / rc.d / fsck_root
blob62707d0992dec4722abdd65a0afd5bd51d91f1be
1 #!/bin/sh
3 # $NetBSD: fsck_root,v 1.2 2009/04/28 13:08:51 apb Exp $
6 # PROVIDE: fsck_root
8 $_rc_subr_loaded . /etc/rc.subr
10 name="fsck_root"
11 start_cmd="fsck_root_start"
12 stop_cmd=":"
13 fstab_file=/etc/fstab
15 fsck_root_start()
17 if [ -e /fastboot ]; then
18 echo "Fast boot: skipping disk checks."
19 return
21 trap : 2 # Ignore SIGINT, SIGQUIT, so we
22 trap : 3 # enter single-user mode on failure.
24 # Do nothing if root file system has fs_passno=0 in /etc/fstab.
25 while read fs_spec fs_file fs_vfstype fs_mntops fs_freq fs_passno
27 case "${fs_spec}:${fs_file}:${fs_passno}" in
28 \#*|'':*)
29 continue # skip comment or blank line
31 *:/:0)
32 echo "Not checking /: fs_passno = 0 in ${fstab_file}"
33 return
35 *:/:*) case "${fs_spec}" in
36 *:*)
37 echo "Not checking /: nfs mounted"
38 return
40 esac
42 esac
43 done <"${fstab_file}"
45 echo "Starting root file system check:"
46 fsck $fsck_flags /
47 handle_fsck_error "$?"
50 load_rc_config $name
51 run_rc_command "$1"