[master 12/30] Use the LUKS device for swap in fstab (#1196200)
KosiehBarter
installerbot-noreply at redhat.com
Thu Jul 16 12:00:36 UTC 2015
From: Vratislav Podzimek <vpodzime at redhat.com>
If we create an encrypted swap we need to use the LUKS device in fstab for such
swap not the partition/LV.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
pyanaconda/kickstart.py | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 756eb81..3656352 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -933,6 +933,7 @@ def execute(self, storage, ksdata, instClass):
raise KickstartValueError(formatErrorMsg(self.lineno,
msg=_("The \"%s\" file system type is not supported.") % ty))
+ add_fstab_swap = None
# If we were given a pre-existing LV to create a filesystem on, we need
# to verify it and its VG exists and then schedule a new format action
# to take place there. Also, we only support a subset of all the
@@ -956,7 +957,7 @@ def execute(self, storage, ksdata, instClass):
devicetree.registerAction(ActionCreateFormat(device, fmt))
if ty == "swap":
- storage.addFstabSwap(device)
+ add_fstab_swap = device
else:
# If a previous device has claimed this mount point, delete the
# old one.
@@ -1011,7 +1012,7 @@ def execute(self, storage, ksdata, instClass):
storage.createDevice(request)
if ty == "swap":
- storage.addFstabSwap(request)
+ add_fstab_swap = request
if self.encrypted:
if self.passphrase and not storage.encryptionPassphrase:
@@ -1038,8 +1039,16 @@ def execute(self, storage, ksdata, instClass):
luksdev = LUKSDevice("luks%d" % storage.nextID,
fmt=luksformat,
parents=request)
+ if ty == "swap":
+ # swap is on the LUKS device not on the LUKS' parent device,
+ # override the info here
+ add_fstab_swap = luksdev
+
storage.createDevice(luksdev)
+ if add_fstab_swap:
+ storage.addFstabSwap(add_fstab_swap)
+
class Logging(commands.logging.FC6_Logging):
def execute(self, *args):
if logger.loglevel == DEFAULT_LEVEL:
@@ -1267,6 +1276,7 @@ def execute(self, storage, ksdata, instClass):
kwargs["primary"] = self.primOnly
+ add_fstab_swap = None
# If we were given a pre-existing partition to create a filesystem on,
# we need to verify it exists and then schedule a new format action to
# take place there. Also, we only support a subset of all the options
@@ -1289,7 +1299,7 @@ def execute(self, storage, ksdata, instClass):
devicetree.registerAction(ActionCreateFormat(device, kwargs["fmt"]))
if ty == "swap":
- storage.addFstabSwap(device)
+ add_fstab_swap = device
# tmpfs mounts are not disks and don't occupy a disk partition,
# so handle them here
elif self.fstype == "tmpfs":
@@ -1315,7 +1325,7 @@ def execute(self, storage, ksdata, instClass):
storage.createDevice(request)
if ty == "swap":
- storage.addFstabSwap(request)
+ add_fstab_swap = request
if self.encrypted:
if self.passphrase and not storage.encryptionPassphrase:
@@ -1342,8 +1352,17 @@ def execute(self, storage, ksdata, instClass):
luksdev = LUKSDevice("luks%d" % storage.nextID,
fmt=luksformat,
parents=request)
+
+ if ty == "swap":
+ # swap is on the LUKS device not on the LUKS' parent device,
+ # override the info here
+ add_fstab_swap = luksdev
+
storage.createDevice(luksdev)
+ if add_fstab_swap:
+ storage.addFstabSwap(add_fstab_swap)
+
class Raid(commands.raid.F20_Raid):
def execute(self, storage, ksdata, instClass):
for r in self.raidList:
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/46ecba5aff140cd13bebce483e2dcecd3cd7dbca
More information about the anaconda-patches
mailing list