[PATCH 1/1] Make sure we turn on swap flag. (#503457)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 storage/devices.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index b5e32af..2a9578d 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1130,6 +1130,15 @@ class PartitionDevice(StorageDevice):
         log_method_call(self, self.name)
         StorageDevice._setFormat(self, format)
 
+        if format.type == "swap":
+            if self.flagAvailable(parted.PARTITION_SWAP):
+                self.setFlag(parted.PARTITION_SWAP)
+            else:
+                # Swap will still work if we fail.
+                log.error("Failed to activate swap flag on %s" % self.name)
+        else:
+            self.unsetFlag(parted.PARTITION_SWAP)
+
     def _setBootable(self, bootable):
         """ Set the bootable flag for this partition. """
         if self.partedPartition:
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux