From f1ae21c411252787089618fc4a36bd5f06cc8917 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 16 May 2006 07:35:06 +0000 Subject: Arrange the 'auto' setting in mdadm.conf can choose default type. So when you say auto=md or auto=part in mdadm.conf, it give a preference for type of array, but standard name will override. But --auto=md is more insistant. FIXME I'm not at all happy about handling of names that already exist. I don't think that should be removed if the device is active. Signed-off-by: Neil Brown --- mdadm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'mdadm.c') diff --git a/mdadm.c b/mdadm.c index 119b749..26a2744 100644 --- a/mdadm.c +++ b/mdadm.c @@ -75,15 +75,17 @@ int main(int argc, char *argv[]) int force = 0; int test = 0; int assume_clean = 0; - int autof = 0; /* -3 means don't create anything, - * -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. - */ + /* autof indicates whether and how to create device node. + * bottom 3 bits are style. Rest (when shifted) are number of parts + * 0 - unset + * 1 - don't create (no) + * 2 - if is_standard, then create (yes) + * 3 - create as 'md' - reject is_standard mdp (md) + * 4 - create as 'mdp' - reject is_standard md (mdp) + * 5 - default to md if not is_standard (md in config file) + * 6 - default to mdp if not is_standard (part, or mdp in config file) + */ + int autof = 0; char *mailaddr = NULL; char *program = NULL; @@ -483,7 +485,7 @@ int main(int argc, char *argv[]) case O(CREATE,'a'): case O(BUILD,'a'): case O(ASSEMBLE,'a'): /* auto-creation of device node */ - autof = parse_auto(optarg, "--auto flag"); + autof = parse_auto(optarg, "--auto flag", 0); continue; case O(BUILD,'f'): /* force honouring '-n 1' */ -- cgit