From 6649a90cc082576ec8e27f26901add85ac8e49dc Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 24 Nov 2009 19:07:03 -0600 Subject: [PATCH 4/5] create-freetmp --- yuminstall.py | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/yuminstall.py b/yuminstall.py index b2ff6ac..3b5c842 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -1061,6 +1061,21 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon # unhappy (#496961) iutil.resetRpmDb(anaconda.rootPath) + 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 anaconda.backend.mountInstallImage(anaconda, stage2img): + return DISPATCH_BACK + try: + os.unlink(stage2img) + except SystemError: + log.info("clearing /tmp failed") + return DISPATCH_BACK + def doBackendSetup(self, anaconda): if anaconda.dir == DISPATCH_BACK: return DISPATCH_BACK -- 1.6.5.2