summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-04-04 05:16:10 +0000
committerNeil Brown <neilb@suse.de>2005-04-04 05:16:10 +0000
commit8d80900b492998a112eda80614a793012bee2770 (patch)
tree5f5e4d00396ccd6b6606ec56a191e17240a9d97a /mdadm.c
parent182661f4097636eb5578ca1d8291880114f15ad0 (diff)
downloadmdadm-8d80900b492998a112eda80614a793012bee2770.tar.gz
mdadm-8d80900b492998a112eda80614a793012bee2770.tar.xz
mdadm-8d80900b492998a112eda80614a793012bee2770.zip
When assembling with --auto, honour common device names
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/mdadm.c b/mdadm.c
index ee4f14b..1c67b3b 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -66,7 +66,14 @@ int main(int argc, char *argv[])
int force = 0;
int test = 0;
int assume_clean = 0;
- int autof = 0; /* -1 for non-partitions, 1 or more to create partitions */
+ int autof = 0; /* -2 means create device based on name:
+ * if it ends mdN, then non-partitioned array N
+ * if it ends dN, then partitions array N
+ * -1 means create non-partitioned, choose N
+ * 1 or more to create partitioned
+ * If -1 or 1 and name is a 'standard' name, then
+ * insist on a match of type and number.
+ */
char *mailaddr = NULL;
char *program = NULL;
@@ -401,10 +408,12 @@ int main(int argc, char *argv[])
case O(BUILD,'a'):
case O(ASSEMBLE,'a'): /* auto-creation of device node */
if (optarg == NULL)
- autof = -1;
+ autof = -2;
else if (strcasecmp(optarg,"no")==0)
autof = 0;
- else if (strcasecmp(optarg,"yes")==0 || strcasecmp(optarg,"md")==0)
+ else if (strcasecmp(optarg,"yes")==0)
+ autof = -2;
+ else if (strcasecmp(optarg,"md")==0)
autof = -1;
else {
/* There might be digits, and maybe a hypen, at the end */