Sophie

Sophie

distrib > Mandriva > 2007.1 > i586 > by-pkgid > d79a365d64617fce7648701c9e08618e > files > 1

mdadm-2.6.1-1mdv2007.1.src.rpm

* Sat Jun 24 2006 Luca Berra <bluca@vodka.it>
- automatically create devices if using udev

--- mdadm-2.5.1/mdadm.c.autof	2006-06-02 01:51:01.000000000 -0400
+++ mdadm-2.5.1/mdadm.c	2006-06-24 05:17:45.000000000 -0400
@@ -857,6 +857,13 @@
 		fputs(Usage, stderr);
 		exit(2);
 	}
+
+	/* if we are using udev and auto is not set, mdadm will almost
+	 * certainly fail, so we force it here.
+	 */
+	if (autof == 0 && (access("/dev/.udevdb", F_OK) == 0 || access("/dev/.udev", F_OK) == 0))
+		autof=2;
+
 	/* Ok, got the option parsing out of the way
 	 * hopefully it's mostly right but there might be some stuff
 	 * missing
@@ -873,7 +880,7 @@
 			fprintf(stderr, Name ": an md device must be given in this mode\n");
 			exit(2);
 		}
-		if ((int)ident.super_minor == -2 && autof) {
+		if ((int)ident.super_minor == -2 && autof > 2 ) {
 			fprintf(stderr, Name ": --super-minor=dev is incompatible with --auto\n");	
 			exit(2);
 		}