diff options
author | delphij <delphij@FreeBSD.org> | 2011-06-07 18:48:49 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2011-06-07 18:48:49 +0000 |
commit | f5a66a355e4cb15c54d65412deda8b6ed640dc07 (patch) | |
tree | e3291fe5519a3b8a5170ecb0545a14c6ef160e10 /sbin/mount | |
parent | b5ffa4ca3633fba6cdb0813fa4bd77604503d39b (diff) | |
download | FreeBSD-src-f5a66a355e4cb15c54d65412deda8b6ed640dc07.zip FreeBSD-src-f5a66a355e4cb15c54d65412deda8b6ed640dc07.tar.gz |
Add a special mount option "failok" to indicate that the administrator wants
the system to proceed to boot without bailing out into single user mode,
even when the file system can not be successfully mounted.
This option is implemented in mount(8) and not passed into kernel.
MFC after: 1 month
Diffstat (limited to 'sbin/mount')
-rw-r--r-- | sbin/mount/mount.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index acded1c..2229419 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -243,7 +243,7 @@ main(int argc, char *argv[]) const char *mntfromname, **vfslist, *vfstype; struct fstab *fs; struct statfs *mntbuf; - int all, ch, i, init_flags, late, mntsize, rval, have_fstab, ro; + int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro; char *cp, *ep, *options; all = init_flags = late = 0; @@ -328,6 +328,10 @@ main(int argc, char *argv[]) continue; if (hasopt(fs->fs_mntops, "late") && !late) continue; + if (hasopt(fs->fs_mntops, "failok")) + failok = 1; + else + failok = 0; if (!(init_flags & MNT_UPDATE) && ismounted(fs, mntbuf, mntsize)) continue; @@ -335,7 +339,7 @@ main(int argc, char *argv[]) mntbuf->f_flags); if (mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file, init_flags, options, - fs->fs_mntops)) + fs->fs_mntops) && !failok) rval = 1; } } else if (fstab_style) { @@ -717,6 +721,14 @@ mangle(char *options, struct cpa *a) * before mountd starts. */ continue; + } else if (strcmp(p, "failok") == 0) { + /* + * "failok" is used to prevent certain file + * systems from being causing the system to + * drop into single user mode in the boot + * cycle, and is not a real mount option. + */ + continue; } else if (strncmp(p, "mountprog", 9) == 0) { /* * "mountprog" is used to force the use of |