From 9b6df8d651fa98a6eea627ef52e063ee55b59424 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 4 Jan 2006 22:18:10 +0000 Subject: [PATCH] parse nmount options enough to use a current mount binary; this allows people to boot releng_6 kernels with a current user install (for now at least) Reviewed by: rodrigc --- sys/kern/vfs_mount.c | 65 ++++++++++++++++++++++++++++++++++++++++ sys/ufs/ffs/ffs_vfsops.c | 5 +++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 78732e911794..56c288399d8f 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -128,7 +128,9 @@ struct vnode *rootvnode; static const char *global_opts[] = { "fstype", "fspath", + "rdonly", "ro", + "rw", "suid", "exec", NULL @@ -489,6 +491,69 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions) goto bail; } + /* + * We need to see if we have the "update" option + * before we call vfs_domount(), since vfs_domount() has special + * logic based on MNT_UPDATE. This is very important + * when we want to update the root filesystem. + */ + if (vfs_getopt(optlist, "update", NULL, NULL) == 0) + fsflags |= MNT_UPDATE; + + if (vfs_getopt(optlist, "async", NULL, NULL) == 0) + fsflags |= MNT_ASYNC; + + if (vfs_getopt(optlist, "force", NULL, NULL) == 0) + fsflags |= MNT_FORCE; + + if (vfs_getopt(optlist, "multilabel", NULL, NULL) == 0) + fsflags |= MNT_MULTILABEL; + + if (vfs_getopt(optlist, "noasync", NULL, NULL) == 0) + fsflags &= ~MNT_ASYNC; + + if (vfs_getopt(optlist, "noatime", NULL, NULL) == 0) + fsflags |= MNT_NOATIME; + + if (vfs_getopt(optlist, "noclusterr", NULL, NULL) == 0) + fsflags |= MNT_NOCLUSTERR; + + if (vfs_getopt(optlist, "noclusterw", NULL, NULL) == 0) + fsflags |= MNT_NOCLUSTERW; + + if (vfs_getopt(optlist, "noexec", NULL, NULL) == 0) + fsflags |= MNT_NOEXEC; + + if (vfs_getopt(optlist, "nosuid", NULL, NULL) == 0) + fsflags |= MNT_NOSUID; + + if (vfs_getopt(optlist, "nosymfollow", NULL, NULL) == 0) + fsflags |= MNT_NOSYMFOLLOW; + + if (vfs_getopt(optlist, "noro", NULL, NULL) == 0) + fsflags &= ~MNT_RDONLY; + + if (vfs_getopt(optlist, "ro", NULL, NULL) == 0) + fsflags |= MNT_RDONLY; + + if (vfs_getopt(optlist, "rdonly", NULL, NULL) == 0) + fsflags |= MNT_RDONLY; + + if (vfs_getopt(optlist, "rw", NULL, NULL) == 0) + fsflags &= ~MNT_RDONLY; + + if (vfs_getopt(optlist, "snapshot", NULL, NULL) == 0) + fsflags |= MNT_SNAPSHOT; + + if (vfs_getopt(optlist, "suiddir", NULL, NULL) == 0) + fsflags |= MNT_SUIDDIR; + + if (vfs_getopt(optlist, "sync", NULL, NULL) == 0) + fsflags |= MNT_SYNCHRONOUS; + + if (vfs_getopt(optlist, "union", NULL, NULL) == 0) + fsflags |= MNT_UNION; + /* * Be ultra-paranoid about making sure the type and fspath * variables will fit in our mp buffers, including the diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index c40d5bbb10ad..2837b08d8002 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -116,7 +116,10 @@ static struct buf_ops ffs_ops = { .bop_sync = bufsync, }; -static const char *ffs_opts[] = { "from", "export", NULL }; +static const char *ffs_opts[] = { "acls", "async", "atime", "clusterr", + "clusterw", "exec", "export", "force", "from", "multilabel", + "snapshot", "suid", "suiddir", "symfollow", "sync", + "update", "union", NULL }; static int ffs_mount(struct mount *mp, struct thread *td)