Module Name:    src
Committed By:   apb
Date:           Tue Apr 28 13:08:51 UTC 2009

Modified Files:
        src/etc/rc.d: fsck_root

Log Message:
Do nothing if root file system has fs_passno=0 in /etc/fstab.
(It might be better to change fsck(8) so that "fsck -p" always checks
fs_passno, whether or not file systems are specified on the command
line.)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/fsck_root

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/fsck_root
diff -u src/etc/rc.d/fsck_root:1.1 src/etc/rc.d/fsck_root:1.2
--- src/etc/rc.d/fsck_root:1.1	Tue Apr 21 16:08:57 2009
+++ src/etc/rc.d/fsck_root	Tue Apr 28 13:08:51 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: fsck_root,v 1.1 2009/04/21 16:08:57 joerg Exp $
+# $NetBSD: fsck_root,v 1.2 2009/04/28 13:08:51 apb Exp $
 #
 
 # PROVIDE: fsck_root
@@ -10,6 +10,7 @@
 name="fsck_root"
 start_cmd="fsck_root_start"
 stop_cmd=":"
+fstab_file=/etc/fstab
 
 fsck_root_start()
 {
@@ -20,6 +21,22 @@
 	trap : 2 		# Ignore SIGINT, SIGQUIT, so we
 	trap : 3		# enter single-user mode on failure.
 
+	# Do nothing if root file system has fs_passno=0 in /etc/fstab.
+	while read fs_spec fs_file fs_vfstype fs_mntops fs_freq fs_passno
+	do
+		case "${fs_spec}:${fs_file}:${fs_passno}" in
+		\#*|'':*)
+			continue # skip comment or blank line
+			;;
+		*:/:0)
+			echo "Not checking /: fs_passno = 0 in ${fstab_file}"
+			return
+			;;
+		*:/:*)	break
+			;;
+		esac
+	done <"${fstab_file}"
+
 	echo "Starting root file system check:"
 	fsck $fsck_flags /
 	local fsck_error="$?"

Reply via email to