[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Support --encrypted --useexisting on kickstart installs (#497147).
- From: Chris Lumens <clumens redhat com>
- To: anaconda-devel-list redhat com
- Cc:
- Subject: [PATCH] Support --encrypted --useexisting on kickstart installs (#497147).
- Date: Thu, 23 Apr 2009 13:28:34 -0400
---
kickstart.py | 58 +++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/kickstart.py b/kickstart.py
index dca282d..ba551dd 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -391,8 +391,7 @@ class LogVol(commands.logvol.F9_LogVol):
if tmp:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Logical volume name already used in volume group %s" % vg.name)
- # Size specification checks
- if not lvd.preexist:
+ # Size specification checks
if lvd.percent == 0:
if lvd.size == 0:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Size required")
@@ -437,11 +436,18 @@ class LogVol(commands.logvol.F9_LogVol):
if lvd.passphrase and not storage.encryptionPassphrase:
storage.encryptionPassphrase = lvd.passphrase
- luksformat = request.format
- request.format = getFormat("luks", passphrase=lvd.passphrase, device=request.path)
- luksdev = LUKSDevice("luks%d" % storage.nextID,
- format=luksformat,
- parents=request)
+ if lvd.preexist:
+ luksformat = format
+ device.format = getFormat("luks", passphrase=lvd.passphrase, device=device.path)
+ luksdev = LUKSDevice("luks%d" % storage.nextID,
+ format=luksformat,
+ parents=device)
+ else:
+ luksformat = request.format
+ request.format = getFormat("luks", passphrase=lvd.passphrase, device=request.path)
+ luksdev = LUKSDevice("luks%d" % storage.nextID,
+ format=luksformat,
+ parents=request)
storage.createDevice(luksdev)
self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
@@ -586,8 +592,6 @@ class Partition(commands.partition.F9_Partition):
type = "EFI System Partition"
pd.fsopts = "defaults,uid=0,gid=0,umask=0077,shortname=winnt"
kwargs["weight"] = self.handler.anaconda.platform.weight(fstype="efi")
- elif pd.mountpoint == "/boot":
- type = self.handler.anaconda.platform.bootFSType
else:
if pd.fstype != "":
type = pd.fstype
@@ -663,11 +667,18 @@ class Partition(commands.partition.F9_Partition):
if pd.passphrase and not storage.encryptionPassphrase:
storage.encryptionPassphrase = pd.passphrase
- luksformat = request.format
- request.format = getFormat("luks", passphrase=pd.passphrase, device=request.path)
- luksdev = LUKSDevice("luks%d" % storage.nextID,
- format=luksformat,
- parents=request)
+ if pd.preexist:
+ luksformat = format
+ device.format = getFormat("luks", passphrase=pd.passphrase, device=device.path)
+ luksdev = LUKSDevice("luks%d" % storage.nextID,
+ format=luksformat,
+ parents=device)
+ else:
+ luksformat = request.format
+ request.format = getFormat("luks", passphrase=pd.passphrase, device=request.path)
+ luksdev = LUKSDevice("luks%d" % storage.nextID,
+ format=luksformat,
+ parents=request)
storage.createDevice(luksdev)
self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
@@ -702,8 +713,6 @@ class Raid(commands.raid.F9_Raid):
raise KickstartValueError, formatErrorMsg(self.lineno, msg="PV partition defined multiple times")
rd.mountpoint = ""
- elif rd.mountpoint == "/boot" and self.handler.anaconda.platform.supportsMdRaidBoot:
- type = self.handler.anaconda.platform.bootFSType
else:
if rd.fstype != "":
type = rd.fstype
@@ -782,11 +791,18 @@ class Raid(commands.raid.F9_Raid):
if rd.passphrase and not storage.encryptionPassphrase:
storage.encryptionPassphrase = rd.passphrase
- luksformat = request.format
- request.format = getFormat("luks", passphrase=rd.passphrase, device=request.path)
- luksdev = LUKSDevice("luks%d" % storage.nextID,
- format=luksformat,
- parents=request)
+ if rd.preexist:
+ luksformat = format
+ device.format = getFormat("luks", passphrase=rd.passphrase, device=device.path)
+ luksdev = LUKSDevice("luks%d" % storage.nextID,
+ format=luksformat,
+ parents=device)
+ else:
+ luksformat = request.format
+ request.format = getFormat("luks", passphrase=rd.passphrase, device=request.path)
+ luksdev = LUKSDevice("luks%d" % storage.nextID,
+ format=luksformat,
+ parents=request)
storage.createDevice(luksdev)
self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
--
1.6.1.3
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]