summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2001-03-08 22:51:22 +0000
committerMike Fulbright <msf@redhat.com>2001-03-08 22:51:22 +0000
commit922a2a020c1c98dd4c7fd14b5305e0744d463a5d (patch)
treeeaaeb6d3123c272f6aa5ed677de1e11ce827e5ec /iutil.py
parent907b20f75bcdf1c9e96bc5f18cc20d4a9435769c (diff)
downloadanaconda-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.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/iutil.py b/iutil.py
index 1965e376c..ccef5cb02 100644
--- a/iutil.py
+++ b/iutil.py
@@ -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):