summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-01-12 19:14:09 +0000
committerErik Troan <ewt@redhat.com>2001-01-12 19:14:09 +0000
commit311b94823a85c1a7b09b60a9f6259372256ea66b (patch)
tree1ad77c97cf83fe54a4566b11b96afe6f4b5e0076
parent46963f51b4b262b64d1a310ee2c397e447331706 (diff)
downloadanaconda-311b94823a85c1a7b09b60a9f6259372256ea66b.tar.gz
anaconda-311b94823a85c1a7b09b60a9f6259372256ea66b.tar.xz
anaconda-311b94823a85c1a7b09b60a9f6259372256ea66b.zip
provide symbolic names for ram thresholds
-rw-r--r--isys/isys.c9
-rw-r--r--isys/isys.h4
-rw-r--r--isys/isys.py4
3 files changed, 16 insertions, 1 deletions
diff --git a/isys/isys.c b/isys/isys.c
index 82530b12b..a5f9725cc 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -741,7 +741,14 @@ static PyObject * smpAvailable(PyObject * s, PyObject * args) {
}
void init_isys(void) {
- Py_InitModule("_isys", isysModuleMethods);
+ PyObject * m, * d;
+
+ m = Py_InitModule("_isys", isysModuleMethods);
+ d = PyModule_GetDict(m);
+
+ PyDict_SetItemString(d, "MIN_RAM", PyInt_FromLong(MIN_RAM));
+ PyDict_SetItemString(d, "MIN_GUI_RAM", PyInt_FromLong(MIN_GUI_RAM));
+ PyDict_SetItemString(d, "EARLY_SWAP_RAM", PyInt_FromLong(EARLY_SWAP_RAM));
}
static PyObject * doConfigNetDevice(PyObject * s, PyObject * args) {
diff --git a/isys/isys.h b/isys/isys.h
index 9c9f929a1..b00ffde5f 100644
--- a/isys/isys.h
+++ b/isys/isys.h
@@ -3,6 +3,10 @@
#define MIN_ROOTPART_SIZE_MB 250
+#define MIN_RAM 17000 /* 20M or so */
+#define MIN_GUI_RAM 35000
+#define EARLY_SWAP_RAM 34000
+
enum driverMajor { DRIVER_NONE = 0, DRIVER_SCSI, DRIVER_NET, DRIVER_CDROM,
DRIVER_PCMCIA, DRIVER_FS, DRIVER_OTHER = 1000};
enum driverMinor { DRIVER_MINOR_NONE = 0, DRIVER_MINOR_ETHERNET,
diff --git a/isys/isys.py b/isys/isys.py
index a7956825f..5aa14bdf4 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -6,6 +6,10 @@ import os.path
mountCount = {}
+MIN_RAM = _isys.MIN_RAM
+MIN_GUI_RAM = _isys.MIN_GUI_RAM
+EARLY_SWAP_RAM = _isys.EARLY_SWAP_RAM
+
def spaceAvailable(device, fsystem = "ext2"):
mount(device, "/mnt/space", fstype = fsystem)
space = _isys.devSpaceFree("/mnt/space/.")