[PATCH] Provide a way to skip the LUKS key check.

Chris Lumens clumens at redhat.com
Thu Feb 6 20:34:06 UTC 2014


Basically, custom partitioning does a storage check before you leave.  However,
there's no chance to set a passphrase before leaving.  Thus if the user
chooses encryption, they will always get an error before they can set the
passphrase in question.

This allows skipping the check, which should be fine for anaconda since there's
no way out custom partitioning without hitting the passphrase dialog.

Related: rhbz#1060255
---
 blivet/__init__.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index e5157ab..067e07b 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1464,13 +1464,17 @@ class Blivet(object):
            not d.format.hasKey):
             yield _("LUKS device %s has no encryption key") % (dev.name,)
 
-    def sanityCheck(self):
+    def sanityCheck(self, skipKeys=False):
         """ Run a series of tests to verify the storage configuration.
 
             This function is called at the end of partitioning so that
             we can make sure you don't have anything silly (like no /,
             a really small /, etc).  Returns (errors, warnings) where
             each is a list of strings.
+
+            If skipKeys is set, the check that all LUKS devices have a key
+            will not be performed.  Don't set this unless you have good
+            reason.
         """
         warnings = []
         errors = []
@@ -1646,7 +1650,8 @@ class Blivet(object):
             if e:
                 errors.append(e)
 
-        errors += self._verifyLUKSDevicesHaveKey()
+        if not skipKeys:
+            errors += self._verifyLUKSDevicesHaveKey()
 
         return (errors, warnings)
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list