diff options
author | Chris Lumens <clumens@redhat.com> | 2009-12-16 16:10:01 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-12-16 16:40:40 -0500 |
commit | f4459b4108fb8c0aad05653c7c8cdf8d3050f76a (patch) | |
tree | b9a179b567920576cc03edc4ef65a37eb5160fb3 /backend.py | |
parent | df49cb86b0466274ea058426cc1d2e6aa1d78447 (diff) | |
download | anaconda-f4459b4108fb8c0aad05653c7c8cdf8d3050f76a.tar.gz anaconda-f4459b4108fb8c0aad05653c7c8cdf8d3050f76a.tar.xz anaconda-f4459b4108fb8c0aad05653c7c8cdf8d3050f76a.zip |
Add a method to remove /tmp/install.img on low memory conditions (jvonau).
Diffstat (limited to 'backend.py')
-rw-r--r-- | backend.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backend.py b/backend.py index f87ff6554..2ed8249e8 100644 --- a/backend.py +++ b/backend.py @@ -192,6 +192,21 @@ class AnacondaBackend: os.unlink(self._loopbackFile) except SystemError: pass + + def freetmp(self, anaconda): + # installs that don't use /mnt/stage2 hold the install.img on + # a tmpfs, free this ram if things are tight. + stage2img = "/tmp/install.img" + if os.path.exists(stage2img) and iutil.memAvailable() < isys.MIN_GUI_RAM: + log.info("%s exists and low memory" % stage2img ) + # free up /tmp for more memory before yum is called, + if self.mountInstallImage(anaconda, stage2img): + return DISPATCH_BACK + try: + os.unlink(stage2img) + except SystemError: + log.info("clearing /tmp failed") + return DISPATCH_BACK def kernelVersionList(self, rootPath="/"): return [] |