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;
ident.raid_disks = UnSet;
ident.super_minor= UnSet;
ident.devices=0;
+ ident.spare_group = NULL;
+ ident.autof = 0;
while ((option_index = -1) ,
(opt=getopt_long(argc, 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 */
if ((int)ident.super_minor == -2) {
struct stat stb;
fstat(mdfd, &stb);
- ident.super_minor = MINOR(stb.st_rdev);
+ ident.super_minor = minor(stb.st_rdev);
}
}