summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-03-10 18:33:50 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-03-10 18:33:50 +0000
commit59ef4c53bef7cb032199620b8cba59a037f8decd (patch)
treeb11e31cd18ebe4b548af86f3eca903ed0a1fdab0
parentb178fe4278e515034bc8f992658bebe515b138fd (diff)
downloads6-linux-utils-59ef4c53bef7cb032199620b8cba59a037f8decd.tar.xz
- add -n to s6-mount
- s6-mount doc fixes
-rw-r--r--doc/s6-mount.html12
-rw-r--r--src/minutils/s6-mount.c9
2 files changed, 14 insertions, 7 deletions
diff --git a/doc/s6-mount.html b/doc/s6-mount.html
index b12c505..083eda2 100644
--- a/doc/s6-mount.html
+++ b/doc/s6-mount.html
@@ -24,8 +24,8 @@
<h2> Interface </h2>
<pre>
- s6-mount -a
- s6-mount [ -r | -w ] [ -t fstype ] [ -o option[,option...] ] <em>device</em> <em>mntpoint</em>
+ s6-mount -a [ -z <em>fstab</em> ]
+ s6-mount [ -n ] [ -r | -w ] [ -t <em>fstype</em> ] [ -o <em>option</em>[,<em>option</em>...] ] <em>device</em> <em>mntpoint</em>
</pre>
<ul>
@@ -38,8 +38,12 @@
<h2> Options </h2>
<ul>
- <li> <tt>-a</tt>&nbsp;: read <tt>/etc/fstab</tt> instead of other arguments </li>
- <li> <tt>-t</tt> <em>fstype</em>&nbsp;: filesystem is of type <em>fstype</em>. Default: ext2. </li>
+ <li> <tt>-a</tt>&nbsp;: process <tt>/etc/fstab</tt> instead of command
+line arguments </li>
+ <li> <tt>-z</tt>&nbsp;<em>fstab</em>&nbsp;: read file at <em>fstab</em>
+instead of <tt>/etc/fstab</tt> </li>
+ <li> <tt>-n</tt>&nbsp;: ignored
+ <li> <tt>-t</tt>&nbsp;<em>fstype</em>&nbsp;: filesystem is of type <em>fstype</em>. Default: ext2. </li>
<li> <tt>-r</tt>&nbsp;: mount read-only </li>
<li> <tt>-w</tt>&nbsp;: mount read-write (default) </li>
<li> <tt>-o</tt> <em>option</em>&nbsp;: mount with option <em>option</em>.
diff --git a/src/minutils/s6-mount.c b/src/minutils/s6-mount.c
index 6970c05..318a4a0 100644
--- a/src/minutils/s6-mount.c
+++ b/src/minutils/s6-mount.c
@@ -10,7 +10,7 @@
#include <skalibs/djbunix.h>
#include "mount-constants.h"
-#define USAGE "s6-mount -a [ -z fstab ] | s6-mount [ -t type ] [ -o option[,option...] ]... device mountpoint"
+#define USAGE "s6-mount -a [ -z fstab ] | s6-mount [ -n ] [ -t type ] [ -o option[,option...] ]... device mountpoint"
#define BUFSIZE 4096
#define SWITCH(opt) do
@@ -93,15 +93,17 @@ int main (int argc, char const *const *argv)
char const *fstab = "/etc/fstab" ;
PROG = "s6-mount" ;
{
+ int doall = 0 ;
subgetopt_t l = SUBGETOPT_ZERO ;
for (;;)
{
- register int opt = subgetopt_r(argc, argv, "z:arwt:o:", &l) ;
+ register int opt = subgetopt_r(argc, argv, "nz:arwt:o:", &l) ;
if (opt == -1) break ;
switch (opt)
{
+ case 'n' : break ;
case 'z' : fstab = l.arg ; break ;
- case 'a' : return mountall(fstab) ;
+ case 'a' : doall = 1 ; break ;
case 't' : fstype = l.arg ; break ;
case 'w' : scanopt(&data, &flags, "rw") ; break ;
case 'r' : scanopt(&data, &flags, "ro") ; break ;
@@ -110,6 +112,7 @@ int main (int argc, char const *const *argv)
}
}
argc -= l.ind ; argv += l.ind ;
+ if (doall) return mountall(fstab) ;
}
if (!argc)
{