* Makefile.in (path-mount.o): Add a rule to build stripped down version

of path.cc for usage in mount.
	(mount.exe): Add dependency to path-mount.o.
	* mount.cc (force): Convert to bool value.  Accommodate throughout.
	(from_fstab): New function.
	(do_mount_from_fstab): New function.
	(longopts): Add --all option.
	(opts): Add -a option.
	(usage): Document -a/--all option.
	(main): Handle -a option as well as single parameter.
	* path.cc: Add FSTAB_ONLY conditional to allow building path-mount.o.
	(mount_table): Remove static storage class.
	(max_mount_entry): Ditto.
	(root_here): Unused.  Remove.
	(from_fstab_line): Remove static.
	* path.h (struct mnt_t): Define here rather than in path.cc.
	(from_fstab_line): Declare.
	(mount_table): Declare.
	(max_mount_entry): Declare.
	* utils.sgml (mount): Document -a/--all option and mounting of single
	path from fstab files.
This commit is contained in:
Corinna Vinschen
2009-07-22 10:20:26 +00:00
parent d6438f13d1
commit 1e497ebd33
6 changed files with 175 additions and 26 deletions

View File

@ -729,8 +729,11 @@ up as file owners in <command>ls -l</command> output.
<screen>
Usage: mount [OPTION] [&lt;win32path&gt; &lt;posixpath&gt;]
mount -a
mount &lt;posixpath&gt;
Display information about mounted filesystems, or mount a filesystem
-a, --all mount all filesystems mentioned in fstab
-c, --change-cygdrive-prefix change the cygdrive path prefix to &lt;posixpath&gt;
-f, --force force mount, don't warn about missing mount
point directories
@ -836,6 +839,30 @@ most of the options are duplicates of other mount flags):</para>
user mount points. System mount points can only be specified in
the <filename>/etc/fstab</filename> file.</para>
<para>If you added mount points to <filename>/etc/fstab</filename> or your
<filename>/etc/fstab.d/&lt;username&gt;</filename> file, you can add these
mount points to your current user session using the <literal>-a/--all</literal>
option, or by specifing the posix path alone on the command line. As an
example, consider you added a mount point with the POSIX path
<filename>/my/mount</filename>. You can add this mount point with either
one of the following two commands to your current user session.</para>
<screen>
<prompt>$</prompt> <userinput>mount /my/mount</userinput>
<prompt>$</prompt> <userinput>mount -a</userinput>
</screen>
<para>The first command just adds the <filename>/my/mount</filename> mount
point to your current session, the <command>mount -a</command> adds all
new mount points to your user session.</para>
<para>If you change a mount point to point to another native path, or
if you changed the flags of a mount point, you have to <command>umount</command>
the mount point first, before you can add it again. Please note that
all such added mount points are added as user mount points, and that the
rule that system mount points can't be removed or replaced in a running
session still applies.</para>
<para>
The <literal>-m</literal> option causes the <command>mount</command> utility
to output the current mount table in a series of fstab entries.