[PATCH] Fix handling of swap files. (#496529)

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

 



We have to try as late as possible to identify the device that contains
the swap file to maximize the chances that the filesystem will be
mounted when we go to look for it.
---
 storage/__init__.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 519ac98..48a6690 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -1481,6 +1481,17 @@ class FSSet(object):
 
     def turnOnSwap(self, anaconda, upgrading=None):
         for device in self.swapDevices:
+            if isinstance(device, FileDevice):
+                # set up FileDevices' parents now that they are accessible
+                targetDir = "%s/%s" % (anaconda.rootPath, device.path)
+                parent = get_containing_device(targetDir, self.devicetree)
+                if not parent:
+                    log.error("cannot determine which device contains "
+                              "directory %s" % device.path)
+                    device.parents = []
+                else:
+                    device.parents = [parent]
+
             try:
                 device.setup()
                 device.format.setup()
-- 
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