Pull up following revision(s) (requested by pooka in ticket #288): include/mntopts.h: revision 1.12 sbin/mount/mount.8: revision 1.63 sbin/mount/mount.c: revision 1.88 Support mount -o rump, which uses the rump server instead of using the kernel service. E.g. "mount -t efs -o rump /dev/sgidev /mnt" runs effectively "rump_efs /dev/sgidev /mnt".diff -r1.11 -r1.11.4.1 src/include/mntopts.h
(snj)
--- src/include/mntopts.h 2008/07/31 05:38:04 1.11
+++ src/include/mntopts.h 2009/01/22 20:27:59 1.11.4.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mntopts.h,v 1.11 2008/07/31 05:38:04 simonb Exp $ */ | 1 | /* $NetBSD: mntopts.h,v 1.11.4.1 2009/01/22 20:27:59 snj Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1994 | 4 | * Copyright (c) 1994 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -60,26 +60,27 @@ struct mntopt { | @@ -60,26 +60,27 @@ struct mntopt { | |||
60 | 60 | |||
61 | /* Control flags. */ | 61 | /* Control flags. */ | |
62 | #define MOPT_FORCE { "force", 0, MNT_FORCE, 0 } | 62 | #define MOPT_FORCE { "force", 0, MNT_FORCE, 0 } | |
63 | #define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } | 63 | #define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } | |
64 | #define MOPT_RELOAD { "reload", 0, MNT_RELOAD, 0 } | 64 | #define MOPT_RELOAD { "reload", 0, MNT_RELOAD, 0 } | |
65 | #define MOPT_GETARGS { "getargs", 0, MNT_GETARGS, 0 } | 65 | #define MOPT_GETARGS { "getargs", 0, MNT_GETARGS, 0 } | |
66 | 66 | |||
67 | /* Support for old-style "ro", "rw" flags. */ | 67 | /* Support for old-style "ro", "rw" flags. */ | |
68 | #define MOPT_RO { "ro", 0, MNT_RDONLY, 0 } | 68 | #define MOPT_RO { "ro", 0, MNT_RDONLY, 0 } | |
69 | #define MOPT_RW { "rw", 1, MNT_RDONLY, 0 } | 69 | #define MOPT_RW { "rw", 1, MNT_RDONLY, 0 } | |
70 | 70 | |||
71 | /* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */ | 71 | /* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */ | |
72 | #define MOPT_AUTO { "auto", 0, 0, 0 } | 72 | #define MOPT_AUTO { "auto", 0, 0, 0 } | |
73 | #define MOPT_RUMP { "rump", 0, 0, 0 } | |||
73 | #define MOPT_NULL { NULL, 0, 0, 0 } | 74 | #define MOPT_NULL { NULL, 0, 0, 0 } | |
74 | 75 | |||
75 | #define MOPT_FSTAB_COMPAT \ | 76 | #define MOPT_FSTAB_COMPAT \ | |
76 | MOPT_RO, \ | 77 | MOPT_RO, \ | |
77 | MOPT_RW, \ | 78 | MOPT_RW, \ | |
78 | MOPT_AUTO | 79 | MOPT_AUTO | |
79 | 80 | |||
80 | /* Standard options which all mounts can understand. */ | 81 | /* Standard options which all mounts can understand. */ | |
81 | #define MOPT_STDOPTS \ | 82 | #define MOPT_STDOPTS \ | |
82 | MOPT_USERQUOTA, \ | 83 | MOPT_USERQUOTA, \ | |
83 | MOPT_GROUPQUOTA, \ | 84 | MOPT_GROUPQUOTA, \ | |
84 | MOPT_FSTAB_COMPAT, \ | 85 | MOPT_FSTAB_COMPAT, \ | |
85 | MOPT_NOCOREDUMP, \ | 86 | MOPT_NOCOREDUMP, \ |
--- src/sbin/mount/mount.8 2008/08/13 10:00:10 1.62
+++ src/sbin/mount/mount.8 2009/01/22 20:27:59 1.62.2.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: mount.8,v 1.62 2008/08/13 10:00:10 martti Exp $ | 1 | .\" $NetBSD: mount.8,v 1.62.2.1 2009/01/22 20:27:59 snj Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 1980, 1989, 1991, 1993 | 3 | .\" Copyright (c) 1980, 1989, 1991, 1993 | |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" Redistribution and use in source and binary forms, with or without | 6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | 7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | 8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | 9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | 10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | 12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | 13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" 3. Neither the name of the University nor the names of its contributors | 14 | .\" 3. Neither the name of the University nor the names of its contributors | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
28 | .\" SUCH DAMAGE. | 28 | .\" SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 | 30 | .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 | |
31 | .\" | 31 | .\" | |
32 | .Dd August 4, 2008 | 32 | .Dd January 11, 2009 | |
33 | .Dt MOUNT 8 | 33 | .Dt MOUNT 8 | |
34 | .Os | 34 | .Os | |
35 | .Sh NAME | 35 | .Sh NAME | |
36 | .Nm mount | 36 | .Nm mount | |
37 | .Nd mount file systems | 37 | .Nd mount file systems | |
38 | .Sh SYNOPSIS | 38 | .Sh SYNOPSIS | |
39 | .Nm | 39 | .Nm | |
40 | .Op Fl Aadfruvw | 40 | .Op Fl Aadfruvw | |
41 | .Op Fl t Ar type | 41 | .Op Fl t Ar type | |
42 | .Nm | 42 | .Nm | |
43 | .Op Fl dfruvw | 43 | .Op Fl dfruvw | |
44 | .Ar special | node | 44 | .Ar special | node | |
45 | .Nm | 45 | .Nm | |
@@ -212,26 +212,32 @@ Do not allow set-user-identifier or set- | @@ -212,26 +212,32 @@ Do not allow set-user-identifier or set- | |||
212 | .It Cm rdonly | 212 | .It Cm rdonly | |
213 | The same as | 213 | The same as | |
214 | .Fl r ; | 214 | .Fl r ; | |
215 | mount the file system read-only (even the super-user may not write it). | 215 | mount the file system read-only (even the super-user may not write it). | |
216 | .It Cm reload | 216 | .It Cm reload | |
217 | Reload all incore data for a file system. | 217 | Reload all incore data for a file system. | |
218 | This is used mainly after running | 218 | This is used mainly after running | |
219 | .Xr fsck 8 | 219 | .Xr fsck 8 | |
220 | on the root file system and finding things to fix. | 220 | on the root file system and finding things to fix. | |
221 | The file system must be mounted read-only. | 221 | The file system must be mounted read-only. | |
222 | All cached meta-data are invalidated, superblock and summary information | 222 | All cached meta-data are invalidated, superblock and summary information | |
223 | is re-read from disk, all cached inactive vnodes and file data are | 223 | is re-read from disk, all cached inactive vnodes and file data are | |
224 | invalidated and all inode data are re-read for all active vnodes. | 224 | invalidated and all inode data are re-read for all active vnodes. | |
225 | .It Cm rump | |||
226 | Instead of running mount_type to mount the file system, run rump_type. | |||
227 | This uses a userspace server to mount the file system and does not | |||
228 | require kernel support for the specific file system type. See the | |||
229 | .Fl t | |||
230 | flag and respective rump_type manual page for more information. | |||
225 | .It Cm softdep | 231 | .It Cm softdep | |
226 | (FFS only) Mount the file system using soft dependencies. | 232 | (FFS only) Mount the file system using soft dependencies. | |
227 | This means that metadata will not be written immediately, | 233 | This means that metadata will not be written immediately, | |
228 | but is written in an ordered fashion to keep the | 234 | but is written in an ordered fashion to keep the | |
229 | on-disk state of the file system consistent. | 235 | on-disk state of the file system consistent. | |
230 | This results in significant speedups for file create/delete operations. | 236 | This results in significant speedups for file create/delete operations. | |
231 | This option will be ignored when using the | 237 | This option will be ignored when using the | |
232 | .Fl u | 238 | .Fl u | |
233 | flag and a file system is already mounted read/write. | 239 | flag and a file system is already mounted read/write. | |
234 | This option has gone through moderate to heavy testing, | 240 | This option has gone through moderate to heavy testing, | |
235 | but should still be used with care. | 241 | but should still be used with care. | |
236 | A file system mounted with | 242 | A file system mounted with | |
237 | .Cm softdep | 243 | .Cm softdep | |
@@ -480,19 +486,31 @@ mount -t cd9660 -o nodev,nosuid /dev/cd0 | @@ -480,19 +486,31 @@ mount -t cd9660 -o nodev,nosuid /dev/cd0 | |||
480 | .Xr mount_lfs 8 , | 486 | .Xr mount_lfs 8 , | |
481 | .Xr mount_mfs 8 , | 487 | .Xr mount_mfs 8 , | |
482 | .Xr mount_msdos 8 , | 488 | .Xr mount_msdos 8 , | |
483 | .Xr mount_nfs 8 , | 489 | .Xr mount_nfs 8 , | |
484 | .Xr mount_ntfs 8 , | 490 | .Xr mount_ntfs 8 , | |
485 | .Xr mount_null 8 , | 491 | .Xr mount_null 8 , | |
486 | .Xr mount_overlay 8 , | 492 | .Xr mount_overlay 8 , | |
487 | .Xr mount_portal 8 , | 493 | .Xr mount_portal 8 , | |
488 | .Xr mount_procfs 8 , | 494 | .Xr mount_procfs 8 , | |
489 | .Xr mount_tmpfs 8 , | 495 | .Xr mount_tmpfs 8 , | |
490 | .Xr mount_udf 8 , | 496 | .Xr mount_udf 8 , | |
491 | .Xr mount_umap 8 , | 497 | .Xr mount_umap 8 , | |
492 | .Xr mount_union 8 , | 498 | .Xr mount_union 8 , | |
499 | .Xr rump_cd9660 8 , | |||
500 | .Xr rump_efs 8 , | |||
501 | .Xr rump_ext2fs 8 , | |||
502 | .Xr rump_ffs 8 , | |||
503 | .Xr rump_hfs 8 , | |||
504 | .Xr rump_lfs 8 , | |||
505 | .Xr rump_msdos 8 , | |||
506 | .Xr rump_nfs 8 , | |||
507 | .Xr rump_ntfs 8 , | |||
508 | .Xr rump_sysvbfs 8 , | |||
509 | .Xr rump_tmpfs 8 , | |||
510 | .Xr rump_udf 8 , | |||
493 | .Xr umount 8 | 511 | .Xr umount 8 | |
494 | .Sh HISTORY | 512 | .Sh HISTORY | |
495 | A | 513 | A | |
496 | .Nm | 514 | .Nm | |
497 | command appeared in | 515 | command appeared in | |
498 | .At v6 . | 516 | .At v6 . |
--- src/sbin/mount/mount.c 2009/01/16 22:22:52 1.86.2.1
+++ src/sbin/mount/mount.c 2009/01/22 20:27:59 1.86.2.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mount.c,v 1.86.2.1 2009/01/16 22:22:52 bouyer Exp $ */ | 1 | /* $NetBSD: mount.c,v 1.86.2.2 2009/01/22 20:27:59 snj Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1980, 1989, 1993, 1994 | 4 | * Copyright (c) 1980, 1989, 1993, 1994 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -29,27 +29,27 @@ | @@ -29,27 +29,27 @@ | |||
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | __COPYRIGHT("@(#) Copyright (c) 1980, 1989, 1993, 1994\ | 34 | __COPYRIGHT("@(#) Copyright (c) 1980, 1989, 1993, 1994\ | |
35 | The Regents of the University of California. All rights reserved."); | 35 | The Regents of the University of California. All rights reserved."); | |
36 | #endif /* not lint */ | 36 | #endif /* not lint */ | |
37 | 37 | |||
38 | #ifndef lint | 38 | #ifndef lint | |
39 | #if 0 | 39 | #if 0 | |
40 | static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; | 40 | static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; | |
41 | #else | 41 | #else | |
42 | __RCSID("$NetBSD: mount.c,v 1.86.2.1 2009/01/16 22:22:52 bouyer Exp $"); | 42 | __RCSID("$NetBSD: mount.c,v 1.86.2.2 2009/01/22 20:27:59 snj Exp $"); | |
43 | #endif | 43 | #endif | |
44 | #endif /* not lint */ | 44 | #endif /* not lint */ | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/mount.h> | 47 | #include <sys/mount.h> | |
48 | #include <sys/wait.h> | 48 | #include <sys/wait.h> | |
49 | 49 | |||
50 | #include <err.h> | 50 | #include <err.h> | |
51 | #include <errno.h> | 51 | #include <errno.h> | |
52 | #include <fstab.h> | 52 | #include <fstab.h> | |
53 | #include <pwd.h> | 53 | #include <pwd.h> | |
54 | #include <signal.h> | 54 | #include <signal.h> | |
55 | #include <stdio.h> | 55 | #include <stdio.h> | |
@@ -420,27 +420,30 @@ mountfs(const char *vfstype, const char | @@ -420,27 +420,30 @@ mountfs(const char *vfstype, const char | |||
420 | 420 | |||
421 | if (flags & MNT_UPDATE) { | 421 | if (flags & MNT_UPDATE) { | |
422 | catopt(&optbuf, "update"); | 422 | catopt(&optbuf, "update"); | |
423 | /* Figure out the fstype only if we defaulted to ffs */ | 423 | /* Figure out the fstype only if we defaulted to ffs */ | |
424 | if (vfstype == ffs_fstype && statvfs(name, &sf) != -1) | 424 | if (vfstype == ffs_fstype && statvfs(name, &sf) != -1) | |
425 | vfstype = sf.f_fstypename; | 425 | vfstype = sf.f_fstypename; | |
426 | } | 426 | } | |
427 | 427 | |||
428 | maxargc = 64; | 428 | maxargc = 64; | |
429 | argv = malloc(sizeof(char *) * maxargc); | 429 | argv = malloc(sizeof(char *) * maxargc); | |
430 | if (argv == NULL) | 430 | if (argv == NULL) | |
431 | err(1, "malloc"); | 431 | err(1, "malloc"); | |
432 | 432 | |||
433 | (void) snprintf(execbase, sizeof(execbase), "mount_%s", vfstype); | 433 | if (hasopt(optbuf, "rump")) | |
434 | (void)snprintf(execbase, sizeof(execbase), "rump_%s", vfstype); | |||
435 | else | |||
436 | (void)snprintf(execbase, sizeof(execbase), "mount_%s", vfstype); | |||
434 | argc = 0; | 437 | argc = 0; | |
435 | argv[argc++] = execbase; | 438 | argv[argc++] = execbase; | |
436 | if (optbuf) | 439 | if (optbuf) | |
437 | mangle(optbuf, &argc, &argv, &maxargc); | 440 | mangle(optbuf, &argc, &argv, &maxargc); | |
438 | argv[argc++] = spec; | 441 | argv[argc++] = spec; | |
439 | argv[argc++] = name; | 442 | argv[argc++] = name; | |
440 | argv[argc] = NULL; | 443 | argv[argc] = NULL; | |
441 | 444 | |||
442 | if ((verbose && buf == NULL) || debug) { | 445 | if ((verbose && buf == NULL) || debug) { | |
443 | (void)printf("exec:"); | 446 | (void)printf("exec:"); | |
444 | for (i = 0; i < argc; i++) | 447 | for (i = 0; i < argc; i++) | |
445 | (void)printf(" %s", argv[i]); | 448 | (void)printf(" %s", argv[i]); | |
446 | (void)printf("\n"); | 449 | (void)printf("\n"); |