This prevents fsck from failing at boot if there are nullfs or unionfs
filesystems in fstab(5), as reported by [EMAIL PROTECTED]  Anyone mind
if I commit this?  (Or have suggestions for filesystems to add to the
list?)

%%%
Index: fsck.c
===================================================================
RCS file: /home/ncvs/src/sbin/fsck/fsck.c,v
retrieving revision 1.12
diff -d -u -r1.12 fsck.c
--- fsck.c      31 Oct 2002 15:32:39 -0000      1.12
+++ fsck.c      27 Jan 2003 23:24:51 -0000
@@ -79,6 +79,8 @@
 static int flags = 0;
 static int forceflag = 0;
 
+static const char *nofsck[] = { "nullfs", "unionfs", NULL };
+
 static int checkfs(const char *, const char *, const char *, char *, pid_t *);
 static int selected(const char *);
 static void addoption(char *);
@@ -90,6 +92,7 @@
 static const char *getfslab(const char *);
 static void usage(void) __dead2;
 static int isok(struct fstab *);
+static int skip(const char *);
 
 int
 main(int argc, char *argv[])
@@ -209,6 +212,10 @@
                                errx(1, "%s has unknown file system type.",
                                    spec);
                }
+               if (skip(type)) {
+                       printf("%s: FILESYSTEM DOES NOT SUPPORT FSCK\n", *argv);
+                       continue;
+               }
                if ((flags & CHECK_BACKGRD) &&
                    checkfs(type, spec, mntpt, "-F", NULL) == 0) {
                        printf("%s: DEFER FOR BACKGROUND CHECKING\n", *argv);
@@ -577,6 +584,17 @@
        return vfstype;
 }
 
+static int
+skip(const char *fstype)
+{
+       const char *p;
+
+       for (p = nofsck[0]; p != NULL; p++) {
+               if (strcmp(p, fstype) == 0)
+                       return 1;
+       }
+       return 0;
+}
 
 static void
 usage(void)
%%%

Thanx,
juli.
-- 
Juli Mallett <[EMAIL PROTECTED]>
AIM: BSDFlata -- IRC: juli on EFnet.
OpenDarwin, Mono, FreeBSD Developer.
ircd-hybrid Developer, EFnet addict.
FreeBSD on MIPS-Anything on FreeBSD.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to