aboutsummaryrefslogtreecommitdiff
path: root/sbin/mdconfig
diff options
context:
space:
mode:
authorWojciech A. Koszek <wkoszek@FreeBSD.org>2006-03-27 00:46:22 +0000
committerWojciech A. Koszek <wkoszek@FreeBSD.org>2006-03-27 00:46:22 +0000
commitea3d97ae6726dfe042d810e36541eeb57cbef6c6 (patch)
tree7532630469ffcad19c14fb47cda09b03097befd6 /sbin/mdconfig
parent8f2937b8247e51ba643c268fd910597dc9e7aa19 (diff)
downloadsrc-ea3d97ae6726dfe042d810e36541eeb57cbef6c6.tar.gz
src-ea3d97ae6726dfe042d810e36541eeb57cbef6c6.zip
For now, bring back some of the old bits as a fix for specifying md(4)
device number at creation time with -u option. Together with XMLizing mdconfig(8), I broke this functionality. This change is temporary. Complete fix will be commited soon. Approved by: cognet (mentor)
Notes
Notes: svn path=/head/; revision=157166
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r--sbin/mdconfig/mdconfig.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index ed781763f3d2..280219fcb5d6 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -213,6 +213,13 @@ main(int argc, char **argv)
case 'u':
if (cmdline != 2 && cmdline != 3)
usage();
+ if (!strncmp(optarg, "/dev/", 5))
+ optarg += 5;
+ if (!strncmp(optarg, MD_NAME, sizeof(MD_NAME) - 1))
+ optarg += sizeof(MD_NAME) - 1;
+ mdio.md_unit = strtoul(optarg, &p, 0);
+ if (mdio.md_unit == (unsigned)ULONG_MAX || *p != '\0')
+ errx(1, "bad unit: %s", optarg);
mdunit = optarg;
mdio.md_options &= ~MD_AUTOUNIT;
break;