[arch-commits] Commit in mdadm/trunk (3 files)

Tobias Powalowski tpowa at archlinux.org
Fri Mar 19 00:00:11 CET 2010


    Date: Thursday, March 18, 2010 @ 19:00:10
  Author: tpowa
Revision: 72624

upgpkg: mdadm 3.1.2-2
fixed udev hang

Added:
  mdadm/trunk/mdadm-3.1.2-fix-udev.patch
  mdadm/trunk/mdadm-3.1.2-mapfile.patch
Modified:
  mdadm/trunk/PKGBUILD

----------------------------+
 PKGBUILD                   |   14 +++++++++++---
 mdadm-3.1.2-fix-udev.patch |   11 +++++++++++
 mdadm-3.1.2-mapfile.patch  |   40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-03-18 21:12:15 UTC (rev 72623)
+++ PKGBUILD	2010-03-18 23:00:10 UTC (rev 72624)
@@ -3,7 +3,7 @@
 # Contributor: Judd Vinet <jvinet at zeroflux.org>
 pkgname=mdadm
 pkgver=3.1.2
-pkgrel=1
+pkgrel=2
 pkgdesc="A tool for managing/monitoring Linux md device arrays, also known as Software RAID"
 arch=(i686 x86_64)
 license=('GPL')
@@ -16,17 +16,24 @@
         mdadm 
         mdadm.conf 
         mdadm_install
-        mdadm_hook)
+        mdadm_hook
+        mdadm-3.1.2-mapfile.patch
+        mdadm-3.1.2-fix-udev.patch)
 install=mdadm.install
 replaces=('raidtools')
 md5sums=('c5a39f38c465229767a5af2a4eb81bef'
          '6df172c8f77b280018cf87eb3d313f29'
          '00cbed931db4f15b6ce49e3e7d433966'
          '865c3d39e5f5dae58388160b563981f1'
-         '1a3eb63832cecd6550f5b0a21d58cfdb')
+         '1a3eb63832cecd6550f5b0a21d58cfdb'
+         'b8e4f97a0045c958202758a88a822331'
+         '5251b6a53992308cad199a4ea1e19420')
 
 build() {
   cd $srcdir/$pkgname-$pkgver
+  # fix udev hang
+  patch -Np1 -i ../mdadm-3.1.2-mapfile.patch || return 1
+  patch -Np0 -i ../mdadm-3.1.2-fix-udev.patch || return 1
   make || return 1
   make INSTALL=/bin/install DESTDIR=$pkgdir install
   install -D -m644 ../mdadm.conf $pkgdir/etc/mdadm.conf
@@ -39,3 +46,4 @@
   make MDASSEMBLE_AUTO=1 mdassemble
   install -D -m755 mdassemble $pkgdir/sbin/mdassemble
 }
+

Added: mdadm-3.1.2-fix-udev.patch
===================================================================
--- mdadm-3.1.2-fix-udev.patch	                        (rev 0)
+++ mdadm-3.1.2-fix-udev.patch	2010-03-18 23:00:10 UTC (rev 72624)
@@ -0,0 +1,11 @@
+--- Makefile~	2010-03-18 23:52:23.000000000 +0100
++++ Makefile	2010-03-18 23:52:23.000000000 +0100
+@@ -62,7 +62,7 @@
+ # from early boot to late boot.
+ # If you don't have /lib/init/rw you might want to use /dev/.something
+ #  e.g. make ALT_RUN=/dev/.mdadm
+-ALT_RUN = /lib/init/rw
++ALT_RUN = /dev/md
+ VAR_RUN = /var/run
+ ALTFLAGS = -DALT_RUN=\"$(ALT_RUN)\"
+ VARFLAGS = -DVAR_RUN=\"$(VAR_RUN)\"

Added: mdadm-3.1.2-mapfile.patch
===================================================================
--- mdadm-3.1.2-mapfile.patch	                        (rev 0)
+++ mdadm-3.1.2-mapfile.patch	2010-03-18 23:00:10 UTC (rev 72624)
@@ -0,0 +1,40 @@
+commit b25462c1bee1a01c6aae3c215e040bfb2f1c2fb7
+Author: Doug Ledford <dledford at redhat.com>
+Date:   Tue Mar 16 23:00:11 2010 -0400
+
+    Create /dev/md in mapfile open like we do in mdopen if our ALT_RUN is
+    set to be /dev/md.  This keeps udev happy as it won't have to special
+    case our /dev/md directory needs.
+    
+    Signed-off-by: Doug Ledford <dledford at redhat.com>
+
+diff --git a/mapfile.c b/mapfile.c
+index 366ebe3..eed17c8 100644
+--- a/mapfile.c
++++ b/mapfile.c
+@@ -29,7 +29,7 @@
+  */
+ 
+ /* /var/run/mdadm.map is used to track arrays being created in --incremental
+- * more.  It particularly allows lookup from UUID to array device, but
++ * mode.  It particularly allows lookup from UUID to array device, but
+  * also allows the array device name to be easily found.
+  *
+  * The map file is line based with space separated fields.  The fields are:
+@@ -64,6 +64,16 @@ char *mapsmode[3] = { "r", "w", "w"};
+ FILE *open_map(int modenum, int *choice)
+ {
+ 	int i;
++	struct stat sbuf;
++
++	/* Special case...if ALT_RUN is selected to be /dev/md, then
++	 * because we would normally create /dev/md ourselves in order to
++	 * stuff array symlinks in there as needed, udev and friends
++	 * expect us to create our own tree.  So, do so.
++	 */
++	if (strcmp(ALT_RUN, "/dev/md") == 0 && stat(ALT_RUN, &sbuf) != 0)
++		mkdir(ALT_RUN, 0755);
++
+ 	for (i = 0 ; i < 3 ; i++) {
+ 		int fd = open(mapname[i][modenum], mapmode[modenum], 0600);
+ 		if (fd >= 0) {



More information about the arch-commits mailing list