diff options
-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 [] |