[PATCH] Don't do format-specific processing on devices targeted by clearpart. (#492123)

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

 



---
 cmdline.py            |   14 ++++++++++++++
 storage/__init__.py   |    2 ++
 storage/devicetree.py |   17 ++++++++++++++++-
 3 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/cmdline.py b/cmdline.py
index f87550c..9b161ab 100644
--- a/cmdline.py
+++ b/cmdline.py
@@ -104,6 +104,20 @@ class InstallInterface:
             while 1:
                 time.sleep(5)
 
+    def passphraseEntryWindow(self, device):
+        print(_("Can't have a question in command line mode!"))
+        print("(passphraseEntryWindow: '%s')" % device.path)
+        # don't exit
+        while 1:
+            time.sleep(5)
+
+    def getLUKSPassphrase(self, passphrase = "", isglobal = False):
+        print(_("Can't have a question in command line mode!"))
+        print("(getLUKSPassphrase)")
+        # don't exit
+        while 1:
+            time.sleep(5)
+
     def exceptionWindow(self, shortText, longTextFile):
         print(shortText)
 
diff --git a/storage/__init__.py b/storage/__init__.py
index fd9f289..940373d 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -199,6 +199,7 @@ class Storage(object):
                                      ignored=self.ignoredDisks,
                                      exclusive=self.exclusiveDisks,
                                      clear=self.clearPartDisks,
+                                     clearpart=self.clearPartType,
                                      reinitializeDisks=self.reinitializeDisks,
                                      protected=self.protectedPartitions,
                                      zeroMbr=self.zeroMbr,
@@ -257,6 +258,7 @@ class Storage(object):
                                          ignored=self.ignoredDisks,
                                          exclusive=self.exclusiveDisks,
                                          clear=self.clearPartDisks,
+                                         clearpart=self.clearPartType,
                                          reinitializeDisks=self.reinitializeDisks,
                                          protected=self.protectedPartitions,
                                          zeroMbr=self.zeroMbr,
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 458e5a8..fd5a1cc 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -24,6 +24,8 @@ import os
 import block
 import re
 
+from pykickstart.constants import *
+
 from errors import *
 from devices import *
 from deviceaction import *
@@ -188,13 +190,14 @@ class DeviceTree(object):
 
     def __init__(self, intf=None, ignored=[], exclusive=[], clear=[],
                  zeroMbr=None, reinitializeDisks=None, protected=[],
-                 passphrase=None, luksDict=None):
+                 clearpart=None, passphrase=None, luksDict=None):
         # internal data members
         self._devices = []
         self._actions = []
 
         self.intf = intf
         self.exclusiveDisks = exclusive
+        self.clearPartType = clearpart
         self.clearPartDisks = clear
         self.zeroMbr = zeroMbr
         self.reinitializeDisks = reinitializeDisks
@@ -1156,6 +1159,18 @@ class DeviceTree(object):
             format = formats.getFormat(*args, **kwargs)
             device.format = format
 
+        if self.clearPartType in (CLEARPART_TYPE_LINUX, CLEARPART_TYPE_ALL):
+            if not self.clearPartDisks:
+                # we're clearing all disks
+                return
+
+            for disk in self.clearPartDisks:
+                # if this device is going to be cleared we don't need to
+                # continue messing with it
+                dev = self.getDeviceByName(disk)
+                if dev and dev == device or device.dependsOn(dev):
+                    return
+
         #
         # now lookup or create any compound devices we have discovered
         #        
-- 
1.6.0.6

_______________________________________________
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