summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2006-02-16 21:28:54 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2006-02-16 21:28:54 +0000
commit63f8ddbe921682f54bb890ceee82e6c5a5dbf20c (patch)
tree4378e12a4696f8874b863c4b73017bfa469b26cd /sbin
parent960061611e80682a76b7eb1ee0f5d5a4f17cbf1d (diff)
downloadsrc-test2-63f8ddbe921682f54bb890ceee82e6c5a5dbf20c.tar.gz
src-test2-63f8ddbe921682f54bb890ceee82e6c5a5dbf20c.zip
Notes
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mdmfs/mdmfs.88
-rw-r--r--sbin/mdmfs/mdmfs.c20
2 files changed, 20 insertions, 8 deletions
diff --git a/sbin/mdmfs/mdmfs.8 b/sbin/mdmfs/mdmfs.8
index 3d429885ec3a..9bbf6d3cbdda 100644
--- a/sbin/mdmfs/mdmfs.8
+++ b/sbin/mdmfs/mdmfs.8
@@ -41,6 +41,7 @@ driver
.Op Fl b Ar block-size
.Op Fl c Ar cylinders
.Op Fl d Ar rotdelay
+.Op Fl E Ar path-mdconfig
.Op Fl e Ar maxbpg
.Op Fl F Ar file
.Op Fl f Ar frag-size
@@ -62,6 +63,7 @@ driver
.Op Fl b Ar block-size
.Op Fl c Ar cylinders
.Op Fl d Ar rotdelay
+.Op Fl E Ar path-mdconfig
.Op Fl e Ar maxbpg
.Op Fl F Ar file
.Op Fl f Ar frag-size
@@ -149,6 +151,12 @@ disk transfer on the same cylinder.
Modern disks with read/write-behind achieve higher performance without
this feature,
so it is best to leave it at 0 milliseconds.
+.It Fl E Ar path-mdconfig
+Use
+.Ar path-mdconfig
+as a location of the
+.Xr mdconfig 8
+utility.
.It Fl e Ar maxbpg
Indicate the maximum number of blocks any single file can allocate
out of a cylinder group before it is forced to begin allocating
diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c
index 33c35f9bf99c..e23d525d22d9 100644
--- a/sbin/mdmfs/mdmfs.c
+++ b/sbin/mdmfs/mdmfs.c
@@ -68,6 +68,7 @@ static bool norun; /* Actually run the helper programs? */
static int unit; /* The unit we're working with. */
static const char *mdname; /* Name of memory disk device (e.g., "md"). */
static size_t mdnamelen; /* Length of mdname. */
+static const char *path_mdconfig =_PATH_MDCONFIG;
static void argappend(char **, const char *, ...) __printflike(2, 3);
static void debugprintf(const char *, ...) __printflike(1, 2);
@@ -122,7 +123,7 @@ main(int argc, char **argv)
compat = true;
while ((ch = getopt(argc, argv,
- "a:b:Cc:Dd:e:F:f:hi:LlMm:Nn:O:o:p:PSs:t:Uv:w:X")) != -1)
+ "a:b:Cc:Dd:E:e:F:f:hi:LlMm:Nn:O:o:Pp:Ss:t:Uv:w:X")) != -1)
switch (ch) {
case 'a':
argappend(&newfs_arg, "-a %s", optarg);
@@ -146,6 +147,9 @@ main(int argc, char **argv)
case 'd':
argappend(&newfs_arg, "-d %s", optarg);
break;
+ case 'E':
+ path_mdconfig = optarg;
+ break;
case 'e':
argappend(&newfs_arg, "-e %s", optarg);
break;
@@ -355,7 +359,7 @@ do_mdconfig_attach(const char *args, const enum md_types mdtype)
default:
abort();
}
- rv = run(NULL, "%s -a %s%s -u %s%d", _PATH_MDCONFIG, ta, args,
+ rv = run(NULL, "%s -a %s%s -u %s%d", path_mdconfig, ta, args,
mdname, unit);
if (rv)
errx(1, "mdconfig (attach) exited with error code %d", rv);
@@ -389,7 +393,7 @@ do_mdconfig_attach_au(const char *args, const enum md_types mdtype)
default:
abort();
}
- rv = run(&fd, "%s -a %s%s", _PATH_MDCONFIG, ta, args);
+ rv = run(&fd, "%s -a %s%s", path_mdconfig, ta, args);
if (rv)
errx(1, "mdconfig (attach) exited with error code %d", rv);
@@ -428,7 +432,7 @@ do_mdconfig_detach(void)
{
int rv;
- rv = run(NULL, "%s -d -u %s%d", _PATH_MDCONFIG, mdname, unit);
+ rv = run(NULL, "%s -d -u %s%d", path_mdconfig, mdname, unit);
if (rv && debug) /* This is allowed to fail. */
warnx("mdconfig (detach) exited with error code %d (ignored)",
rv);
@@ -676,14 +680,14 @@ usage(void)
if (!compat)
fprintf(stderr,
"usage: %s [-DLlMNPSUX] [-a maxcontig] [-b block-size] [-c cylinders]\n"
-"\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n"
-"\t[-m percent-free] [-n rotational-positions] [-O optimization]\n"
+"\t[-d rotdelay] [-E path-mdconfig] [-e maxbpg] [-F file] [-f frag-size]\n"
+"\t[-i bytes] [-m percent-free] [-n rotational-positions] [-O optimization]\n"
"\t[-o mount-options] [-p permissions] [-s size] [-v version]\n"
"\t[-w user:group] md-device mount-point\n", name);
fprintf(stderr,
"usage: %s -C [-lNU] [-a maxcontig] [-b block-size] [-c cylinders]\n"
-"\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n"
-"\t[-m percent-free] [-n rotational-positions] [-O optimization]\n"
+"\t[-d rotdelay] [-E path-mdconfig] [-e maxbpg] [-F file] [-f frag-size]\n"
+"\t[-i bytes] [-m percent-free] [-n rotational-positions] [-O optimization]\n"
"\t[-o mount-options] [-s size] [-v version] md-device mount-point\n", name);
exit(1);
}