]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - config.c
Add device files created with --auto to list of known device files.
[thirdparty/mdadm.git] / config.c
index f23da81615113e589f8f64a7a20a379a4f4a900c..08a8ed1aae71a650830615197f240eeb4836b3b6 100644 (file)
--- a/config.c
+++ b/config.c
@@ -274,6 +274,7 @@ void arrayline(char *line)
        mis.devname = NULL;
        mis.spare_group = NULL;
        mis.autof = 0;
+       mis.next = NULL;
 
        for (w=dl_next(line); w!=line; w=dl_next(w)) {
                if (w[0] == '/') {
@@ -328,6 +329,15 @@ void arrayline(char *line)
                } else if (strncasecmp(w, "spares=", 7) == 0 ) {
                        /* for warning if not all spares present */
                        mis.spare_disks = atoi(w+7);
+               } else if (strncasecmp(w, "metadata=", 9) == 0) {
+                       /* style of metadata on the devices. */
+                       int i;
+                       
+                       for(i=0; superlist[i] && !mis.st; i++)
+                               mis.st = superlist[i]->match_metadata_desc(w+9);
+
+                       if (!mis.st)
+                               fprintf(stderr, Name ": metadata format %s unknown, ignored.\n", w+9);
                } else if (strncasecmp(w, "auto=", 5) == 0 ) {
                        /* whether to create device special files as needed */
                        if (strcasecmp(w+5, "no")==0)
@@ -335,7 +345,7 @@ void arrayline(char *line)
                        else if (strcasecmp(w+5,"yes")==0 || strcasecmp(w+5,"md")==0)
                                mis.autof = -1;
                        else {
-                               /* There might be digits, and maybe a hypen, at the end */
+                               /* There might be digits, and maybe a hyphen, at the end */
                                char *e = w+5 + strlen(w+5);
                                int num = 4;
                                int len;
@@ -421,7 +431,11 @@ void load_conffile(char *conffile)
                return;
        }
        if (strcmp(conffile, "partitions")==0) {
-               devline("DEV partitions");
+               char *list = dl_strdup("DEV");
+               dl_init(list);
+               dl_add(list, dl_strdup("partitions"));
+               devline(list);
+               free_line(list);
                loaded = 1;
                return;
        }