Add a "noauto" flag so that you can do things like prevent your system

from not coming up multiuser just because you have a CD mount in fstab
but no CD in the drive.
Submitted by:	"Full Name Not Supplied" <simon@masi.ibp.fr>
This commit is contained in:
Jordan K. Hubbard 1995-08-23 12:59:27 +00:00
parent 215b0e62d5
commit 81b9534dc5
4 changed files with 16 additions and 6 deletions

View File

@ -42,6 +42,7 @@ struct mntopt {
/* User-visible MNT_ flags. */
#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 }
#define MOPT_NOAUTO { "auto", 1, MNT_NOAUTO, 0 }
#define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 }
#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 }
#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 }
@ -68,6 +69,7 @@ struct mntopt {
/* Standard options which all mounts can understand. */
#define MOPT_STDOPTS \
MOPT_FSTAB_COMPAT, \
MOPT_NOAUTO, \
MOPT_NODEV, \
MOPT_NOEXEC, \
MOPT_NOSUID, \

View File

@ -84,6 +84,7 @@ static struct opt {
{ MNT_ASYNC, "asynchronous" },
{ MNT_EXPORTED, "NFS exported" },
{ MNT_LOCAL, "local" },
{ MNT_NOAUTO, "noauto" },
{ MNT_NODEV, "nodev" },
{ MNT_NOEXEC, "noexec" },
{ MNT_NOSUID, "nosuid" },
@ -166,11 +167,13 @@ main(argc, argv)
continue;
if (badvfsname(fs->fs_vfstype, vfslist))
continue;
if (!strstr(fs->fs_mntops, "noauto")) {
if (mountfs(fs->fs_vfstype, fs->fs_spec,
fs->fs_file, init_flags, options,
fs->fs_mntops))
rval = 1;
}
}
else {
if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0)
err(1, "getmntinfo");

View File

@ -42,6 +42,7 @@ struct mntopt {
/* User-visible MNT_ flags. */
#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 }
#define MOPT_NOAUTO { "auto", 1, MNT_NOAUTO, 0 }
#define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 }
#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 }
#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 }
@ -68,6 +69,7 @@ struct mntopt {
/* Standard options which all mounts can understand. */
#define MOPT_STDOPTS \
MOPT_FSTAB_COMPAT, \
MOPT_NOAUTO, \
MOPT_NODEV, \
MOPT_NOEXEC, \
MOPT_NOSUID, \

View File

@ -84,6 +84,7 @@ static struct opt {
{ MNT_ASYNC, "asynchronous" },
{ MNT_EXPORTED, "NFS exported" },
{ MNT_LOCAL, "local" },
{ MNT_NOAUTO, "noauto" },
{ MNT_NODEV, "nodev" },
{ MNT_NOEXEC, "noexec" },
{ MNT_NOSUID, "nosuid" },
@ -166,11 +167,13 @@ main(argc, argv)
continue;
if (badvfsname(fs->fs_vfstype, vfslist))
continue;
if (!strstr(fs->fs_mntops, "noauto")) {
if (mountfs(fs->fs_vfstype, fs->fs_spec,
fs->fs_file, init_flags, options,
fs->fs_mntops))
rval = 1;
}
}
else {
if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0)
err(1, "getmntinfo");