summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-12-14 14:51:56 -0500
committerJeremy Katz <katzj@redhat.com>2007-12-14 15:56:43 -0500
commitd618cb3f847b5fd7d358f64d8f6ff24aaff63576 (patch)
treeeffc34847ab41e30ede5dc4530ac989cc7ad0872 /autopart.py
parentaff923cacd1d45b22ae232a195bb53ab50420505 (diff)
downloadanaconda-d618cb3f847b5fd7d358f64d8f6ff24aaff63576.tar.gz
anaconda-d618cb3f847b5fd7d358f64d8f6ff24aaff63576.tar.xz
anaconda-d618cb3f847b5fd7d358f64d8f6ff24aaff63576.zip
Add support for encryption via autopart.
This allows autopart (of LVM) to set up encrypted PVs to be used and adds the UI for enabling that in graphical mode. It's a little bit hacky as we rely on the fact request.encryption is set and has a passphrase for this to work
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/autopart.py b/autopart.py
index 899de6fd0..ea33c35a1 100644
--- a/autopart.py
+++ b/autopart.py
@@ -21,6 +21,7 @@ import lvm
import logging
import rhpl
from anaconda_log import logger, logFile
+import cryptodev
import partedUtils
import partRequests
from constants import *
@@ -1411,6 +1412,14 @@ def doAutoPartition(anaconda):
if req.type == REQUEST_NEW and not req.drive:
req.drive = drives
+
+ # this is kind of a hack, but if we're doing autopart encryption
+ # and the request has a crypto dev, but no passphrase, then set
+ # the passphrase to the global one
+ if partitions.autoEncrypt and req.encryption is not None and \
+ req.encryption.passphrase == "":
+ req.encryption.setPassphrase(partitions.autoEncryptPass)
+
# if this is a multidrive request, we need to create one per drive
if req.type == REQUEST_NEW and req.multidrive:
if not req.drive:
@@ -1627,6 +1636,8 @@ def autoCreateLVMPartitionRequests(autoreq):
grow = 1,
format = 1,
multidrive = 1)
+
+ nr.encryption = cryptodev.LUKSDevice(passphrase="", format=1)
requests.append(nr)
nr = partRequests.VolumeGroupRequestSpec(fstype = None,
vgname = "lvm",