[PATCH 1/4] Handle clearpart in the early kickstart pass too.

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

 



---
 kickstart.py |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index c1098ed..a95762e 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -239,11 +239,17 @@ class ClearPart(commands.clearpart.FC3_ClearPart):
         if self.type is None:
             self.type = CLEARPART_TYPE_NONE
 
-        hds = map(lambda x: x.name, self.handler.id.storage.disks)
+        hds = map(udev_device_get_name, udev_get_block_devices())
         for disk in self.drives:
             if disk not in hds:
                 raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in clearpart command" % disk)
 
+        # If doing the early kickstart processing, we will not yet have an
+        # instdata attribute.  That's okay because we pull the lists right
+        # out of this class instead of the instdata.
+        if not self.handler.id:
+            return retval
+
         self.handler.id.storage.clearPartType = self.type
         self.handler.id.storage.clearPartDisks = self.drives
         if self.initAll:
@@ -1024,7 +1030,7 @@ class EarlyKSHandler(superclass):
         self.id = self.anaconda.id
 
         self.maskAllExcept(["vnc", "displaymode", "text", "cmdline",
-                            "graphical", "rescue", "ignoredisk"])
+                            "graphical", "rescue", "ignoredisk", "clearpart"])
 
 class AnacondaPreParser(KickstartParser):
     # A subclass of KickstartParser that only looks for %pre scripts and
@@ -1148,6 +1154,12 @@ def fullCommandPass(anaconda, file, earlyKS):
     import storage
     anaconda.id.storage.ignoredDisks = earlyKS.ignoredisk.ignoredisk
     anaconda.id.storage.exclusiveDisks = earlyKS.ignoredisk.onlyuse
+
+    anaconda.id.storage.clearPartType = earlyKS.clearpart.type
+    anaconda.id.storage.clearPartDisks = earlyKS.clearpart.drives
+    if earlyKS.clearpart.initAll:
+        anaconda.id.storage.reinitializeDisks = earlyKS.clearpart.initAll
+
     storage.storageInitialize(anaconda)
 
     handler = AnacondaKSHandler(anaconda)
-- 
1.6.1.3

_______________________________________________
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