File systems marked with net will not be mounted by default.
mount -a -N will mount all those file systems instead.
This will be used to mark file systems needing network to work -- in
other words which depend on iscsid.
"Get it in" deraadt@
-/* $OpenBSD: mntopts.h,v 1.15 2005/05/26 01:37:49 pedro Exp $ */
+/* $OpenBSD: mntopts.h,v 1.16 2014/07/13 12:01:30 claudio Exp $ */
/* $NetBSD: mntopts.h,v 1.3 1995/03/18 14:56:59 cgd Exp $ */
/*-
#define MOPT_RO { "ro", MNT_RDONLY, MFLAG_SET }
#define MOPT_RW { "rw", MNT_RDONLY, MFLAG_INVERSE | MFLAG_SET }
-/* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */
+/* These are parsed by mount(8), but are ignored by specific mount_*(8)s. */
#define MOPT_AUTO { "auto", 0, MFLAG_SET }
+#define MOPT_NET { "net", 0, MFLAG_SET }
#define MOPT_FSTAB_COMPAT \
MOPT_RO, \
MOPT_RW, \
+ MOPT_NET, \
MOPT_AUTO
/* Standard options which all mounts can understand. */
-.\" $OpenBSD: mount.8,v 1.74 2014/06/24 02:32:43 daniel Exp $
+.\" $OpenBSD: mount.8,v 1.75 2014/07/13 12:01:30 claudio Exp $
.\" $NetBSD: mount.8,v 1.11 1995/07/12 06:23:21 cgd Exp $
.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
.\"
.\" @(#)mount.8 8.7 (Berkeley) 3/27/94
.\"
-.Dd $Mdocdate: June 24 2014 $
+.Dd $Mdocdate: July 13 2014 $
.Dt MOUNT 8
.Os
.Sh NAME
.Xr fstab 5
table except those for which the
.Dq noauto
+or
+.Dq net
option is specified.
.It Fl a
Similar to the
Either force mounting of dirty file systems or, in the case of a
downgrade from read-write to read-only operation, the revocation of
opened files with write access.
+.It Fl N
+If used with either
+.Fl A
+or
+.Fl a ,
+.Xm
+will only look at file systems which have the
+.Dq net
+option specified.
+By default file systems with the
+.Dq net
+option are ignored.
.It Fl o Ar options
Options can be given with (or without) a
.Sq no
-/* $OpenBSD: mount.c,v 1.55 2014/06/24 02:32:43 daniel Exp $ */
+/* $OpenBSD: mount.c,v 1.56 2014/07/13 12:01:30 claudio Exp $ */
/* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */
/*
int debug, verbose, skip;
char **typelist = NULL;
+enum { NONET_FILTER, NET_FILTER } filter = NONET_FILTER;
int selected(const char *);
char *catopt(char *, const char *);
all = forceall = 0;
options = NULL;
vfstype = "ffs";
- while ((ch = getopt(argc, argv, "Aadfo:rswt:uv")) != -1)
+ while ((ch = getopt(argc, argv, "AadfNo:rswt:uv")) != -1)
switch (ch) {
case 'A':
all = forceall = 1;
if (!hasopt(options, "force"))
options = catopt(options, "force");
break;
+ case 'N':
+ filter = NET_FILTER;
+ break;
case 'o':
if (*optarg)
options = catopt(options, optarg);
while ((fs = getfsent()) != NULL) {
if (BADTYPE(fs->fs_type))
continue;
+ switch (filter) {
+ case NET_FILTER:
+ if (!hasopt(fs->fs_mntops, "net"))
+ continue;
+ break;
+ case NONET_FILTER:
+ if (hasopt(fs->fs_mntops, "net"))
+ continue;
+ break;
+ }
if (!selected(fs->fs_vfstype))
continue;
if (hasopt(fs->fs_mntops, "noauto"))