diff options
author | Mike Fulbright <msf@redhat.com> | 2001-03-08 22:51:22 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2001-03-08 22:51:22 +0000 |
commit | 922a2a020c1c98dd4c7fd14b5305e0744d463a5d (patch) | |
tree | eaaeb6d3123c272f6aa5ed677de1e11ce827e5ec /iutil.py | |
parent | 907b20f75bcdf1c9e96bc5f18cc20d4a9435769c (diff) | |
download | anaconda-922a2a020c1c98dd4c7fd14b5305e0744d463a5d.tar.gz anaconda-922a2a020c1c98dd4c7fd14b5305e0744d463a5d.tar.xz anaconda-922a2a020c1c98dd4c7fd14b5305e0744d463a5d.zip |
bump sizes of autoallocation attempts to reflect new sizes of components, as well as 2.4 swap requirements
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1,6 +1,7 @@ import types, os, sys, isys, select, string, stat, signal import os.path +from log import * memoryOverhead = 0 @@ -175,6 +176,7 @@ def copyFile(source, to, pw = None): if pw: win.pop() + def memInstalled(corrected = 1): global memoryOverhead @@ -194,6 +196,25 @@ def memInstalled(corrected = 1): return mem +# try to keep 2.4 kernel swapper happy! +def swapSuggestion(): + mem = memInstalled(corrected=0)/1024 + mem = ((mem/16)+1)*16 + log("Detected %sM of memory", mem) + if mem < 128: + minswap = 96 + maxswap = 192 + else: + minswap = mem + if mem > 1000: + maxswap = 2000 + else: + maxswap = 2*mem + log("Swap attempt of %sM to %sM", minswap, maxswap) + + return (minswap, maxswap) + + # this is a mkdir that won't fail if a directory already exists and will # happily make all of the directories leading up to it. def mkdirChain(dir): |