diff options
author | Erik Troan <ewt@redhat.com> | 2001-02-01 23:29:52 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2001-02-01 23:29:52 +0000 |
commit | 230e939aa18d6ce40319fc42dc34086596941a41 (patch) | |
tree | 253efa619e8813e640c8ae48135205c6fe2c7a93 | |
parent | 7c6b6bc1963b7548754714d43e9e1bcd10922b87 (diff) | |
download | anaconda-230e939aa18d6ce40319fc42dc34086596941a41.tar.gz anaconda-230e939aa18d6ce40319fc42dc34086596941a41.tar.xz anaconda-230e939aa18d6ce40319fc42dc34086596941a41.zip |
added memory overhead facility
-rwxr-xr-x | anaconda | 7 | ||||
-rw-r--r-- | iutil.py | 16 |
2 files changed, 20 insertions, 3 deletions
@@ -52,7 +52,7 @@ else: try: (args, extra) = isys.getopt(theargs, 'GTRxtdr:fm:', [ 'gui', 'text', 'reconfig', 'xmode', 'test', 'debug', 'nofallback', - 'method=', 'rootpath=', 'pcic=', + 'method=', 'rootpath=', 'pcic=', "overhead=", 'testpath=', 'mountfs', 'traceonly', 'kickstart=', 'lang=', 'keymap=', 'kbdtype=', 'module=', 'class=', 'expert', 'serial', 'lowres', 'rescue']) @@ -112,6 +112,7 @@ localInstall = 0 reconfigOnly = 0 nofallback = 0 rescue = 0 +overhead = 0 runres = '800x600' # @@ -154,6 +155,8 @@ for n in args: test = 1 elif (str == '--pcic'): pcicController = arg + elif (str == '--overhead'): + overhead = int(arg) elif (str == '--rescue'): progmode = 'rescue' elif (str == '--nofallback'): @@ -237,7 +240,7 @@ from installclass import DefaultInstall from installclass import ReconfigStation from kickstart import Kickstart - +iutil.setMemoryOverhead(overhead) # # override display mode if machine cannot nicely run X @@ -2,6 +2,14 @@ import types, os, sys, isys, select, string, stat, signal import os.path +memoryOverhead = 0 + +def setMemoryOverhead(amount): + global memoryOverhead + + memoryOverhead = amount + print memoryOverhead + def getArch (): arch = os.uname ()[4] if (len (arch) == 4 and arch[0] == 'i' and @@ -162,7 +170,9 @@ def copyFile(source, to, pw = None): if pw: win.pop() -def memInstalled(): +def memInstalled(corrected = 1): + global memoryOverhead + f = open("/proc/meminfo", "r") mem = f.readlines()[1] del f @@ -174,6 +184,10 @@ def memInstalled(): except: mem = 2097151 + print corrected, memoryOverhead + if corrected: + mem = mem - memoryOverhead + return mem # this is a mkdir that won't fail if a directory already exists and will |