[PATCH] Don't write an empty mdadm.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When we've got nothing to put in there don't write mdadm.conf, this means
rc.sysinit won't call "mdadm -As --run" with an empty mdadm, this is
important because:

1) It will speed up booting
2) With an empty mdadm.conf mdamd will scan all disks and try to bring
   up any raidsets it can find. Including sets which we may not want to
   be brought up, such as ddf metadata sets (should be handled by dmraid)
   and imsm metadata sets even when nodmraid or noiswmd is specified.
---
 storage/__init__.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 9c0e79a..55d24a8 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -1927,7 +1927,8 @@ class FSSet(object):
         # /etc/mdadm.conf
         mdadm_path = os.path.normpath("%s/etc/mdadm.conf" % instPath)
         mdadm_conf = self.mdadmConf()
-        open(mdadm_path, "w").write(mdadm_conf)
+        if mdadm_conf:
+            open(mdadm_path, "w").write(mdadm_conf)
 
     def crypttab(self):
         # if we are upgrading, do we want to update crypttab?
@@ -1956,6 +1957,7 @@ class FSSet(object):
 
     def mdadmConf(self):
         """ Return the contents of mdadm.conf. """
+        retval = None
         arrays = self.devicetree.getDevicesByType("mdarray")
         arrays.extend(self.devicetree.getDevicesByType("partitionable mdarray"))
         arrays.extend(self.devicetree.getDevicesByType("mdcontainer"))
@@ -1978,8 +1980,9 @@ class FSSet(object):
 
             if writeConf:
                 conf += array.mdadmConfEntry
+                retval = conf
 
-        return conf
+        return retval
 
     def fstab (self):
         format = "%-23s %-23s %-7s %-15s %d %d\n"
-- 
1.6.4.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux