diff options
author | Neil Brown <neilb@suse.de> | 2005-04-04 05:16:10 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-04-04 05:16:10 +0000 |
commit | 8d80900b492998a112eda80614a793012bee2770 (patch) | |
tree | 5f5e4d00396ccd6b6606ec56a191e17240a9d97a /mdadm.c | |
parent | 182661f4097636eb5578ca1d8291880114f15ad0 (diff) | |
download | mdadm-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.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 */ |