Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/kickstart.py | 13 +++++++++++++ pyanaconda/ui/gui/spokes/custom.py | 3 +++ 2 files changed, 16 insertions(+)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 12797a6..b376728 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -353,6 +353,9 @@ class BTRFSData(commands.btrfs.F17_BTRFSData):
if not device: raise KickstartValueError(formatErrorMsg(self.lineno, msg="Specified nonexistent BTRFS volume %s in btrfs command" % self.name)) + + if ty == "swap": + storage.add_fstab_swap(device.format) else: # If a previous device has claimed this mount point, delete the # old one. @@ -371,6 +374,8 @@ class BTRFSData(commands.btrfs.F17_BTRFSData): parents=members)
storage.createDevice(request) + if ty == "swap": + storage.add_fstab_swap(request.format)
class Realm(commands.realm.F19_Realm): @@ -756,6 +761,8 @@ class LogVolData(commands.logvol.F20_LogVolData): msg="Invalid target size (%d) for device %s" % (self.size, device.name)))
devicetree.registerAction(ActionCreateFormat(device, fmt)) + if ty == "swap": + storage.add_fstab_swap(device.format) else: # If a previous device has claimed this mount point, delete the # old one. @@ -789,6 +796,8 @@ class LogVolData(commands.logvol.F20_LogVolData): **pool_args)
storage.createDevice(request) + if ty == "swap": + storage.add_fstab_swap(request.format)
if self.encrypted: if self.passphrase and not storage.encryptionPassphrase: @@ -1026,6 +1035,8 @@ class PartitionData(commands.partition.F18_PartData): msg="Invalid target size (%d) for device %s" % (self.size, device.name)))
devicetree.registerAction(ActionCreateFormat(device, kwargs["format"])) + if ty == "swap": + storage.add_fstab_swap(device.format) else: # If a previous device has claimed this mount point, delete the # old one. @@ -1038,6 +1049,8 @@ class PartitionData(commands.partition.F18_PartData):
request = storage.newPartition(**kwargs) storage.createDevice(request) + if ty == "swap": + storage.add_fstab_swap(request.format)
if self.encrypted: if self.passphrase and not storage.encryptionPassphrase: diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 16b73ba..710f33b 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -666,6 +666,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self.storage.devicetree.names = self.__storage.devicetree.names self.storage.roots = self.__storage.roots
+ new_swaps = (dev.format for dev in self.new_devices if dev.format.type == "swap") + self.storage.set_fstab_swaps(new_swaps) + # update the global passphrase self.data.autopart.passphrase = self.passphrase