[PATCH] Add anaconda support for using clearpart --cdl option. (#1164240)

Samantha N. Bueno sbueno+anaconda at redhat.com
Thu Jan 15 18:59:02 UTC 2015


Use of this option instructs the installer to automatically
(re)format LDL DASDs to CDL format.

Resolves: rhbz#1164240
---
 anaconda              |  2 ++
 anaconda.spec.in      |  2 +-
 storage/__init__.py   |  5 ++++-
 storage/dasd.py       | 14 +++++++-------
 storage/devicetree.py |  3 ++-
 5 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/anaconda b/anaconda
index 09d11c2..b124c5a 100755
--- a/anaconda
+++ b/anaconda
@@ -1109,6 +1109,8 @@ if __name__ == "__main__":
             anaconda.id.storage.clearPartDisks = ksdata.clearpart.drives
             if ksdata.clearpart.initAll:
                 anaconda.id.storage.reinitializeDisks = ksdata.clearpart.initAll
+            if ksdata.clearpart.cdl:
+                anaconda.id.storage.cdl = ksdata.clearpart.cdl
 
         storage.storageInitialize(anaconda, examine_all=False)
 
diff --git a/anaconda.spec.in b/anaconda.spec.in
index c22a150..5522113 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %define intltoolver 0.31.2-3
 %define libnlver 1.0
 %define libselinuxver 1.6
-%define pykickstartver 1.74.15
+%define pykickstartver 1.74.16
 %define rpmpythonver 4.2-0.61
 %define slangver 2.0.6-2
 %define yumver 2.9.2
diff --git a/storage/__init__.py b/storage/__init__.py
index 8e227c5..dbc3147 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -318,6 +318,7 @@ class Storage(object):
         self.encryptionRetrofit = False
         self.reinitializeDisks = False
         self.zeroMbr = None
+        self.cdl = False
         self.protectedDevSpecs = []
         self.autoPartitionRequests = []
         self.eddDict = {}
@@ -344,6 +345,7 @@ class Storage(object):
                                      reinitializeDisks=self.reinitializeDisks,
                                      protected=self.protectedDevSpecs,
                                      zeroMbr=self.zeroMbr,
+                                     cdl=self.cdl,
                                      passphrase=self.encryptionPassphrase,
                                      luksDict=self.__luksDevs,
                                      iscsi=self.iscsi,
@@ -426,7 +428,7 @@ class Storage(object):
         self.iscsi.startup(self.anaconda.intf)
         self.fcoe.startup(self.anaconda.intf)
         self.zfcp.startup(self.anaconda.intf)
-        self.dasd.startup(self.anaconda.intf, self.exclusiveDisks, self.zeroMbr)
+        self.dasd.startup(self.anaconda.intf, self.exclusiveDisks, self.zeroMbr, self.cdl)
         if examine_all:
             clearPartType = CLEARPART_TYPE_NONE
         else:
@@ -444,6 +446,7 @@ class Storage(object):
                                      reinitializeDisks=self.reinitializeDisks,
                                      protected=self.protectedDevSpecs,
                                      zeroMbr=self.zeroMbr,
+                                     cdl=self.cdl,
                                      passphrase=self.encryptionPassphrase,
                                      luksDict=self.__luksDevs,
                                      iscsi=self.iscsi,
diff --git a/storage/dasd.py b/storage/dasd.py
index 10fbc58..9772168 100644
--- a/storage/dasd.py
+++ b/storage/dasd.py
@@ -58,7 +58,7 @@ class DASD:
     def __call__(self):
         return self
 
-    def startup(self, intf, exclusiveDisks, zeroMbr):
+    def startup(self, intf, exclusiveDisks, zeroMbr, cdl):
         """ Look for any unformatted DASDs in the system and offer the user
             the option for format them with dasdfmt or exit the installer.
 
@@ -69,9 +69,6 @@ class DASD:
             return
 
         self.started = True
-        out = "/dev/tty5"
-        err = "/dev/tty5"
-
         if not iutil.isS390():
             return
 
@@ -109,7 +106,7 @@ class DASD:
 
         askUser = True
 
-        if zeroMbr:
+        if zeroMbr or cdl:
             askUser = False
         elif not intf and not zeroMbr:
             log.info("    non-interactive kickstart install without zerombr "
@@ -119,18 +116,21 @@ class DASD:
         # now onto formatting our DASDs        
         if not len(self._dasdlist):
             log.info("    no unformatted DASD devices found")
-            return
         else:
             self.format_dasds(intf, askUser, self._dasdlist)
 
         if not len(self._ldldasdlist):
             log.info("    no LDL DASD devices found")
-            return
         else:
             self.format_dasds(intf, askUser, self._ldldasdlist)
 
+        return
+
     def format_dasds(self, intf, askUser, dasdlist):
         """ Iterate through a given list of DASDs and run dasdfmt on them. """
+        out = "/dev/tty5"
+        err = "/dev/tty5"
+
         c = len(dasdlist)
 
         if intf and askUser:
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 83673cc..197f6d3 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -155,7 +155,7 @@ class DeviceTree(object):
     def __init__(self, intf=None, ignored=[], exclusive=[], type=CLEARPART_TYPE_NONE,
                  clear=[], zeroMbr=None, reinitializeDisks=None, protected=[],
                  passphrase=None, luksDict=None, iscsi=None, dasd=None,
-                 mpathFriendlyNames=True):
+                 mpathFriendlyNames=True, cdl=False):
         # internal data members
         self._devices = []
         self._actions = []
@@ -173,6 +173,7 @@ class DeviceTree(object):
         self.dasd = dasd
         self.platform = platform.getPlatform(None)
         self.mpathFriendlyNames = mpathFriendlyNames
+        self.cdl = cdl
 
         # protected device specs as provided by the user
         self.protectedDevSpecs = protected
-- 
1.8.3.1



More information about the anaconda-patches mailing list