diff options
author | David Lehman <dlehman@redhat.com> | 2009-04-24 13:58:21 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-04-24 15:00:37 -0500 |
commit | 090cda5b4513410a3036857ca260c40d89189457 (patch) | |
tree | 9f30ed58d7c7be2a95e50aaca2fb3bdcf2c4f0a3 | |
parent | b411847a898d4040bfd96e0e78ad289dc08c1b70 (diff) | |
download | anaconda-090cda5b4513410a3036857ca260c40d89189457.tar.gz anaconda-090cda5b4513410a3036857ca260c40d89189457.tar.xz anaconda-090cda5b4513410a3036857ca260c40d89189457.zip |
Fix handling of swap files. (#496529)
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.
-rw-r--r-- | storage/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/storage/__init__.py b/storage/__init__.py index a3fbb5dd6..de3f202d1 100644 --- a/storage/__init__.py +++ b/storage/__init__.py @@ -1483,6 +1483,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() |