summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2007-02-20 21:04:12 +0000
committern_hibma <n_hibma@FreeBSD.org>2007-02-20 21:04:12 +0000
commit4a1dbd81cb62d9e8df40cb9c8307c08f4e42bd28 (patch)
treeed949919667632b13cb7314d0063799d3944aa19 /sbin
parent13b4da30e0802b2d9e53f43bb9a7f755162a3269 (diff)
downloadFreeBSD-src-4a1dbd81cb62d9e8df40cb9c8307c08f4e42bd28.zip
FreeBSD-src-4a1dbd81cb62d9e8df40cb9c8307c08f4e42bd28.tar.gz
Make attach the default for -f. That way
mdconfig -f image works like a charm. Reviewed by: phk (some time ago) MFC: 1 week
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mdconfig/mdconfig.88
-rw-r--r--sbin/mdconfig/mdconfig.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8
index 7e72275..3de3af8 100644
--- a/sbin/mdconfig/mdconfig.8
+++ b/sbin/mdconfig/mdconfig.8
@@ -195,10 +195,14 @@ mount /dev/md10 /tmp
chmod 1777 /tmp
.Ed
.Pp
-To create a 5MB file-backed disk:
+To create a 5MB file-backed disk (
+.Fl -a
+and
+.Fl -t Ar vnode
+are implied):
.Bd -literal -offset indent
dd if=/dev/zero of=somebackingfile bs=1k count=5k
-mdconfig -a -t vnode -f somebackingfile -u 0
+mdconfig -f somebackingfile -u 0
bsdlabel -w md0 auto
newfs md0c
mount /dev/md0c /mnt
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index acf3ff2..4fc580c 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -130,8 +130,12 @@ main(int argc, char **argv)
cmdline=2;
break;
case 'f':
- if (cmdline != 1 && cmdline != 2)
+ if (cmdline != 0 && cmdline != 1 && cmdline != 2)
usage();
+ if (cmdline == 0) {
+ action = ATTACH;
+ cmdline = 1;
+ }
if (cmdline == 1) {
/* Imply ``-t vnode'' */
mdio.md_type = MD_VNODE;
OpenPOWER on IntegriCloud