mdraid: save state dir for mdmon/mdadm for the real root
authorHarald Hoyer <harald@redhat.com>
Thu, 17 Sep 2009 10:13:54 +0000 (12:13 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 17 Sep 2009 10:13:54 +0000 (12:13 +0200)
modules.d/90mdraid/install
modules.d/90mdraid/mdmon-pre-pivot.sh [deleted file]
modules.d/90mdraid/mdmon-pre-udev.sh [new file with mode: 0644]

index 23a8fe4..69032ef 100755 (executable)
@@ -28,8 +28,8 @@ fi
 
 if [ -x  /sbin/mdmon ] ; then
     dracut_install mdmon
-    inst_hook pre-pivot 30 "$moddir/mdmon-pre-pivot.sh"
 fi 
+inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh"
 
 inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
 inst "$moddir/mdcontainer_start.sh" /sbin/mdcontainer_start
diff --git a/modules.d/90mdraid/mdmon-pre-pivot.sh b/modules.d/90mdraid/mdmon-pre-pivot.sh
deleted file mode 100644 (file)
index a542313..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# switch any mdmon instances to newroot
-if  pidof mdmon >/dev/null 2>&1; then
-    /sbin/mdmon /proc/mdstat $NEWROOT
-fi
-
diff --git a/modules.d/90mdraid/mdmon-pre-udev.sh b/modules.d/90mdraid/mdmon-pre-udev.sh
new file mode 100644 (file)
index 0000000..3fc7eb7
--- /dev/null
@@ -0,0 +1,4 @@
+# save state dir for mdmon/mdadm for the real root
+mkdir /dev/.mdadm
+[ -e /var/run/mdadm ] && rm -fr /var/run/mdadm
+ln -s /dev/.mdadm /var/run/mdadm