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)
If the user chooses to encrypt a filesystem, then we will prompt for a passphrase after running the check. Without the flag, that would cause an error to be displayed before the user could have done anything about it. --- anaconda.spec.in | 2 +- pyanaconda/ui/gui/spokes/custom.py | 2 +- pyanaconda/ui/gui/spokes/storage.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in index 49e74ba..216ae60 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -80,7 +80,7 @@ BuildRequires: s390utils-devel %endif
Requires: anaconda-widgets = %{version}-%{release} -Requires: python-blivet >= 0.18.19 +Requires: python-blivet >= 0.18.24 Requires: gnome-icon-theme-symbolic Requires: python-meh >= %{mehver} Requires: libreport-anaconda >= 2.0.21-1 diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index b2fdc9b..7d3d1a2 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1962,7 +1962,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): StorageChecker.errors = str(e).split("\n") self.data.bootloader.bootDrive = ""
- StorageChecker.checkStorage(self) + StorageChecker.checkStorage(self, skipKeys=True)
if self.errors: self.set_warning(_("Error checking storage configuration. Click for details or press Done again to continue.")) diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index f14a681..91b843b 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -225,13 +225,13 @@ class StorageChecker(object): threadMgr.add(AnacondaThread(name=constants.THREAD_CHECK_STORAGE, target=self.checkStorage))
- def checkStorage(self): + def checkStorage(self, skipKeys=False): threadMgr.wait(constants.THREAD_EXECUTE_STORAGE)
hubQ.send_not_ready(self._mainSpokeClass) hubQ.send_message(self._mainSpokeClass, _("Checking storage configuration...")) (StorageChecker.errors, - StorageChecker.warnings) = self.storage.sanityCheck() + StorageChecker.warnings) = self.storage.sanityCheck(skipKeys=skipKeys) hubQ.send_ready(self._mainSpokeClass, True) for e in StorageChecker.errors: log.error(e)
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
Ignore these two. mulhern has a better approach in the works.
- Chris
anaconda-patches@lists.fedorahosted.org