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

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Jan 20 19:57:46 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 +-
 iw/filter_gui.py      | 3 ++-
 kickstart.py          | 4 ++--
 storage/__init__.py   | 5 ++++-
 storage/dasd.py       | 4 ++--
 storage/devicetree.py | 3 ++-
 7 files changed, 15 insertions(+), 8 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/iw/filter_gui.py b/iw/filter_gui.py
index 9f6efaf..6c6f0df 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -639,7 +639,8 @@ class FilterWindow(InstallWindow):
         storage.zfcp.ZFCP().startup(anaconda.intf)
         storage.dasd.DASD().startup(anaconda.intf,
                                     anaconda.id.storage.exclusiveDisks,
-                                    anaconda.id.storage.zeroMbr)
+                                    anaconda.id.storage.zeroMbr,
+                                    anaconda.id.storage.cdl)
         disks = filter(lambda d: udev_device_is_disk(d) and \
                                  not udev_device_is_dm(d) and \
                                  not udev_device_is_md(d) and \
diff --git a/kickstart.py b/kickstart.py
index 13e8798..92ada70 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -338,9 +338,9 @@ class Bootloader(commands.bootloader.RHEL6_Bootloader):
         anaconda.id.ksdata.permanentSkipSteps.extend(["upgbootloader", "bootloader"])
         anaconda.id.ksdata.skipOnTextInteractive.extend(["upgbootloader", "bootloader"])
 
-class ClearPart(commands.clearpart.FC3_ClearPart):
+class ClearPart(commands.clearpart.RHEL6_ClearPart):
     def parse(self, args):
-        retval = commands.clearpart.FC3_ClearPart.parse(self, args)
+        retval = commands.clearpart.RHEL6_ClearPart.parse(self, args)
 
         if self.type is None:
             self.type = CLEARPART_TYPE_NONE
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 5c197da..17f81bd 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.
 
@@ -107,7 +107,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 "
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 83673cc..b9348a6 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 = []
@@ -168,6 +168,7 @@ class DeviceTree(object):
         self.clearPartType = type
         self.clearPartDisks = clear
         self.zeroMbr = zeroMbr
+        self.cdl = cdl
         self.reinitializeDisks = reinitializeDisks
         self.iscsi = iscsi
         self.dasd = dasd
-- 
1.8.3.1



More information about the anaconda-patches mailing list