From owner-svn-src-all@FreeBSD.ORG Tue Oct 25 01:46:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3067E106564A; Tue, 25 Oct 2011 01:46:43 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06B188FC0C; Tue, 25 Oct 2011 01:46:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9P1kgMN072596; Tue, 25 Oct 2011 01:46:42 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9P1kgvL072593; Tue, 25 Oct 2011 01:46:42 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201110250146.p9P1kgvL072593@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 25 Oct 2011 01:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226711 - head/sbin/fsck X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2011 01:46:43 -0000 Author: sobomax Date: Tue Oct 25 01:46:42 2011 New Revision: 226711 URL: http://svn.freebsd.org/changeset/base/226711 Log: Add new option -c to specify alternatve location of the /etc/fstab file. MFC after: 1 month Modified: head/sbin/fsck/fsck.8 head/sbin/fsck/fsck.c Modified: head/sbin/fsck/fsck.8 ============================================================================== --- head/sbin/fsck/fsck.8 Tue Oct 25 00:34:39 2011 (r226710) +++ head/sbin/fsck/fsck.8 Tue Oct 25 01:46:42 2011 (r226711) @@ -41,6 +41,7 @@ .Op Fl B | F .Op Fl T Ar fstype : Ns Ar fsoptions .Op Fl t Ar fstype +.Op Fl c Ar fstab .Oo Ar special | node Oc ... .Sh DESCRIPTION The @@ -117,6 +118,10 @@ Check if the .Dq clean flag is set in the superblock and skip file system checks if file system was properly dismounted and marked clean. +.It Fl c Ar fstab +Specify the +.Pa fstab +file to use. .It Fl d Debugging mode. Just print the commands without executing them. Modified: head/sbin/fsck/fsck.c ============================================================================== --- head/sbin/fsck/fsck.c Tue Oct 25 00:34:39 2011 (r226710) +++ head/sbin/fsck/fsck.c Tue Oct 25 01:46:42 2011 (r226711) @@ -96,6 +96,7 @@ main(int argc, char *argv[]) int i, rval = 0; const char *vfstype = NULL; char globopt[3]; + const char *etc_fstab; globopt[0] = '-'; globopt[2] = '\0'; @@ -103,7 +104,8 @@ main(int argc, char *argv[]) TAILQ_INIT(&selhead); TAILQ_INIT(&opthead); - while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:")) != -1) + etc_fstab = NULL; + while ((i = getopt(argc, argv, "BCdvpfFnyl:t:T:c:")) != -1) switch (i) { case 'B': if (flags & CHECK_BACKGRD) @@ -160,6 +162,10 @@ main(int argc, char *argv[]) vfstype = optarg; break; + case 'c': + etc_fstab = optarg; + break; + case '?': default: usage(); @@ -169,6 +175,9 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (etc_fstab != NULL) + setfstab(etc_fstab); + if (argc == 0) return checkfstab(flags, isok, checkfs); @@ -571,7 +580,7 @@ static void usage(void) { static const char common[] = - "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype]"; + "[-Cdfnpvy] [-B | -F] [-T fstype:fsoptions] [-t fstype] [-c fstab]"; (void)fprintf(stderr, "usage: %s %s [special | node] ...\n", getprogname(), common);